cancel
Showing results for 
Search instead for 
Did you mean: 

How to pass Approve/Reject Comment of Approve Request Application into Workflow

Former Member
0 Kudos

Hi,

We have implemented Approve request Application in Fiori , in launchpad when Approver is rejecting the request he is giving some rejection comments .which we can see is getting stored as an attachment in R3 System,now we want to read this rejected reason  from attachment and pass it to a simple variable which workflow team has created for storing rejection comments.

Kindly advice how we can read rejected reason and pass it to simple variable of workflow.

Regards,

Trilochan

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Prem,

Thanks for the reply,As we can see comments entred in fiori is coming as an attachment in workflow but we want to pass it into a simple container variable for that we have created a variable in Workflow now  we want to pass value from Fiori reject box to this Container variable but we don't know how to achieve this for Approve request Application.

Regards,

Trilochan

masa_139
Product and Topic Expert
Product and Topic Expert
masa_139
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Trilochan,

Maybe you were looking for the function module SO_DOCUMENT_READ_API1.

Please look at .

Regards,

Masa / SAP Technology RIG

Answers (2)

Answers (2)

former_member193808
Active Contributor
0 Kudos

Hi Trilochan,

What are you trying to achieve by customizing the approve / reject button currently?

Are you currently providing a pop up feature for user in standard system when they approve/reject PR?

If so, you can change the logic to point to the standard Text (08 for PR).

For example, in case of PR, if you add an entry under MM->Purchasing->PR->Text for PR->Define Text type, (the code should be 08 here) the same will appear in your SAP PR Item Text screen. Fiori will automatically fetch the data entered in this screen. If you try to approve/reject a PR from Fiori, the comments added by user will be stored over here. If somebody put any comment, the higher / next level user can see this as a note when they open this PR. (Extra icon will appear).

So, better to configure 08 text type for PR and use the same.

If you are using some logic currently for standard ECC, the same can point to the new text.

In case of PO, the code is 18.

Thanks,

Prem

masa_139
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Trilochan,

Please take a look .

Regards,

Masa

Former Member
0 Kudos

Hi Masa,

Thanks actually our workflow team wants us to tell how exactly they will make this change.

they want to know from attachment area (which field they have to read) how they will read this value and pass it to there variable they want  this information in detail.

Regards,

Trilochan

masa_139
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Trilochan,

Please get information how workflow team got rejection comment in the workflow without Fiori.

I'm sure they have tested the workflow in SAPGUI before implementing Fiori.

Regards,

Masa

Former Member
0 Kudos

Hi Masa,

what i can see:

Code used

begin_method zprovide_rejection_reason changing container.

DATA : ev_rej_reason_text TYPE char100,

        ev_name            TYPE bapiaddr3-firstname.

CALL FUNCTION 'ZMM_GET_REJECTION_REASON'     " Get the Rejection Reason

   IMPORTING

     ev_text = ev_rej_reason_text.

DATA : lv_address  TYPE bapiaddr3,

        lv_username TYPE bapibname-bapibname,

        lit_return  TYPE TABLE OF bapiret2.

MOVE sy-uname TO lv_username.

CALL FUNCTION 'BAPI_USER_GET_DETAIL'           " Get the user details

   EXPORTING

     username = lv_username

   IMPORTING

     address  = lv_address

   TABLES

     return   = lit_return.

IF lv_address-firstname IS NOT INITIAL AND lv_address-lastname IS NOT INITIAL.

   CONCATENATE lv_address-firstname lv_address-lastname INTO ev_name SEPARATED BY space.

ENDIF.

swc_set_element container 'EV_REJ_REASON_TEXT' ev_rej_reason_text.

swc_set_element container 'EV_NAME' ev_name.

end_method.

* Begin of change by VRANA on 01/08/2014

BEGIN_METHOD ZGETDETAIL CHANGING CONTAINER.

DATA:

       VENDOR TYPE KNA1-KUNNR,

       MATERIAL TYPE MARA-MATNR,

       QUANTITY TYPE MARA-BRGEW.

select single MATNR MENGE LIFNR from eban

      into (MATERIAL,QUANTITY,VENDOR)

      where BANFN = object-key-number and

            BNFPO = object-key-item.

   IF sy-subrc eq 0.

   SWC_SET_ELEMENT CONTAINER 'Vendor' VENDOR.

   SWC_SET_ELEMENT CONTAINER 'Material' MATERIAL.

   SWC_SET_ELEMENT CONTAINER 'Quantity' QUANTITY.

     ENDIF.

END_METHOD.         



Function module code used above:

FUNCTION ZMM_GET_REJECTION_REASON.

*"----------------------------------------------------------------------

*"*"Local Interface:

*"  EXPORTING

*"     REFERENCE(EV_TEXT) TYPE  CHAR100

*"----------------------------------------------------------------------

CALL SCREEN '0100'

   STARTING AT  9

   ENDING   AT 120 11.

move gv_rej_reason_text to ev_text.

ENDFUNCTION.




Regards,

Trilochan

masa_139
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Trilochan,

Fiori is not SAPGUI transaction so the "call screen" statement in the FM ZMM_GET_REJECTION_REASON does not work. The ABAP code should be changed.

Regards,

Masa

Former Member
0 Kudos

Thanks Masa,

i understand that,now our workflow team wants us the exact code which they have to write to read fiori reject comment and pass it to the variable they have created but i am not having workflow knowledge to guide them.

Regards,

Trilochan

masa_139
Product and Topic Expert
Product and Topic Expert