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

cannot rollback

Former Member
0 Likes
630

Hi,

May I know if there is a parameter to do test run in BAPI_PO_CREATE?

As I cannot see any in function module, I created a parameter checkbox in my selection screen.

But even I have statement if p_test = 'X' to execute BAPI_TRANSACTION_ROLLBACK, yet the PO is created.

May I know why?

IF p_test = 'X'.

CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.

ELSE.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

wait = 'X'

  • IMPORTING

  • RETURN =

.

Thanks

Rgds

5 REPLIES 5
Read only

Former Member
0 Likes
544

hi use BAPI_PO_CREATE1 and don't use commit it will give you PO no. but in system PO no. will not be there.

Atul

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
544

Hello,

In BAPI_PO_CREATE, at the end you have this FM: TRANSACTION_END. This FM does an explicit COMMIT WORK because of which you cannot ROLLBACK.

As suggested if you use BAPI_PO_CREATE1 you can simulate the PO creation using the param TESTRUN.

BR,

Suhas

Read only

RaymondGiuseppi
Active Contributor
0 Likes
544

Read OSS [Note 187687 - BAPI_PO_CREATE and Commit Work|https://service.sap.com/sap/support/notes/187687]

By specifically calling the TRANSACTION_BEGIN and TRANSACTION_END function modules in the calling program of BAPI_PO_CREATE you can perform the transaction control yourself. You can find a corresponding example in the attachment. (This document is currently available on SAP Service Marketplace and is located on the Attachment tab page).

Regards,

Raymond

Read only

0 Likes
544

hi,

where is the attachment tab in service marketplace? i do not see such tab at sap service marketplace.

can explain?

thanks

Read only

0 Likes
544

At the bottom of the note

"Attachments" : [BAPI_with_transaction.txt|https://service.sap.com/~sapidb/012006153200001605832004E/BAPI_with_transaction.txt]

Regards,

Raymond