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

About BAPI_TRANSACTION_COMMIT

Hi,

Can anyone pls tell me when to use BAPI_TRANSACTION_COMMIT.

Is it only used for Creating of Data in R/3 Using another BAPI ?

or

Is this BAPI is Used after Updation and Deletion of Data in R/3also?

Thanks in Advance,

Venkat

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jun 11, 2008 at 01:28 PM

    BAPI_TRANSACTION_COMMIT is called to COMMIT a database operation.

    As we can not write COMMIT WORK statement inside BAPI, we need to call this BAPI.

    Suppose you are updating some database table inside one BAPI.

    According to success status of that BAPI, either you can COMMIT or ROLLBACK. To COMMIT call BAPI BAPI_TRANSACTION_COMMIT

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 11, 2008 at 01:09 PM

    Yes you can use this in R3 also.

    BAPI_TRANSACTION_COMMIT.

    use : when you are using BAPI's it need external commit. for this we use the above FM.

    when you will use..

    When there is no error from BAPI then only you need to call this BAPI.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 11, 2008 at 01:11 PM

    Look at OSS [Note 798535 - COMMIT WORK after calling a BAPI|https://service.sap.com/sap/support/notes/798535]

    Regards

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 11, 2008 at 01:12 PM

    This BAPI is used to update the database after all the transactions in a LUW are completed successfully. After execution of this BAPI all the related tables are updated in the database.

    So whatever operation you do which requires the database tables to be updated, this BAPI can be used.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 11, 2008 at 01:32 PM

    This method executes a COMMIT WORK command. It is needed for transactions that are developed outside of the R/3 System, but change data in the R/3 System using BAPI calls.

    If you call BAPIs in your program, which are meant to change R/3 System data, you must call this method to write the changes in the database.

    In this case, the database commit is executed externally.

    Executing the ABAP statement COMMIT WORK:

    Besides the database commit, this statement executes other activities - compare the key term documentation for COMMIT WORK.

    In this case, the database commit is executed internally.

    Example program

    **************************************************************
    Call BAPI
    **************************************************************
    
    CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'
               EXPORTING: documentdata = ls_doc
    
               IMPORTING: documenttype = lf_doctype
    
                        documentnumber = lf_docnumber
    
                        documentpart = lf_docpart
    
                        documentversion = lf_docversion
    
                        re stall turn = ls_return
    
               TABLES: documentdescriptions = lt_drat
    
                        object-left = lt_drad
    
                        documentfiles = lt_files.
    
    
    **************************************************************
    **Error Check
    **************************************************************
    
    IF ls_return-type CA 'EA'.
               ROLLBACK WORK.          'Errors are made declining
    
               MESSAGE ID '''26''' TYPE '''I''' NUMBER '''000'''
    
               WITH ls_return-message.
    
    ELSE.
    
               COMMIT WORK.             'Changes are confirmed
    
    
    ENDIF.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 11, 2008 at 01:36 PM

    hii

    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

    EXPORTING

    WAIT = w_WAIT

    IMPORTING

    RETURN = RETURN.

    .

    This FM will update your data.it will use for the FM like BAPI_DOCUMENT_CHANGE2 ....if its done successfully then 'BAPI_TRANSACTION_COMMIT' FM will save all the changes or else it will not save and will perform rollback.

    reward if useful

    thx

    twinkal

    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.