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

COMMIT WORK statement in enhancement(User exit, BADI, enhancement spot, enhancement section, BTE)

Dear Experts,

We are having data inconsistencies when posting through MIGO transaction. Based on Note 92550 & 1284654, the use of COMMIT WORK statement in the implementation of BADI: MB_DOCUMENT_BADI is one of several elements in the enhancement that causing it. We replaced the implementation of BADI: MB_DOCUMENT_BADI with other enhancement implementations:

-. Enhancement Section: FCODE_BEARBEITEN_01 in include MM07MFF0_FCODE_BEARBEITEN

-. Enhancement Point: GOODS_MOVEMENT_FILL_05 in include LMIGOKG1

What we want to know is:

1. Is it safe or at least how can we know if it is safe to use COMMIT WORK statement on those enhancement implementations?

2. Does the use of COMMIT WORK statement restriction applies to all enhancement like user exit, BADI, enhancement section, enhancement point or it's just applies to certain or specific enhancement?

3. How can we use some function that needs COMMIT WORK statement, for example BAPI: BAPI_GOODSMVT_CREATE(Note 457499) on enhancement that must not contain COMMIT WORK statement?

Thank You,

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Dec 04, 2013 at 02:29 PM

    Hi Rolando,

    Taking your questions one at a time:-

    1. Is it safe to use COMMIT WORK statement on enhancement implementation.

    COMMIT WORK is used for completing any of the change process( like insert, delete, append, update ) for a particular data base table. And Enhancements are mainly used to modify the flow to the current SAP Program. Thus use it only when you are pretty sure that changes in the Database have to be done.

    2. Commit work restriction applies to all enhancements, exits and other mentioned objects.

    COMMIT WORK is used to make the changes that is being carried out in the dictionary permanent, So Unless any of the objects are there to carry out table entry changes, there is no requirement to use COMMIT WORK.

    Else if there is a need of changes, commit work should be used.

    3. Use of Commit Work after using BAPI creating or changing inside an enhancement.

    Use of COMMIT WORK is not advisable after using a BAPI for creation(or changes carried ) of a particular object, instead we should use 'BAPI_TRANSACTION_COMMIT' as the later clears out normal buffers as well as BAPI Buffers, to carry out the changes, compaired to COMMIT WORK which leaves BAPI buffers with data, thus preventing the data inconsistencies that may be caused, by lack of primary memory space and other reasons to carry out the process.

    and for using it Just call the FM BAPI_TRANSACTION_COMMIT, after you have made a call to the BAPI (BAPI_GOODSMVT_CREATE) Function Module.

    Hope this helps you.

    Regards,

    Saumitra

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 04, 2013 at 03:42 PM

    Rolando,

    1. COMMIT WORK is a statement that is used to make sure the operation ( like a BAPI call in your case) is done without fail. Yes, you can use..again it depends if it is really necessary at that place.

    2. Again, since we are doing this change at the database level, it would affect (based on your operation) in all the exits wherever used.

    3. Use 'BAPI_TRANSACTION_COMMIT'. Some BAPI`s will have an internal commit. However in your case, you might need to call this explicitly.

    Regards,
    Guru

    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.