cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

RAP - Create POST Service with standard BO call

nicmon
Explorer
0 Likes
1,852

Hi Experts!

I have a requirement I have been working with for the last couple of weeks but I'm stuck and don't know how to achieve what I need.

I need to be able to expose a service to call as POST with a deep body (header, items, partners, etc) and in the service I need to call I_SalesOrderTP using MODIFY ENTITIES to create a sales order with the payload recieved.

Can't use I_SalesOrderTP API directly since I need the option to do some pre and post processing with a lot of custom code related to the business.

I've tried creating behavior implementations from CDS and custom entities, tried unamanged and managed with unmanaged save, tried using static actions with deep parameters and deep result but was not able to make it work.

Is there a way I can create a service NOT from a CDS/BEHAVIOR? Do I need to go with HTTP service?

Any help will be highly appreciated!

Thanks and regards,

Accepted Solutions (0)

Answers (1)

Answers (1)

junwu
SAP Champion
SAP Champion

I think you can extend standard bo with static action to achieve it.

let's us know if you have detailed error.

nicmon
Explorer
0 Likes
Hi Junwu, thanks for the help! I don’t have an specific error, but the main issues I’m facing are: 1) When using a static action, I can call the I_SalesOrderTP BO and get everything in MAPPED table except for the sales order number. To get it I need to use the sentence CONVERT KEY but is not allowed to do it inside an action and I get a dump. 2) If I try to go with unmanaged save with a determine method on save, I can call the BO inside the method and then call the CONVERT KEY sentence in SAVE_MODIFIED method. At that point I get the sales order number but I have no way to return it to the service since in SAVE_MODIFIED I don’t have the MAPPED parameter. Thanks!
nicmon
Explorer
0 Likes
I've also tried using late numbering and adding the logic inmethod "ADJUST_NUMBERS" (since it has the MAPPED parameter) but inside I can't use the CONVERT_KEY sentence.
rammel_sapdev
Participant
0 Likes
Hi, what did you end up doing for this? Did you end up create an HTTP service to be able to return the generated IDs?