Show TOC

Mapping the Read OperationLocate this document in the navigation structure

Process

In this step, you will map the READ operation using the GetDetail BOR method in the User object from the data source.

The READ operation obtains the details of a particular business object.

  1. In the list of USER methods in the data source view, select GetDetail.

  2. Click Create Mapping.

  3. In Operation Type, select Read.

    Note

    The GetDetail BOR method contains a large number of structure and table parameters.

    SAP Gateway is capable of simplifying such complex SAP interfaces, so that external clients can easily consume SAP business data.

    Since there are many nodes that will not be used, it will be easier to deselect everything and then select only the ones you want to use.

  4. Click the root node, GetDetail, to remove the selection.

    A warning message is displayed, click Yes to continue.

  5. Select only the following:

    • CACHE_RESULTS

    • USERNAME

    • Activitygroups

    • Profiles.

    Selection for mapping

  6. Expand the Address node and select the attribute TITLE_P and then click Change Mapping Route.

  7. Change the name of the attribute, TITLE_P to TITLE in Property Name, and map it directly under the root node.

    To flatten the attribute, select the root node, and then click the check mark to map it directly under the root node.

    Flattening a data source attribute

  8. Click the check mark to continue.

  9. Select FIRSTNAME, LASTNAME, and FULLNAME.

    Under the Mapping Route column, there is no hierarchy information preceding the changed name, because these fields are matched and mapped automatically to existing Properties that are directly under the root node. These exist because they are already mapped in the QUERY operation.

  10. Flatten the following attributes in the node, ADDRESS, by changing the mapping routes so that they fall under the root node and not within the ADDRESS node.

    Also, rename them to the mapping route value if they have different names, (see steps 7 to 9 above).

    • LANGU_P: change to LANGUAGE.

    • DEPARMENT: no change, leave it as is DEPARMENT.

    • BUILDING_P: change to BUILDING.

    • FLOOR_P: change to FLOOR.

    • ROOM_NO_P: change to ROOM.

    • COMM_TYPE: no change, leave it as is COMM_TYPE.

    • TEL1_NUMBR: change to TELEPHONE.

    • FAX_NUMBER: no change, leave it as is FAX_NUMBER.

    • E_MAIL: no change, leave it as is E_MAIL.

    The final result for the Address node should look as shown in the image below:

    Flattened attributes directly under the root node

  11. Expand the ACTIVITYGROUPS and PROFILES nodes, rename and set their properties as shown below.

    Notice that they are renamed but are kept under their respective nodes.

  12. Click the check mark to close the Map Operation window.

  13. Within the Data Model section on the lower right, scroll to the bottom to find the ACTIVITYGROUPS and PROFILES object nodes with cardinality 0..n.

    Set a key for Properties with cardinality 0..n.

  14. Expand ACTIVITYGROUPS, right-click on ROLE and choose Set Key.

    Set key for Property with cardinality 0..n

  15. Do the same for PROFILES by setting PROFILE as the key.

  16. Generate and save your Data Model.

    Generated and save model with Query and Read operations

Result

You have successfully mapped attributes for the Read operation from your data source to Properties in the Data Model.

Continue with Add the Data Model to a Consumption Model.