cancel
Showing results for 
Search instead for 
Did you mean: 

SRM 7.0 PC Workflow - Restart BADI behaviour /SAPSRM/BD_WF_PROCESS_RESTART

Former Member
0 Kudos

Hi,

I have a scenario to control the restart of the BRF SC worklfow only if price of the document is changed while in awaiting

approval state.

I implemented the BADI /SAPSRM/BD_WF_PROCESS_RESTART, but unfortunately the behaviour of BADI is not at all supporting to restart the workflow based on the condition.

I noticed the behaviour of triggerring of this BADI as follows

When in awaiting approval state the requestor can change the document.

1. Once click on EDIT BADI gets triggered

2. after changing the document values once Order clicked it will be called twice.

Is it normal behaviour or is there any problem in my custome SRM system?

If this is normal, can you please guide how to implement this BADI?

Can you provide your experience on this BADI?

Deeply appreciate the your help.

Thanks & Regards,

Yaseen M

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

First check whether your BADI Z implementation is active..

I advice to implement the logic under "VALIDATE_RESTART" method which makes more sense..

But the problem is I don't find any concrete logic to code because SC will not create versions like PO or Bid document dose..

All the changes are simply stored in a change document table, If a SC changed more than once then you will find multiple entries in the table as a result you can't validate only for price field here :-(..

Thanks!!

Bharath

Former Member
0 Kudos

Hi Bharat,

The main problem is not with extracting price condition values, it can be done by choosing the latest counter in the change table.

But my issue with BADI triggering twice for a single click of Order. Due to this the change table values are getting updated with the new values in the second call and BADI condition always fails and cant control the restart using this BADI.

First of all I want to know whether this behaviour is right and second one is if it is right, how to control this BADI to check our conditions.

Thanks,

Yaseen M

Former Member
0 Kudos

Ok I tried it by implementing in my system.. Itu2019s getting triggered twice, So its normal behavior for sure..

We need to finger out logic here... I will try to find any..

Thanks!!

Bharath

Former Member
0 Kudos

Here is the logic.. this works perfect for me..

DATA:

  • Internal Table to hold Shopping Cart Item details ...

lt_item_detail TYPE bbpt_pd_sc_item_d,

  • Internal Table to hold Shopping Cart Item Master table details ...

lt_PDIGP_master TYPE BBP_PDIGP,

  • Work Area to hold Shopping Cart Item details ...

lt_item_detail_line LIKE LINE OF lt_item_detail,

  • Work Area to hold shopping cart details ...

lwa_sc_header TYPE bbp_pds_sc_header_d.

  • Fetch Shopping Cart Item details ...

CALL FUNCTION 'BBP_PD_SC_GETDETAIL'

EXPORTING

i_guid = is_document-document_guid

i_with_itemdata = 'X'

IMPORTING

e_header = lwa_sc_header

TABLES

e_item = lt_item_detail.

Loop at lt_item_detail into lt_item_detail_line.

SELECT *

from BBP_PDIGP into lt_PDIGP_master

Where GUID = lt_item_detail_line-GUID.

ENDSELECT.

IF lt_item_detail_line-QUANTITY GT lt_PDIGP_master-QUANTITY.

EV_RESTART = ''.

ELSE.

EV_RESTART = 'X'.

ENDIF.

ENDLOOP.

Thanks!!

Bharath