cancel
Showing results for 
Search instead for 
Did you mean: 

What is the use of Mapped in SAP RESTFul ABAP Programming

vkarmakar
Discoverer

I am new to SAP RESTful ABAP Programming and learning it through ABAP-On-Cloud 2020 in Docker.

I have created few custom Application using basic /dmo/ Tables like Agency, Customer, Carrier, etc

But I am facing few challenges

1) When using Unmanaged Scenario without Draft I am able to populated Mapped and Reported in case of Success in Creating or Updating an entries but when I use the same Application with Draft Functionality added to it in Create populating Mapped and Reported  do not create any issue , However in Update if I populate Mapped the program dumps.

2) Sometimes Draft in Unmanaged do not update the Draft Table properly due to some reasons and I cannot figure out how to debug it.

So it is my humble request from community if anybody can explain this to me so that most beginners can try their hands on and learn the new things from SAP

Thank You 

MioYasutake
Active Contributor
0 Kudos

@vkarmakar 

I was in a same situation (editing an unmanaged BO resulted in error) and posted a question on the community. But unfortunately, it has not been answered yet.

https://community.sap.com/t5/technology-q-a/unmanaged-rap-bo-with-draft-error-when-pressing-edit/qaq...

Accepted Solutions (1)

Accepted Solutions (1)

Sijin_Chandran
Active Contributor

Hello,

Please find the below information on REPORTED and MAPPED Parameters of the RAP's Behavior Implementation Classes.

1.) REPORTED , Reported is used to provide the Context Information (like if the response code is failure say '500' then what could be the reasons for the same) as a response after a REST API call. It helps in filling the HTTP Response HEADER parameter 'sap-message', which you could notice in case of normal SEGW based OData Services as well.

2.) MAPPED, is relevant only for CREATE operation. Suppose you are calling an API for Purchase Order creation, then after a successful call and execution of the API call you should receive back the Purchase Order number generated. So, MAPPED helps in this case, in the EntitySet for Purchase Order you can MAP the generated Purchase Order number to the PO number Property of the EntitySet and it would be sent back as a Response, the same thing which we used to do in 'ET_ENTITYSET' parameters in the DPC Implementation of SEGW based OData REST API creation.

Please refer below page for more details,

https://help.sap.com/docs/abap-cloud/abap-rap/implicit-response-parameters

Thanks,

Sijin

vkarmakar
Discoverer
0 Kudos

@Sijin_Chandran: Thanks a lot for the answer, your explanation was very simple which I appreciate. I have one question and I hope you can answer that.

I have created a basic RAP Application with Un-Managed with Draft using ABAP Cloud Developer Trial 2022.

I have used basic /dmo/connection table but when I update any record, it gives me dump stating some ACTIVATE DRAFT mapping is missing. If I remove the Draft functionality, it works fine. 

So If possible, can you let me know if there is a way to debug draft actions

Sijin_Chandran
Active Contributor
0 Kudos

Hello,

The scenarios we worked were Managed with Draft.

Since, yours is Unmanaged with Draft I guess it has got something to do with the Primary Key value determination.

Kindly check below blog post, it might help.

https://community.sap.com/t5/technology-blogs-by-sap/how-to-develop-an-unmanaged-rap-business-object...

Thanks,

Sijin

Answers (0)