Structure of OData Service

0
8411

As you known about SAP OData. In this blog lets look at the basic structure of the OData service. It have mainly two parts

  1. Service document
  2. Service metadata document.

Service document

Service documents consists of all list of resources URI’s that can be accessible. ZSL_EPM_DEMO is the OData service which we will be going to build in future tutorials. Basically this service will retrieve sales order data.Lets look at what information does this service documents holds.Service document is accessible through the URI.

1

Service metadata document

Service metadata documents contains meta data of all elements in the service. You can see the metadata of a service by simple adding “$metadata” to the service URI.

1

Different elements we see in SAP OData service are

Entity Type: Entity is like work area which holds empty or one record data. As we have different fields in work area here also we have different fields and we call them as Properties.Each Entity should have at least one key field.

Entity Set: Entity Set is a collection of same entity types. It is like internal table which holds n records of same type. For example list of sales orders is a Entity Set.

Property: It represents a primitive data type element.It is like a single field in a work area or single column in a table. one or more properties are used to create an Entity Types.

Association: It defines the relation between different entity types.For example if we have two entity types one for Sales Order header and other for Sales Order Item we can build the association between these two entity types with cardinality.

Navigation property: Entity Types include one or more navigation properties.It is specific type which acts like a link to the other Entity types based on cardinality provided in the Association property. To create the navigation property for an entity type we need first define the association between those entity types.

Stay tuned to us for more SAP Netweaver Gateway tutorials. Please feel free to comment and let us know you feedback.

Thank you.