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

About commit transaction

I have a BDC which will call a add-on program, In the add-on program, which will call a bapi to create po, the following is a snapshot of source code

CALL FUNCTION '/AFS/BAPI_PO_CREATE'

EXPORTING

PO_HEADER = wa_po_header

PO_HEADER_ADD_DATA = wa_po_header_add

IMPORTING

PURCHASEORDER = WA_POGR-EBELN

RETURN = WA_RET

TABLES

PO_ITEMS = wa_po_items

PO_ITEM_SCHEDULES = wa_po_item_sch.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

WAIT = 'X'.

Once I using debug to trace what's problem, i found that once i call the BAPI_TRANSACTION_COMMIT. after that the following instruction will not execute and jump to end of BDC, it means i can't commit the transaction. Anyone can give me some idea. Thanks!

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Posted on Nov 21, 2007 at 03:04 AM

    It is essential to use the 'BAPI_TRANSACTION_COMMIT' to save the data which is there in the BAPI's LUW. If you don't use this FM then your document will not be saved in the database.

    If this FM creates a problem, then try to put the FM in the end portion of that subroutine.

    Regards,

    Naimesh Patel

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 21, 2007 at 03:07 AM

    commit work and wait.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 21, 2007 at 03:34 AM

    Well, you're trying to put two commits in one LUW. I think you have to separate the BAPI from the BDC session.

    Rob

    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.