cancel
Showing results for 
Search instead for 
Did you mean: 

"Debug" WSs created from BAPIs

Former Member
0 Kudos

Hello,

I just created some web services from BAPIs, specifically, BAPI_BANKDETAIL_CREATE, BAPI_EMPLOYEET_ENQUEUE, BAPI_EMPLOYEET_DEQUEUE and BAPI_BANKDETAIL_GETLIST.

I created a SoapUI project from the WSDLs, tested the WSs with this tool and they seemed to work as expected. After a day I tried to retest the WSs and it seems that BAPI_BANKDETAIL_CREATE is not working correctly, but the XML answer is not clear for me.

The other three WSs are working correctly, so I supose it's not a framework problem.

I tested the "source" BAPI with the same data sets used to test the WS and they work correctly, so I'm very confused. I would like to know how to debug the whole process of calling a BAPI through a WS, where the traces of the WSs and BAPIs are, ....

Can you tell me how to proceed?

Yours,

jmiturbe

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello again,

I have more info on the issue, but I can't understand the things I'm thinking/guessing! Caused by my lack of knowledge on SAP and WSs, maybe my conclusions are not OK, so please let me know if I'm wrong.

First of all just tell you that the thing seemed to work properly the first day probably because we had locked the employee object with the same sap user on another mode using transaction PA30, so it seems that it never worked like I was expecting.

When we noticed our "testing" error, just tried to lock the employee using a WS created from the BAPI_EMPLOYEET_ENQUEUE, and the WS call worked OK. Anyway we saw that the lock on the object employee is released after finishing the WS "execution". The same thing happens when running the BAPI directly and exiting the corresponding transaction (SE37, BAPI, etc...). Of course, on this circunstances, if you run BAPI_BANKDETAIL_CREATE, it doesn't work.

Is this correct? Is it working as expected? Comparing with the operation when using PA30 and exiting without modifying anything, it seems that is working the same way, that is, when the process that locked the object finishes, the lock is released.

If so, how it's supossed to expose these kind of BAPIs as WS? Developing a custom wrapper BAPI that calls these 3 BAPIs on order and then publishing this custom BAPI as a WS?

After reading a bit on WS and SAP I found that these BAPIs can be called without building ZWebServices. On other words, that these BAPIs are already published as WSs, with their WSDLs, ... But when I tried to use these out of the box WSs, I found the same problem I had with custom WSs, that is, that the WS for the BAPI_EMPLOYEET_ENQUEUE doesn't lock the employee permanently (at least, until you call BAPI_EMPLOYEET_DEQUEUE), so when executing the out-of-the-box WS for BAPI_BANKDETAIL_CREATE it doesn't work.

Are we doing something wrong? Are my conclusions correct?

What happens with the relationship between WS authentication (for example if using basic authentication) and objects locking mechanism? If we use a few users for the WS authentication, how can we avoid a second web service call (or a call to a different web service) modifying the object before the WS that locked the object modifies it? Should we use a different user for each WS? What about different calls to the same WS with the same user?

SAP is pushing in favour of SOA, ESA, ... everywhere, so I supossed that the "framework" and the available WSs would be ready for this WS world, but I can't get working the simplest scenario I can imagine!

Please help me understanding this SAP/SOA/ESA world! Thanks in advance,

jmiturbe

Former Member
0 Kudos

Hi,

You are asking very good questions. Would you care to be a little more specific on the part where you say that you found that BAPI_EMPLOYEET_ENQUEUE is already exposed as a WS? I tried to find it but I was not able to...

This is a BAPI so out of a box you can call it from outside of SAP, but it is not equivalent with the fact that it is an Enterprise Service. SAP provides tools to generate a proxy class, for instance in Java, to call BAPIs - but that again is not equivalent with the BAPI being an Enterprise service.

Former Member
0 Kudos

he didn't say that BAPIs are Enterprise Services, he said that BAPIs are (automatically) exposed as webservices, which is a fact.

the fact that BAPIs are autmatically exposed as webservices just the way they are makes a bit unusual artefacts in the webservice world, e.g. the fact that each BAPI needs it's extra commit BAPI. so, everyone I know and who uses those auto-webservice-ified BAPIs at all, writes a wrapper to call them at once.

anton

Former Member
0 Kudos

I've read the passage again any you are correct. He only said the BAPIs are WS - not enterprise services.

And I understand the confusion - what good can calling this WS do to you? The lock expires as soon as the RFC session on the AS ends...and commit is a good point, as well.

Regards,

Andrzej

Former Member
0 Kudos

Hello,

Thanks for your answers and for your interest.

Andrzej, you ask me about the benefits of using these WS, and I don't know the answer. So my following qustion is: How should we approach the need of modifying some HR data from the outside of SAP ERP?

You also tell me about enterprise services, and so does SAP on every presentation or meeting, but after searching for available HR enterprise services, I found that they only cover a very small part of the bussiness. Maybe my human search engine doesn't work properly, but I only found a few services, at least comparing with the size os the HCM data model:

http://esoadocu.sap.com/socoview(bD1lcyZjPTgwMCZkPW1pbg==)/render.asp?id=09BA70EAEA84466888BC52204D7...

So how it's supossed to meet these days' information systems' interoperability needs? How should external data modifications be managed? Using IDOC/ALE scenarios? For the last three or four years I haven't heard SAP product managers talking too much about IDOCs' asynchronous distribution, but maybe this happens because they are not as fashion as WS, ES, SOA, ESA, ....

So the matter is that I don't know how we should approach the need of changing SAP HCM data from the outside, because I don't know how many real choices are available for this purpose.

Please help me understanding how it should be done in the real world.

Thanks a lot. Yours,

jmiturbe

Former Member
0 Kudos

Hi,

Well, my question about the benefits of using this particular web service around BAPI_EMPLOYEE_ENQUEUE

was really a rhetorical one. Sorry.

If you developed, lets say, Java front-end, and called the three BAPIs using JCo one after another, retaining the SAP session, and then called BAPI_TRANSACTION_COMMIT, then I believe it would work just fine.

In real world tasks I always first search for things that work , and then select the one that works best in my particular situation. If for any reason calling web services is best for you, then you need to build a wrapper function module, that calls the four BAPIs and web service enable it.

In my view the fact that we now have web services and also enterprise services in no way invalidates older technologies. It just gives one more option, and sometimes it will be the best one...

Enterprise services are marketed as the way to rapidly develop innovative, user centric and collaborative processes. Given, the underlying functionality has to be implemented first in the BPP and the enterprise service needs to be available.

SAP in its definition of Enterprise service puts the stress that it needs to be a meaningful chunk of business logic, and to date only so many enterprise services were shipped (over 1000). And I doubt there ever will be an Enterprise service available for every piece of functionality available in the underlying applications...

I hope this helps a bit.

Regards,

Andrzej

Former Member
0 Kudos

Hello again,

Thanks for your answers. I'm still trying to understand this world, but looking at your answers it seems that I'll have to build a wrapper.

Anyway, can somebody explain me what the following statement means? (I'm new in this world so my question could be a bit silly )

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.

I found it at

Thanks in advance,

jmiturbe