Application Development and Automation 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: 
Read only

BAPI commit...

Former Member
0 Likes
602

Hello,

I am using function "BAPI_ACC_DOCUMENT_POST" to post the document.. After executing this function , i m getting the document number..

Further I m using "BAPI_TRANSACTION_COMMIT" to commit the transaction.. i am not able to get this document no either in FB03 or FB02.

i m not able to understand the exact cause why bapi document is not getting updated in database...

Pls help..

Regards,

4 REPLIES 4
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
573

BAPI_TRANSACTION_COMMIT has a return parameter, what is it returning ?

Read only

Former Member
0 Likes
573

in fb03 are you passing the correct fiscal year??

Read only

Former Member
0 Likes
573

Hi,

UIse BAPI_TRANSACTION_COMMIT in below format.


        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
        EXPORTING
          WAIT          = 'X'.

BR,

Vijay

Read only

Former Member
0 Likes
573

Hi,

The data will be saved to database once you use " BAPI_TRANSACTION_COMMIT".

call again bapi and pass the data and update .. try like this

LOOP AT .... "For example, 10 times for 10 Documents

CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'

EXPORTING ...

IMPORTING ...

TABLES ....

RETURN = BAPI_RETURN_TABLE.

read table BAPI_RETURN_TABLE with msgtype = 'E'.

if sy-subrc eq 0.

error = 'X'.

exit.

endif.

endloop.

Throw error message here.

if error is initial.

LOOP AT .... "For example, 100 times for 100 Documents

CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'

EXPORTING ...

IMPORTING ...

TABLES ....

RETURN = BAPI_RETURN_TABLE.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

WAIT = 'X'

IMPORTING

RETURN = RETURN.

endloop.

endif.