cancel
Showing results for 
Search instead for 
Did you mean: 

BBP_DOC_CHANGE_BADI during SHC approval

Former Member
0 Kudos

I have an implementation for BADI BBP_DOC_CHANGE_BADI which changes the delivery date of the Shopping Cart (sets it to system date + lead time if the delivery date is in the past). During approval, when the details of the SHC are displayed (item overview), the dates are adjusted and my BADI works fine.

However, when i try to approve from the approval list (list of items due for approval), my badi is not called.

Should I be using a different BADI to change the delivery dates for approval? I've tried to work with BBP_DOC_SAVE_BADI, but I am having difficulty with the code.

Help would be much appreciated (and rewarded)

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

I would like to re-raise this thread, as it does not appear to be answered.

Similar to the original post, I would like to manipulate the shopping cart data with BBP_DOC_CHANGE_BADI after approving the shopping cart from the approval overview screen. Once you click on the "approve" button from the approval overview button, the shopping cart first executes the BBP_DOC_CHECK_BADI, which becomes obvious if there are any errors in the shopping cart because a message appears in the approval overview window.

BUT, if there are no errors, the shopping cart continues to post the approved shopping cart in a background process (BBP_BACKGROUND_APPROVAL). Because it executes in a background process, a normal breakpoint won't stop in these BADIs.

In order to test if the BBP_DOC_CHANGE_BADI is executed during background approval, I put code in this BADI to write system parameters into a custom table. This code DOES work, because I have verified in the online shopping cart transaction that it is executed. What I have discovered is that BBP_DOC_CHANGE_BADI is NOT executed when approval is executed from the overview window.

I would like to confirm if others have this experience, or can site experience otherwise.

We are running SRM server 5.5 SAPKIBKT11.

Best regards,

Nicholas Simon

Former Member
0 Kudos

Hi

You are quite extent right... Look for BBP_DOC_SAVE_BADI which is finally called once shopping cart is saved/ordered..

Regards

- Atul

Former Member
0 Kudos

I'm looking into running a FM that changes the delivery date of the shopping carts (to be attached to the WF approval task).

Anybody know of a standard function module I can use (to change dlv dates)?

Former Member
0 Kudos

Hi DGE,

I checked BBP_DOC_CHANGE_BADI for filter BUS2121 and implementation method BBP_SC_CHANGE.

This method is always call for create a SC and approve SC (after clicking in 'Approve' button).

Regards,

Marcin Gajewski

Former Member
0 Kudos

Hi Marcin,

Thank you for your post. If the method is always called (even during approval), there must be something wrong with my code below:

loop at it_item into ls_item_import.

zlineitemno = sy-tabix.

move-corresponding ls_item_import to ls_item.

zdelivdate = sy-datum + ls_item-leadtime.

if ls_item-deliv_date < zdelivdate.

ls_item-deliv_date = zdelivdate.

endif.

modify lt_item index zlineitemno from ls_item.

endloop.

I've put a breakpoint in the 1st line of my code and when I do approval from the overview screen (where the list of items for approval are), it doesn't stop at the breakpoint. However, when I approve from the detail screen (where the SHC details appear), it stops at my breakpoint.

Does your BADI work from the overview approval screen also?

Regards,

Dominique

Former Member
0 Kudos

Hi,

BADI only runs after clicking 'Approve' button on overview and detail screen.

Maybe in Your code is error, because:

- deliv_date field have component type = EIND (DATS5)

value of deliv_date will be eg. '02112006'

- leadtime field have component type = BBP_LEADTIME (CHAR5)

value of leadtime will be eg. '14'

- sy-datum field have component SYDATUM (DATS8)

value of sy-datum will be eg. '20061102' (reverse)

Regards,

Marcin Gajewski