BAPI_TRANSACTION_COMMIT

 
  BAPI_TRANSACTION_COMMIT is used forchanging data in R/3 system after you calling the transactionoutside the R/3 system.
        We have two option to carry out adatabase commit:
  1. Call BAPI_TRANSACTION_COMMIT
  2. Excusing the ABAP statement: COMMIT WORK.

    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

                    restall turn = ls_return

           TABLES:documentdescriptions = lt_drat

                    object-left= lt_drad

                    documentfiles= lt_files.


**************************************************************
**Error Check
**************************************************************

IF ls_return-type CA 'EA'.
           ROLLBACKWORK.          'Errorsare made declining

           MESSAGEID '''26''' TYPE '''I''' NUMBER '''000'''

           WITHls_return-message.

ELSE.

           COMMITWORK.            'Changes are confirmed


ENDIF.


你可能感兴趣的:(function,System)