cancel
Showing results for 
Search instead for 
Did you mean: 

Public Cloud - Consume local service/API in ABAP code

nicmon
Explorer
0 Kudos
140

Hi Experts,

We have a situation where we need to create a Sales Order using ABAP code in a Public Cloud system. We are not able to use the standard BO because the payment plan entities (which we need) are not available in I_SALESORDERTP, so the only solution we found is to use the api API_SALES_ORDER_SRV.

We tried building a solution following this tutorial:

https://developers.sap.com/tutorials/abap-environment-business-partner-outbound-call.html

But we weren’t able to make it work since I believe the tutorial is missing the communication arrangement part, which is needed to handle the connection.

We then followed the 2nd part of the tutorial:

https://developers.sap.com/tutorials/abap-environment-business-partner-basic-auth.html

Which is working and creating the sales order as expected, but the problem is that is creating it with the communication user as the owner (CreatedBy field).

Is there a way to consume the API o the odata service associated in a local mode using the same user that is logged into the system? In our process the creator of the order is very important and we can’t have the communication user as creator of every sales order in the system.

Thanks and regards!

 

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

Thank you for your request, @nicmon ,

have you considered using a so-called partner function in the Header Partner segment of the API? It does allow for Personnel (8 characters) or Contact Person ID (10 char). While you may not be able to change the 'createdBy' field for sales orders created via API, this way, you might be able to select a different field to determine the actual 'owner' of each sales order.    

AndreasMuno_0-1736890189982.png

If this helped you solve your request, please mark this response accordingly. Thank you.

 

WRoeckelein
Active Participant
0 Kudos
Well there is /iwbep/if_cp_client_proxy and cl_web_odata_client_factory with create_v4_local_proxy and create_v2_local_proxy. Usability is however not so good but your desired goal should be achievable.
nicmon
Explorer
0 Kudos
Hi Andreas! We thought about that, but the problem is that we may have some issues in future finantial audit. Regarding CL_WEB_ODATA_CLIENT_FACTORY, the problem is that the only services allowed to be used there are custom ones, SAP standard services cannot be used. Regards!