Application Development and Automation 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: 
Read only

Commit work inside a BADI

Former Member
0 Likes
4,919

Hi

I am writing code in Badi-WORKORDER_UPDATE, implementation name:ZPU_WORKORDER_UPDATE, method:AT_SAVE.

inside this i am calling a function module CLOI_MASTERIDOC_CREATE_LOIPRO.

this FM uses commit work. whenever a production order is released this BADI should be triggered and an idoc should be sent to external system.

all are fine till commit work statement. once commit work is executed, it is going to dump and saying that u cannot use a function which uses Commit work inside a BADI or user exit.

can anybody help me to solve this issue..

thanks

vennila.

7 REPLIES 7
Read only

Former Member
0 Likes
2,514

Hi,

You cannot use COMMIT work inside a BADI or enhancements..

Remove that before your boss see's.

Thanks

Dan

Read only

Former Member
0 Likes
2,514

You need to find an alternative of CLOI_MASTERIDOC_CREATE_LOIPRO.

Commit work should not be used in any enhancement because SAP transaction is still incomplete at this point.

Commit Work will cause the database commit that will leave the SAP transaction inconsistent.

G@urav.

Read only

Former Member
0 Likes
2,514

It's a wild guess. But, try out this : Call the functioon module in BACKGROUND TASK.

CALL FUNCTION CLOI_MASTERIDOC_CREATE_LOIPRO IN BACKGROUND TASK .......

- Sameej

Read only

Former Member
0 Likes
2,514

Hi,

Welcome To SDN!!.

commit statement in userexit/BADI:

You should not do that.

After the user exits/BADI code is triggered, the transaction's own commits statements will commit the database anyway

Regards

Kiran Sure

Read only

0 Likes
2,514

Hi!

Do you solve this problem?

Read only

Former Member
0 Likes
2,514

Hi..!!

1) First go to User exit EXIT_SAPLCOBT_001

2) Inside the above user exit

              SUBMIT rcclord WITH opt_sys  EQ opt_sys

                  WITH mestyp   EQ mestyp

                  WITH s_aufnr  IN aufnr_rg

                  WITH p_autyp  EQ autyp

                  WITH s_matnr  IN matnr_rg

                  AND RETURN.

3) This report rcclord calls CLOI_MASTERIDOC_CREATE_LOIPRO which has user exit EXIT_SAPLLOI1_002.

4) Inside the user exit EXIT_SAPLLOI1_002 you can write logic to append your custom segment.

Read only

0 Likes
2,514

This message was moderated.