How to activate OData service in SAP

SOLUTION

Show

Please follow the steps below in order to activate the OData service

  • First, navigate to /N/IWFND/MAINT_SERVICE in the SAP command field.

How to activate OData service in SAP

  • Next, click the Add Service button.

How to activate OData service in SAP

  • Now select the relevant System Alias you can use a filter if needed.

How to activate OData service in SAP

  • After selecting System Alias click the Get Services button.

How to activate OData service in SAP

  • Now on the list, please select those services that you want to activate and choose "Add Selected Services".

How to activate OData service in SAP

  • Now enter a prefix for your service and model names, for example, Z, and then enter a valid package and choose Enter.

How to activate OData service in SAP

  • Your Odata is succesfully created.

How to activate OData service in SAP

After you have generated the SAP gateway artifacts in your development environment, you can continue with the next step towards consumption of the OData service. For this you need to activate the OData service in the SAP Gateway hub. In other words: The OData service has to be enabled in SAP Gateway which establishes a mapping between the technical OData service name and the corresponding back-end service.

Prerequisites

  • The service artifacts are successfully created in the back end of the application server AS ABAP.
  • The SAP Gateway Hub (target system for the OData service) is set up and configured for managing OData services. More on this: Quick Configuration
    How to activate OData service in SAP
  • You have the authorization for using activation functionality in the transaction /IWFND/MAINT_SERVICE.

Procedure

  1. Open the SAP GUI for the relevant ABAP project by starting the SAP GUI Launcher ABAP Development Tools (icon
    How to activate OData service in SAP
    in the toolbar). Within the embedded SAP GUI, you are able to access the complete functionality of the classic ABAP Workbench.
  2. In the command field, enter the transaction code /IWFND/MAINT_SERVICE.

    The entry screen of the transaction displays in the target system all activated Gateway services in the Service Catalog and allows you to add new services.

  3. Click the Add Service button in the toolbar.
  4. Enter the System Alias of your front-end server.
  5. Enter the Technical Service Name (in our case: <CDS_VIEW>_CDS).
  6. Click the Get Services button in the toolbar to request the services available.

    As a result, the service is displayed for selection.

  7. Select the service service created as a result of last procedure and then choose Add Selected Services or alternatively click the object link for further selection.

    The Add Service dialog that appears, suggests already the name Z<CDS_VIEW>_CDS for the Technical Service, and for the Technical Model.

    The dialog that now appears informs you that the model metadata for the Gateway service is going to be created.

  8. Specify the package for service activation.
  9. Leave the other details on the dialog screen unchanged, and choose
    How to activate OData service in SAP
    (Continue).

    The dialog that now appears informs you that the model metadata for the Gateway service has been created successfully in the Gateway.

    How to activate OData service in SAP

    Figure 4: Dialog that informs you about a successful service creation (example for $TMP package)

  10. In the information dialog, complete the procedure with
    How to activate OData service in SAP
    (Continue).

Results

As a result of the successful procedure, the OData service has been activated in the Gateway hub. During the course of this activation, further new objects have been created:

  • SAP Gateway: Service Group Metadata object (object type: R3TR IWSG) with the name Z<CDS_VIEW>_CDS_<VERSION> that object type IWSG that includes the service group metadata of the Gateway represents the actual OData service.
  • An SAP Gateway: Model Metadata object (object type: R3TR IWOM) with the name Z<CDS_VIEW>_CDS_<VERSION>_BE that represents the structure of the actual OData service.

The OData service is also added to the Service Catalog of transaction /IWFND/MAINT_SERVICE.

How to activate OData service in SAP

Figure 5: The new OData service is displayed in the Service Catalog (example for $TMP package)


Page 2

  1. Run transaction Activate and maintain services (/IWFND/MAINT_SERVICE) on the front-end server.

  2. Choose Add Service.

  3. Enter the system alias of your back-end system.

  4. In the External Service Name field, enter the technical name of the OData service for your app without the version number. For more information on the OData service per app, see the app-specific documentation in the section SAP Fiori Apps.

  5. In the Version field, enter the version number.

  6. Choose Get Services.

  7. Choose Add Selected Services.

  8. Enter a technical name for the service in your customer namespace.

  9. Assign a package or choose Local Object.

  10. Choose Execute to save the service.

  11. On the Activate and maintain services screen, check if the system alias is maintained correctly. If not, delete the alias and add the correct one.


Page 2