Show TOC

Create Entity TypesLocate this document in the navigation structure

This document describes steps for creating Entity Types in Service Builder Project complying with OData V4.

NoteThe following image contains links to more information.
This document describes about the Service Builder projects that comply with OData V4, the development approach followed by it and its User Interface. This document describes creating an empty Service Builder project complying with OData V4. This document describes steps for creating Entity Types in Service Builder Project complying with OData V4. This document describes creating properties for an entity type complying with OData V4. This document describes creating Navigation Properties in the Service Builder project complying with OData V4. This document describes creating Entity Sets for the Service Builder projects complying with OData V4 This document describes defining Navigation Property Binding for the Service Builder projects complying with OData V4. This document describes creating complex types in the project complying with OData V4.
Prerequisite

You should have already created an OData V4 project

Context
Entity Types in Service Builder, describe the structure of data in Entity Data Model (EDM). An entity represents a specific type of data, for example an item or a concept. Entity types comprise:
  • A unique name
  • A key, which can be defined by one or more properties (Is Key)
  • Properties
  • Navigation properties (optional)
The entity type properties must adhere to the data types allowed and provided by the OData V4 protocol or be of a complex type. An entity type must have a unique identifier that allows the entities belonging to this entity type to be used within an OData context. To create Entity Types proceed as follows:
Procedure
  1. Right click Data Model folder in the tree view, select Start of the navigation path Create Next navigation step Entity Type End of the navigation path. This opens the Create Entity wizard.
  2. In Entity Type name column specify name for the Entity Type. The name for Entity Type must be unique. Maximum number of characters allowed in this column is 128. Special characters except ‘_’ are not allowed. The name must start with either an alphabet or ‘_’. An error message displays if a character in the specified name is not allowed.
  3. Create Related Entity Set is optional. Select this option to create an Entity Set along with the Entity Type. This enables Entity Set Name column and a default Entity Set name is displayed that can be edited. Click OK, a new Entity Type and its Entity Set are created. In mass edit view, the entity type table displays the entries for the new data model elements.
  4. Click Save to save the changes made in the project. Entity Types ALV
Alternatively, you can perform the following steps as well for creating Entity Types:
  1. Expand Data Model folder in the tree view of your project, and double-click Entity Types to open the Mass Edit View.
  2. Click Display <-> Change to switch to edit mode and then choose Insert Row to add a new row or choose Append Row to append a new row to the table for the new entity type.
  3. In Entity Type Name column enter a unique name for the entity type.
  4. In ABAP Structure column enter an appropriate ABAP structure or use the input help to search an existing structure in the repository.
  5. In Internal Name column enter an appropriate internal name of the entity type. If you leave Internal Name blank, the system generates a unique name on its own.
  6. In As Etag Property column enter a property to be used as an ETag to support OData optimistic concurrency control for modifying requests or use the input help to select an existing Property from the same Entity Type.
  7. Click Save to save the changes.