Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

problem with bapi_transaction_commit

Former Member
0 Kudos
93

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.

1 ACCEPTED SOLUTION

former_member583013
Active Contributor
0 Kudos
47

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.

1 REPLY 1

former_member583013
Active Contributor
0 Kudos
48

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.