Skip to Content
author's profile photo Former Member
Former Member

Commit work inside a BADI

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Apr 22, 2008 at 04:19 PM

    Hi,

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

    Remove that before your boss see's.

    Thanks

    Dan

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 22, 2008 at 05: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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 22, 2008 at 05: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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 23, 2008 at 04: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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 19, 2016 at 06: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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.