Skip to Content
avatar image
Former Member

Update ztable in BADI implementation

Hello Experts,

I am trying to implement ORDER_SAVE badi. And, I have to update one ztable in that implementation.

My question is, do we need to use commit statement after the update statement to reflect the changes in ztable?

Can someone please explain if you have worked on ztable updating in BADI implementations?

Thank you!

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    Jan 06, 2015 at 05:30 AM

    Hi Maren,

    Create an update function module. This can be set in the attributes tab of the FM.

    Now, call your commit in the update function module. This will get updated at the time of BADI commit. Don't forget to call your FM as CALL FM IN UPDATE TASK. Please let me know if you need any other details on this.

    Thanks,

    Faisal


    Update FM.JPG (17.2 kB)
    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 06, 2015 at 06:42 AM

    Hi Maren,

    It is not a good practice to use commit statement in Order_save badi.

    Solution is:

    1. Create a FM 'ZUPDATE_CUSTOM_TABLE' call this in to your custom implementation of Order_save badi.
    2. Create Subroutine 'CALL_ON_COMMIT' in above FM.
    3. Update your custom table in subroutine (Do not use Commit statement)
    4. Call the subroutine into FM like this
      • PERFORM call_on_commit on commit.
    5. and pass the data according to  your requirement.

    FUNCTION ZUPDATE_CUSTOM_TABLE.

    *"----------------------------------------------------------------------

    *"*"Local Interface:

    *"  IMPORTING

    *"     REFERENCE(GUID) TYPE  CRMT_OBJECT_GUID

    *"----------------------------------------------------------------------

       PERFORM call_on_commit on commit.

    ENDFUNCTION.


    FORM call_on_commit.

       Update your custom table here.

    ENDFORM.



    Regards,

    Ankit

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 06, 2015 at 06:04 AM

    Hi Maren,

    In your badi implementation are you using any function module for updating ztable if you are using any function module then you have to commit using bapi_transactin_commit fm.

    if your using keyword update or modify for updating fields in your ztable then no need for commit as per my knowledge.

    Thanks & Regards,

    Srinivas.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 06, 2015 at 02:45 PM

    Hello Faisal & Ankit,

    Thanks a bunch!!  I got what I need... thanks to you both... 😊

    Add comment
    10|10000 characters needed characters exceeded