Show TOC

Using Callable Entities as OData DeveloperLocate this document in the navigation structure

This section describes how you use callable entities as OData developer.

Using the Factory Class
Use the factory class /UI2/CL_NAVIGATION_FACTORY to access the target link lists for semantic objects and to obtain the navigation details of the callable entity for an entry of the target link list. The prerequisites for this generic access are as follows:
  • Data for the semantic objects, the navigation provider, and the BAdI implementation of the assigned repositories (navigation provider) has been maintained.
  • The class can be used especially in your OData services.

Create an instance of the factory class:

Code Syntax

DATA: lr type ref to /UI2/CL_NAVIGATION_FACTORY

create object lr.

  • Retrieving the target link list (ID, description) of a semantic object

    Use the following code to obtain all navigation links of your semantic object 'PRODUCTS':

    Code Syntax lr->GET_TARGETS( IV_NAVIGATION_OBJECT = 'PRODUCTS' )
  • Obtaining the bootstrap-HTML for an entry of the target link list

    Use the following code to obtain the navigation target HTML for the navigation on the UI:

    Code Syntax

    lr->GET_TARGET_HTML( Importing

    IV_ID = 'ID of NAV TARGET XYZ'

    IT_BUSINESS_PARAMS = 'Possible Business Parameter' ... )

Creating an OData Service for the Navigation Provider

An OData service is required to enable the navigation based on callable entities. You can use the SAP Gateway Service Builder to model and generate your OData service.

Using SAP Gateway to Create an OData Service

Start Gateway Service Builder (transaction SEGW). As an example you can refer to system U00 (client 010), the service /UI2/ESPM_NAV with the description UI2 Demo on UI Navigation via Callable Entities. In the generation process of the Gateway Service Builder, several classes are generated in the package /UI2/SERVICES_ESPM_NAV (see transaction /nse80).

Then you need to code special methods for the data access, here class /UI2/CL_ESPM_NAV_DPC_EXT (Data Provider Secondary Class).