SAP Knowledge Base Article - Public

2415262 - How to Add Extension Fields to OData Services

Symptom

You are working as administrator in SAP Hybris Cloud for Customer and you wish to add your extension fields to OData services.

Environment

SAP Hybris Cloud for Customer

Resolution

OData services can be categorized as below:

  • Custom OData service.
  • Standard OData service.

Adapting Extension Fields to the Standard OData Service

You can create new extension fields by following the below steps:

  1. Select respective work center with HTML client
  2. Select the button Adapt to Enter Adaptation Mode
  3. Select Edit master layout option
  4. Select a field and right click and select Add Items
  5. A new pop up would show up, here you can either select Existing Extension field or create a new Extension Fields

How to add the extension fields in standard OData service:

  1. Select respective workcenter
  2. Select the button Adapt to Enter Adaptation Mode
  3. Select Edit Master Layout option
  4. Search the required Extension Field
  5. Select Settings and then select Field Definition
  6. Select ODATA Service tab
  7. The checkbox for the OData services should be checked

In order to check whether the extension field has been adapted to the standard OData service:

  1. Go to Administrator work center;
  2. Go to OData Service Explorer view;
  3. Select SAP OData Services;
  4. Select and View the required service name;
  5. Select the Test button;
  6. Copy the URL and open it in new Browser;
  7. Once you query the URL, you can find the extension field in the properties for the specific entity.

 Adapting Extension Fields to the Custom OData Service

  1. Go to Custom OData services;
  2. Select New to create a new custom OData service;
    • Select Data Workbench enabled indicator if you wish for this service to be available as a Data Workbench object;
  3. Edit the custom OData service;
  4. Select the required Object under Select Business Object;
  5. Expand and select the entities;
  6. Now all the extension fields related to the selected entities will be available in the right-hand side window;
  7. Select all the required extension fields and save your custom OData service.

Once the custom OData service is created with all the required extension fields, by default all the extension fields will be available when you open the URL in browser.

Keywords

OData Service, Extension Fields, Data Workbench , KBA , LOD-CRM-INT-API , OData API (C4C Only) , How To

Product

SAP Cloud for Customer 1802 ; SAP Cloud for Customer 1808 ; SAP Cloud for Customer 1811 ; SAP HYBRIS C4C ADDINS 1705 ; SAP Hybris Cloud for Customer 1611 ; SAP Hybris Cloud for Customer 1702 ; SAP Hybris Cloud for Customer 1708 ; SAP Hybris Cloud for Customer 1711