cancel
Showing results for 
Search instead for 
Did you mean: 

Determine "old" sc items when BBP_DOC_CHANGE_BADI is called

Former Member
0 Kudos

SRM 4.0 Question: (probably relevant for previous and later releases also)

Is there any standard function module that can determine the "old" sc items when BBP_DOC_CHANGE_BADI is called?

The "current" sc items can be accessed in the table et_item, but I need to perform a comparison in order to determine the latest added sc items.

Perhaps there is a field in the table et_item that indicates if the item has been added during the latest "update cycle" ?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

The badi "BBP_DOC_CHANGE_BADI" is called in the CHANGE/CREATE mode and before you SAVE the document.So whatever data you see in the IT_ITEM table is the current data and not the changed data.

May be you can try using the BADI BBP_DOC_SAVE_BADI which is called after you save the document.

BR,

Disha.

Do reward points for useful answers.

Former Member
0 Kudos

Thanks for your input Disha,

This information is required upon adding items to the shopping cart, i.e. when pressing the "add to shopping cart" button under "Old purchase orders and templates".

BBP_DOC_SAVE_BADI will not help me here...

To clearify, I need to see the sc items that did exist before "add to shopping cart" was pressed, so I only make the checks on the new sc items (added when pressing "add to shopping cart")

Former Member
0 Kudos

Hi,

To put checks ,you can always use the badi BBP_DOC_CHECK_BADI".And to trigger the check when the user clicks on the button "ADD TO SHOPPING CART",you can add a condition based on the value of SY_UCOMM..i.e. if SY_UCOMM "Ok_CODE for the button ADD ITEMS TO SHOPPING CART",then check the values for the newly added items.For newly added items,you can try using the foll FM's:

BBP_PROCDOC_GETDETAIL—>FM which gives the value of the details entered in SC which are already there in Database

BBP_PD_SC_GETDETAIL-->gives runtime values

BR,

Disha.

Do reward points for useful answers.

Former Member
0 Kudos

Hi Disha,

Thanks for your reply!

To my understanding the FM BBP_PD_SC_GETDETAIL will retrieve the runtime values of the shopping carts when executed in BBP_DOC_CHANGE_BADI~BBP_SC_CHANGE. This will give me the "current" items of the shopping cart and NOT the previous items, right?

And the FM BBP_PROCDOC_GETDETAIL will retrieve the latest "saved" values of the shopping cart (if the shopping cart has been saved). In this case, the shopping cart might not have been saved before and then the FM will not be able to retrieve any items.

Once again, I'm only interested in the items that existed before the button "add to shopping cart" was pressed.

One "dirty" solution is of course to EXPORT the et_item table to shared memory before BBP_DOC_CHANGE_BADI~BBP_SC_CHANGE ends. then this table can be IMPORTED from shared memory (IMPORT) before checking which items that have been added when the button "add to shopping cart" was pressed.

I'm just looking for the most clean solution here as you can understand.

Thanks again for your inputs!

Answers (0)