cancel
Showing results for 
Search instead for 
Did you mean: 

Update ztable in BADI implementation

Former Member
0 Kudos

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!

Accepted Solutions (1)

Accepted Solutions (1)

faisal_pc
Active Contributor

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

Answers (3)

Answers (3)

Former Member
0 Kudos

Hello Faisal & Ankit,

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

Former Member
0 Kudos

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

former_member210661
Active Contributor
0 Kudos

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.