Skip to Content

behaviour of BADI /SAPSRM/BD_WF_PROCESS_RESTART in workflow

Dear SAP gurus,

We're encountering the same issue as in post SRM 7.0 PC Workflow - Restart BADI behaviour /SAPSRM/BD_WF_PROCESS_RESTART

We observe that the restart workflow does triggered twice, and in the second run, there is no difference anymore between the one being processed and the one in the database. As there is no difference anymore we cannot know in which case we should restart and which case we should NOT restart (the requirement is to restart ONLY if quantity is changed).

As from the previous post, the sample coding provided by Bharatan is not working as if we write like he suggest:

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.

There will be NO difference at all between lt_item_detail_line-QUANTITY and lt_PDIGP_master-QUANTITY --> as apparently in the second run of BADI restart, SAP already update the data into table BBP_PDIGP

Can anyone shed light on this matter?

Best regards,

John

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Feb 02, 2012 at 10:40 AM

    We adapt our coding to the observed behaviour. In the first run, we export the data to memory id which then will be imported in the second run.

    Add comment
    10|10000 characters needed characters exceeded