cancel
Showing results for 
Search instead for 
Did you mean: 

How to find AND debug the technical object called in the backend for an API call in S/4 HANA Cloud?

sdig89
Explorer
0 Kudos

Hello experts, 

I am working on S/4 HANA Cloud: Public edition version 2402 and I would like to know how to find the technical name of the objet (BAPI? FM?) called in the backend system, when running a released API as we can find in SAP Business Accelerator hub.

For instance, to create a Sales Order, 3 APIs are available in the hub for public cloud: 

sdig89_0-1714556512256.png

1/ We are not sure yet which one we should pick for our requirement. Any help on this?

2/ More important, I really want to be able to debug in Eclipse ABAP Development Tools, any Tryout call we do when testing one of these APIs. How can I do that? I have already access to ADT and to the backend system, was able to debug backend for some other requirements (not API calls), but would like to be able to debug API calls. 

I tried a put a breakpoint in ADT for the technical API communication user used when calling the API from Postman or from the API Hub website (tryout feature), but still, the breakpoint is not triggered. What am I missing?

3/ I would like to know exactly the technical object (BAPI name if any?) behind each API? I assume one of these "Create Sales Order (A2A) or (A2X)" APIs to create a Sales Order, calls in the backend BAPI_SALESORDER_CREATEFROMDAT2, right? 

By the way, the API calls have status 200, but still, not able to debug any of the API calls, nor able to find the technical objects called in the backend system, from the API call done in the cloud.

Thank you 

View Entire Topic
Armin_Beil
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello sdig89,

this is with regards to your question number 2/

You need to enter the name of the technical API communication user (Probably a CC* username) in the ADT debugger settings. You can open the debugger settings via right click on your project -> Properties -> ABAP Development -> Debug. Please also ensure to place the breakpoint at a code line that is actually executed. Other typical causes for 'program does not stop at breakpoint' can be found in the following blog: https://community.sap.com/t5/application-development-blog-posts/adt-abap-debugger-what-to-do-if-your...

If the debugging setup is correct and if you have the necessary authorizations in place, etc. then it should not matter where the request comes from (from a Fiori UI / Postman / etc.).

To find the correct code location for the breakpoint or to just get more technical information about the call in general you can also do the following:

- Try to open the view 'ABAP Trace Requests' in ADT -> Click Create trace request -> In the creation wizard select HTTP and URI pattern *, ensure that the entered username is the one that is used on S4 server side to process the service/API. Press Finish. If you then repeat the API call, it should be traced. Afterwards you can find the tracing results in the ADT view 'ABAP traces'. If the trace results are not visible you might have to right click on the project and adjust the userfilter. The trace results will give a very detailed view about what happened on the ABAP side, about what function modules / classes / etc. where called in which order, etc.

- If the API call happens from a browser / from a Fiori app then also the developer tools of the browser might be helpful. In Chrome and Firefox these can be opened via F12, but in other browsers that might be different. Depending on your browser there should be a tool like 'Network' or something similar, that shows all HTTP(S) requests that are sent from the browser. To my understanding for OData calls you should be able to find the OData service name as a part of the called URL. The service name can help to find the correct code location to place a breakpoint.

Unfortunately I cannot help with questions 1/ and 3/ since those are outside of my area of expertise. However I found this video which might be helpful: https://www.youtube.com/watch?v=tW0-96gGQAs

Best regards,
Armin