Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Stopping the normal update using MB_DOCUMENT_BADI

Former Member
0 Likes
1,902

Hi Everybody,

One of our requirement is to trigger a popup screen with 'Advance License number'( India CIN implementation ) whenever GR or GI is done in SAP, this will inturn update the custom table with the advance license number provided for each item from MIGO/VL01N/VL02N transactions and also deplete the quantity in the custom table, the same should be updated when the document reversal happens from MIGO/MBST/VL09 transactions as well. To achieve this functionality we have used MB_DOCUMENT_BADI, and written the code in the method 'MB_DOCUMENT_BEFORE_UPDATE',this is working fine for all the scenarios, however when the user tries to cancel the Advance license number popup in the above said transactions, the standard tables are getting updated with the material documents, this shouldnt happen, the entire update process should stop, and there shouldnt be any update, is there any ways one can control the update process using this BADI, any help would be highly appreciated,

Rgds,

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,463

Hi sailatha,

1. trigger a popup screen with 'Advance License number'(

where have u written the code for this ?

2. ROLLBACK WORK.

use this after you DETECT the popup

has been cancelled.

(This will CANCEL all updates !)

regards,

amit m.

Hi Everybody,

One of our requirement is to trigger a popup screen with 'Advance License number'( India CIN implementation ) whenever GR or GI is done in SAP, this will inturn update the custom table with the advance license number provided for each item from MIGO/VL01N/VL02N transactions and also deplete the quantity in the custom table, the same should be updated when the document reversal happens from MIGO/MBST/VL09 transactions as well. To achieve this functionality we have used MB_DOCUMENT_BADI, and written the code in the method 'MB_DOCUMENT_BEFORE_UPDATE',this is working fine for all the scenarios, however when the user tries to cancel the Advance license number popup in the above said transactions, the standard tables are getting updated with the material documents, this shouldnt happen, the entire update process should stop, and there shouldnt be any update, is there any ways one can control the update process using this BADI, any help would be highly appreciated,

Rgds,

4 REPLIES 4
Read only

Former Member
0 Likes
1,464

Hi sailatha,

1. trigger a popup screen with 'Advance License number'(

where have u written the code for this ?

2. ROLLBACK WORK.

use this after you DETECT the popup

has been cancelled.

(This will CANCEL all updates !)

regards,

amit m.

Read only

0 Likes
1,463

Hi Amit,

Thanks for your response, I have called the function module inside the BADI, and in the function module I have used the Call scree statement to trigger the popup, the call screen statment calls the program there I had written the logic for updating the custom table,

I tried initializing the tables that are returned from BADI, that didnt help as the internal tables cant be modified, the documentation clearly says that changing the global structures returned from BADI are not possible, I will try using ROLL BACK and check,

Rgds,

Read only

0 Likes
1,463

Hi Sailatha/Amit

How shall we trigger this BADI 'MB_DOCUMENT_BADI' as am using the same method i.e. MB_DOCUMENT_UPDATE'. Someone told me that we do it by settings->Update Debugging(while Debugging) when we make a goods receipt for a delivery. however am not able to do so. Please help.

Read only

Former Member
0 Likes
1,463

Hi !

Things are a bit diffucult in your case...

If a transaction has done a "CALL .... in UPDATE TASK" the update-task will start it's work when a COMMIT WORL occurs.

An Implicit Commit Work will be enough for that and you poup window will cause an implicit Commit Work !!

So you could think about move your program logic to the bapi MB_CHECK_LINE_BADI, that is before the update-task is beeing initiated !!

Regards

Rainer

Some points would be fine if that helped a bit !