Skip to Content
avatar image
Former Member

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

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

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Sep 02, 2010 at 07:08 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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