Developer

Testing the GET_ENTITY Implementations and Navigation Functionality

Test the SalesOrder and BusinessPartner GET_ENTITY methods.

Procedure

  1. From the Class Interface screen, navigate to the Gateway Client via Service Maintenance by double-clicking the Service Maintenance folder on the left and selecting the Maintain button on the right.

    Alternatively, you can open a separate Gateway Client window by entering /o/IWFND/GW_CLIENT transaction code. For this example, replace the default Request URI with the base service URI of the service (/sap/opu/odata/sap/Z_EPM_RKT_SRV/).

  2. Append SalesOrders to the end of the Request URI and click Execute.
  3. In the result, go to an <entry> element and look for an href link that specifies a specific SalesOrder, for example, SalesOrders('500000000').


  4. Append the href value SalesOrders('500000000') to the end of the URL and click Execute:


    This returns one entry that shows the detailed properties of the specified sales order.
  5. Append Items to the current URI and click Execute.


    This returns all sales order items for the specified sales order.
  6. (Optional) Overwrite "/Items" with "?$expand=Items" and click Execute.

    The $expand OData system query option includes the sales order header information, making it possible to read a full sales order using a single call. This is possible due to the associations and navigation properties defined in the data model. The one-to-many association between sales orders and sales order items, along with the navigation property, Items (which provides navigation between SalesOrders and SalesOrderItems), is the basis for reading or creating sales order header entries “deeply” with inline sales order item entries. The central runtime interface, /IWBEP/IF_MGW_APPL_SRV_RUNTIME, also provides the GET_EXPANDED_ENTITY and GET_EXPANDED_ENTITYSET methods for reading or querying entity data in a deep/inline format, expanding related results where possible.

    The SAP NetWeaver Gateway framework provides a default implementation of these methods which can completely handle expand requests in a generic way. However, you can redefine the methods with your own implementation if necessary (for example, in case of performance-critical scenarios, or if you experience poor response time).

  7. Verify that GET_ENTITY for the BusinessPartner is working, by appending BusinessPartners to the end of the Request URI and clicking Execute.
  8. In the result set, find a valid business partner ID (for example, BusinessPartners('100000000')) and click Execute.
    This step should return a single BusinessPartner entry along with its details.