Skip to Content
0

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

May 17, 2017 at 08:57 AM

237

avatar image
Former Member

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?

3.png (22.8 kB)
4.png (10.8 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Raymond Giuseppi
May 18, 2017 at 08:59 AM
2

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?)

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

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

waiub.png (9.3 kB)
xmlzf.png (37.2 kB)
0
Nic Teunckens May 17, 2017 at 07:50 PM
0

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.

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

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?

0