cancel
Showing results for 
Search instead for 
Did you mean: 

Web Service and BAPI_TRANSACTION_COMMIT

Former Member
0 Kudos

Hello,

Iu2018ve released the BAPIs GOODS_MOVEMENT_CREATE and BAPI_TRANSACTION_COMMIT as two operations in one group as Web Service. I need BAPI_TRANSACTION_COMMIT to make the changes persistent.

Now, when Iu2019m calling the GOOD_MOVEMENT BAPI first and then BAPI_TRANSACTION_COMMIT separately, nothing will happen. I think this is because I have only a stateless web service. In my creation wizard for the Web Service I found no option to create a stateful service.

I found this thread , but I cannot follow his solution at the end.

Is there another way how I can commit my transaction?

Thank you for your help!

HP

Accepted Solutions (0)

Answers (3)

Answers (3)

SB9
Active Participant
0 Kudos

Hi HP,

In order to solve this problem you need to write a class with two methods in it. One method should be for calling the BAPI GOODS_MOVEMENT_CREATE and the other BAPI for commit i.e., BAPI_TRANSACTION_COMMIT. The trick is to use the same RFC connection object(JCO) for both the method calls. This can be done by making the connection object as public static.

Then you can expose a stateless webservice with these two operations in it.

Hope this helps.

Thanks,

Soujanya

Former Member
0 Kudos

I think it would be better to make a proxy and call the BAPI inside it.

Instead of using BAPI_TRANSACTION_COMMIT, following statement should be used.

CALL METHOD cl_soap_commit_rollback=>commit

Former Member
0 Kudos

You could create an RFC, call the BAPI and BAPI_TRANSACTION_COMMIT in this function module and expose this RFC as a Web Service