Skip to Content

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

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)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    May 18, 2017 at 08:59 AM

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

    Add comment
    10|10000 characters needed characters exceeded

    • 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)
  • May 17, 2017 at 07:50 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded

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