SAP Knowledge Base Article - Public

2905847 - How to Setup OData in SAP Business ByDesign

Symptom

This KBA explains how to setup an OData service in SAP Business ByDesign.

Environment

SAP Business ByDesign

Resolution

To perform OData service operations in SAP Business ByDesign, it is required to create Custom Odata Service.

SAP Business ByDesign offers a few specific Odata services by default, and custom services can be created for operations on most business objects of the system.

Note: Only business users are able to use the Odata services created in the Odata Services view. Technical users will receive an authorization error when trying to query or post data via Odata service.

To create an Odata service, please follow the steps below (note, in this example the business object Sales Order will be used):

  1. Go to Application and User Management work center.
  2. Enter the Odata Services view.
  3. In the Query dropdown, navigate to Custom Odata Services.
  4. Click on the New button.
  5. In the new screen, enter the Service Name.
  6. Click on the Save, then Save and Open option.
  7. In the new screen, under the Header section there are a couple of important properties:
    1. The Include Code Descriptions checkbox adds the description of each code together with the numeric code itself (for example, instead of only displaying the field StatusCode, the service will also include StatusCodeDescription with the text description which is seen in the UI).
    2. The No Authorization Checks checkbox defines whether the data that can be fetched by the Odata service will go through access restriction rules for the user calling the service. In this example, checking this box makes it so all Sales Orders are displayed for any user that calls this service, regardless of access restrictions.
    3. The Work Center View property will define the work center view required for any user to be able to see and use the Odata service.

After defining the Header setup, it is possible to insert the business objects and fields which will be included in the service:

  1. Under the Entity Types tab, click on Select Business Object.
  2. In the popup that appears, select the business object and the node desired using the value help for each field.
  3. This will open the business object structure on the left side. Use the checkboxes to add the desired fields to the service.
  4. Once the Select checkbox is checked, the field should appear on the right side, showing that it is included in the service.
  5. On the right side, you can click on each field and change properties such as whether the field can be set as null, the default value, if the field can be used in filtering GET operations, etc.
  6. Once the service is completed, click on the Save button.
  7. Click on the Activate button.

The service URL will get generated and will appear on the top right of the screen. This is the URL that will be used to perform operations on with this service.

See Also

2330688 - How to Use Methods And Filters in OData Services

SAP Business ByDesign API Samples

2805832 - Restricting Standard OData Collection

2584786 - Retrieving data using ODATA

2325562 - Frequently Asked Questions on OData Services

Keywords

KBA , AP-RC-ODF-BYD , OData Framework and Console (ByD) , Problem

Product

SAP Business ByDesign all versions