cancel
Showing results for 
Search instead for 
Did you mean: 

Shopping cart workflow restart

Former Member
0 Kudos

Hello experts,

We are inSRM 7.0 using BRF and have folowing requirement.

1. if the manager chages the shopping cart that affects price/quantity , then carts goes to the user who has created SC.

2. if the manager changes some thing not related to price, the cart goes for regualr approval process.

To achieve this I am using the Badi u2019 /SAPSRM/BD_WF_PROCESS_RESTARTu2019 .and method is VALIDATE_RESTART. I also know by keeping EV_RESTART = 'X'. it can be done. It is working when I keep EV_RESTART = 'X'. But if i don't know how to send it back to creator based on the changed value ( changes in price/quantity )? How should I comapre old and new values from shopping carts ? Which mehods or function do I need to call to achieve this ?

Please advise. Thank you.

Best regards.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi abhijeet

I do agree with marina that the FM will have the runtime saved or changed data. So to get the previous data check in table BBP_PDIGP compare the price and quantity fields and accordingly modify the field EV_RESTART.

regards

sahil p

Former Member
0 Kudos

Thank you Sahil, Melina for your replies. Very informative.

I called a FM 'BBP_CHANGE_DOC_GET_NEW' and did following

t_change TYPE bbpt_changedoc_cdred,
wa_change like LINE OF it_change.

CALL FUNCTION 'BBP_CHANGE_DOC_GET_NEW'
   EXPORTING
     IV_HEADER_GUID            = is_document-document_guid
*   IT_ITEM                   = lt_PDIGP_master
*   IV_WITH_VERSIONS          =
*   IV_OBJECTTYPE             =
   IMPORTING
     ET_CHANGE_DOCUMENTS       = IT_CHANGE
*   ET_COUNT                  =
*   EV_HEADER_DESCRIPT        =
*   EV_VERSIONS_EXIST         =
* EXCEPTIONS
*   ERROR_1                   = 1
*   OTHERS                    = 2

 loop at IT_CHANGE INTO wa_change.
    if ( wa_change-FNAME eq 'TOTAL_VALUE' ) and ( wa_change-F_OLD <> wa_change-F_NEW ).
      EV_RESTART = 'X'.
      exit.
      ELSE.
        EV_RESTART = ''.
        endif.
  ENDLOOP.

It restarts. I debugged when conditions are true it hits to the BAdI and process is restarted.

My query is the approver triggers twice. Logically it should send back to creater of the shopping cart. But it doesn't. Is there any specific logic to send this SC back to creator again? Please advise/suggest.

Thank you.

Best regards.

Former Member
0 Kudos

Dear Abhijeet,

In SRM whenever there is a change in SC under awaiting approval mode or process restart for workflow, system identifies and transfer to the Creator of SC. this is standard behaviour and it works accordingly.

In your case I must prefer to say there may be some patch missing while configuration so its better report it to SAP and get to know about some SAP note or anyhting related.

To be clever check the t-code SWI2_FREQ , give the task ws40000014 , raise the dialog and subworkflow check box and execute the transaction.

Try to check to the SC with whom it is pending after process restart and also check who is the current process level of approval.

regards

sahil p

Former Member
0 Kudos

Hi,

The FM /SAPSRM/BD_WF_PROCESS_RESTART only will bring already saved data. So here what you should do is to compare the data stored already on the database with the data that is on the buffer (changed data) using the same guid for comparison.

Thus you need always to compare data to take it. You can use the 'BBP_PD_SC_GETDETAIL' for example.

Please also take a look on the thread:

[|]

Thanks,

Melina