‎2008 Apr 22 3:30 PM
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.
‎2008 Apr 22 5:19 PM
Hi,
You cannot use COMMIT work inside a BADI or enhancements..
Remove that before your boss see's.
Thanks
Dan
‎2008 Apr 22 6:22 PM
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.
‎2008 Apr 22 6:49 PM
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
‎2008 Apr 23 5:57 AM
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
‎2008 Jun 06 10:48 AM
‎2016 Feb 19 6:50 AM
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.
‎2016 Apr 26 11:32 AM