cancel
Showing results for 
Search instead for 
Did you mean: 

Create WS from BAPI with Commit

Former Member
0 Kudos

Hi,

We tried to create a WebService that uses a BAPI to post an Account and after a successfull post do the commit to store the data permanently in the system.

The service itself is no problem, but we found no option to set the transaction values for commit or anything else.

In the TX SOAMANAGER these values are displayed for a service, but there were no possibilities to change them. The BAPI itself does not contain the commit...

Any ideas where to find this config? Is there a solution without using PI and creating a proxy for the BAPI?

Thanks in advance,

Felix

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

Hi there,

we figured out the problem...

After we did the configuration for a stateful service with commit handling by using the TX se80, first of all we needed to recreate the service to update the WSDL file. Then we tested the service using the SAP WS Navigator. It returned a successful message but did not commit it. So we tried to test it with [soapui|http://soapui.org]. There it worked properly. We also reassured ourselves by creating a service without the commit handling. Calling this service ended without commit as designed, so our problem is solved...

Thanks for all replies!

Best regards,

Felix Reichmann

Answers (2)

Answers (2)

Former Member

Hi,

thanks for reply.

That is a solution, we were also thinking about. But for the number of services that we will have to create in the project, this is not the proper way to do it, I think...

As I said, we are now able to do the configuration, but it does not change the behaviour of the service. Does anyone know of any further config needed?

Felix

Former Member
0 Kudos

hi,

as far as I know there is no way around the solution suggested by pierre. it is simply a paradigm of BAPIs to have an extra Commit-BAPI. this is the very opposite paradigm compared to loose coupling in webservices.

if creating wrapper BAPIs as described is too much of an effort there remains only one possibility, which is a customer modification to the BAPIs in question by including the commit into to original function module. which is not so big of a deal, since a big number of standard BAPIs are kind of frozen, i.e. they do not change anymore due to their maturity.

anton

Former Member
0 Kudos

Hello,

Looking at

I saw:

Can you realize "transactional" behavior with Web services, that is, combine several RFC calls?

Yes. To include several RFCs (and BAPI_TRANSACTION_COMMIT) in one Web service, use the WS Creation Wizard and select Function Group as the WS endpoint. When creating the service definition and choose (or add if not already included) the RFCs you want to use. Also, manually add BAPI_TRANSACTION_COMMIT and BAPI_TRANSACTION_ROLLBACK. Finish creating the Web service. Finally, set the Web service communication to Stateful in the Web service definition.

Would it work? Can anybody explain me how to achieve this, if possible? I can't believe it's so easy because I posted a similar question and I got the wrapper answer from people that seemed to know their business.

Thanks in advance,

jmiturbe

Former Member
0 Kudos

So, we now found out that we can change these values by using the TX se80, selecting our Service and in the tab configuration you can change the attributes for transaction handling and commit handling...

But all the inputs, we tried, are not populated in the ERP. The data is still missing, so we think that the commit does not work here. Maybe our inputs are not correct. Can anybody help us?

Former Member
0 Kudos

Hi,

You could create a function module, call the BAPI and BAPI_TRANSACTION_COMMIT in this function module and expose this function module as a Web Service (se37 > Utilities > More Utilities > Create Web Service).