Mentor SAP

 

Map GetEntity (Read) — Propose Mapping

Next, choose Propose Mapping. Please note that the mapping is not complete because to retrieve a single entity, you still need to specify the key field(s). This is also checked by the Service Builder as shown in the figure.

 

 

Map GetEntity (Read) – Mapping of Key Fields

For the key field(s), one or more lines have to be created (here: SoId). From the Data Source Parameter screen, select the key field(s) from the RFC interface and map them by dragging and dropping them to the newly created lines.

 

Note the different mapping directions for the new input field(s).

 

 

Map Create

Map RFC function module BAPI_EPM_SO_CREATE. Use the Propose mapping button to get the mapping for the HEADERDATA import structure. Add a new line for export parameter SALESORDERID. Here, the mapping is performed by dragging and dropping.

 

 

Perform a Create Request by Using the SAP Gateway Client

Perform a create request by using the SAP Gateway client as follows:

  1. Perform a read request for a single SO.
  2. Use the Use as request button to create an HTTP body for the POST request.
  3. Change the HTTP method from GET to POST.
  4. Remove the key from the entity set so that the POST is performed on the correct resource.
  5. Remove all the fields other than Note, BuyerID, BuyerName, and CurrencyCode, as the RFC only accepts those as input parameters.

The result is as follows:

 

 

Map Update

Map an X on import parameter SOHEADERDATAX. This is a convention for BAPIs. You tell the BAPI which field of the SOHEADERDATA import structure is transferred. Similarly to the CREATE operation, not all fields are transferred because they are calculated by the back end.

 

 

To map RFC function module BAPI_EPM_SO_CHANGE, the SoId field has to be mapped on three input parameters:

 

Map and Perform Delete

For BAPI, BAPI_EPM_SO_DELETE, only the key field needs to be mapped. The delete request has an empty HTTP body. The response HTTP body is also empty. HTTP status code 204 indicates that the item was deleted successfully.

 

Note: When performing CUD operations, the client needs to send a CSRF token along with the HTTP request. The SAP Gateway client does this automatically so the developer does not have to request a token for testing.