Skip to Content
author's profile photo
Former Member

problem with bapi_transaction_commit

hi,

hi,

my data declarations and code is as follows:

types:ty_bapi_return LIKE bapiret2.

data: t_return TYPE STANDARD TABLE OF ty_bapi_return,

wa_return TYPE ty_bapi_return,

wa_return TYPE ty_bapi_return.

CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'

EXPORTING

documentheader = wa_bapi_hdr

TABLES

accountgl = t_accountgl

currencyamount = t_currencyamount

return = t_return.

READ TABLE t_return INTO wa_return WITH KEY type = 'E'.

IF sy-subrc = 0.

MOVE: wa_return-type TO wa_msg_table-type,

wa_return-message TO wa_msg_table-message,

wa_return-message_v2 TO wa_msg_table-message_v2,

wa_bkpf-belnr TO wa_msg_table-belnr,

wa_bkpf-gjahr TO wa_msg_table-gjahr,

wa_bkpf-bukrs TO wa_msg_table-bukrs.

APPEND wa_msg_table TO t_msg_table.

CLEAR wa_msg_table.

CONTINUE.

ELSE.

  • call bapi_transaction_commit

CLEAR wa_commit_return1.

REFRESH t_commit_return1.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

wait = 'X'

IMPORTING

return = wa_commit_return1.

the table t_return has 2 rows with type 'S'.so the read statement fails,i.e. if sy-subrc ne o, it calls the bapi bapi_transaction_commit as shown above.now this commit bapi has to return some value into wa_commit_return.when i debug and see the value ,i cant find any value(wa_commit_reurn is null).can anyone tell me what the problem is..thank you.

Regards,

Challa.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Best Answer
    author's profile photo
    Former Member
    Posted on Sep 28, 2007 at 07:40 PM
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
    wait = 'X'
    IMPORTING
    return = wa_commit_return1.
    

    If <b>wa_commit_return1</b> return no value, it's because the BAPI was well performed...There are no errors....You're only going to get a value if the BAPI fails...

    Greetings,

    Blag.

    Add comment
    10|10000 characters needed characters exceeded