Application Development 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: 

COR6N BADI Enhancement(MB_DOCUMENT_BADI~MB_DOCUMENT_BEFORE_UPDATE) works EXCEPT for the first time

0 Kudos

Transaction : COR6N

BADI method Implemented:

MB_DOCUMENT_BADI~MB_DOCUMENT_BEFORE_UPDATE

I am using this implementation to update some custom fields in table AUFK.

I give input values in below screen:

The requirement I working fine except for the FIRST time (immediately after creating PO using COR1).

Code inside BADI method: I am using UPDATE keyword inside below Update FM.

Could anyone please throw some light on this and suggest an approach?

1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor

You could change your 'Update module' from 'Start Immed.' to type 'Start Delayed' so it will be executed after standard updates.

(I hope you only update some ZZ fields of standard trable AUFK in the module, also are you creating change documents in the module or are you confident that none of the fields data elements has or will have the change flag set?)

4 REPLIES 4

NTeunckens
Active Contributor
0 Kudos

I feel there is some confusing information here :

Your Question-Title suggests that your code RUNS ONLY the FIRST time, then in your content is written : "... is working EXCEPT for the FIRST time". So what is it exactly???


Greetings

Nic T.

0 Kudos

Thank you for pointing out the mistake Nic! My bad.

I have corrected the Title now.

The Implementation works all the time EXCEPT for the first execution.

Any suggestions please?

raymond_giuseppi
Active Contributor

You could change your 'Update module' from 'Start Immed.' to type 'Start Delayed' so it will be executed after standard updates.

(I hope you only update some ZZ fields of standard trable AUFK in the module, also are you creating change documents in the module or are you confident that none of the fields data elements has or will have the change flag set?)

0 Kudos

Thank you Raymond! Selecting 'Start delayed' resolves the issue. 🙂

I understand this option can be used when execution has to happen after all other standard updates.

For your comments:

I hope you only update some ZZ fields of standard trable AUFK in the module

Yes I am only updating custom fields(part of include structure CI_AUFK):

also are you creating change documents in the module or are you confident that none of the fields data elements has or will have the change flag set?

I have not selected that flag. All data elements are custom and change log is not needed for these fields.

I hope I am following all the desired coding standards.

Kindly let me know if I am missing something important here!

Regards,

Barkha Agrawal