Generate the transactional UI service
Before starting this tutorial, we hope you’ve completed the prerequisite tutorials.
Create your OData v4-based UI services and RAP business object (BO) along with all the necessary ABAP artifacts—such as CDS view entities, behavior definition, and implementation—using the built-in ADT generator. The resulting business service will be transactional, draft-enabled, and equipped with UI semantics for generating the Fiori elements app
Right-click your database table and select Generate ABAP Repository Objects
Right-click your database table and select Generate ABAP Repository Objects
Select OData UI Service and click Next
Go to project explorer and see list of objects created(If not visible, refresh package)
Here’s a brief overview of the generated artifacts for the various RAP layers: Base BO, BO Projection, and Business Service.
Base Business Object
Object Name | Description |
This data definition defines the data model of the root entity Travel which is the only node of our business object | |
This behavior definition contains the definition of the standard transactional behavior of the base Travel BO entity. It is a managed and draft-enabled implementation. | |
This database table is used to temporary store the data from draft travel instances at runtime. It is managed by the RAP framework | |
This ABAP class which provides the implementation of the behavior defined in the behavior definition ZR_RAPTECH_TRAVELof the base Travel BO. |
BO Projection
Object Name | Description |
This data definition is used to define the projected data model of the root entity Travel relevant for the present scenario. Currently almost all fields of the underlying base BO view are exposed and the definition of metadata extension is allowed using the view annotations @Metadata.allowExtensions: true. | |
This behavior definition exposes the part of the underlying base Travel BO entity which is relevant for the present scenario with the keyword use. Currently all standard CUD operations are exposed. | |
This metadata extension is used to annotate view ZC_RAPTECH_TRAVEL and its elements with UI semantics via CDS annotations. |
Business Service
Object Name | Description |
A service definition is used to define the relevant entity sets for our service and also to provide local aliases if needed. Only the Travel entity set is exposed in the present scenario. | |
This service binding is used to expose the generated service definition as OData V4 based UI service. Other binding types (protocols and scenarios) are supported in the service binding wizard. |
Adjust metadata extension
Open your metadata extension ZC_RAPTECH_TRAVEL and adjust it.
The field attachment is a raw string (data type RAWSTRING) and cannot be used in the filter bar, so the annotation @UI.selectionField is not allowed for this field and should be removed. Therefore, remove following annotation block for the field attachment:(if it is not present, then ignore)
The field attachment is a raw string (data type RAWSTRING) and cannot be used in the filter bar, so the annotation @UI.selectionField is not allowed for this field and should be removed. Therefore, remove following annotation block for the field attachment:(if it is not present, then ignore)
@UI.selectionField: [ {
position: 10
} ]
Save and activate.
Publish and Preview the Travel App
Publish the local service endpoint of your service binding in the Service Binding editor and start the Fiori elements App Preview.
Open your service binding ZUI_RAPTECH_TRAVEL_O4 and click Publish
Congratulations on completing the tutorial! 🎉 It’s a great moment of achievement, and you should be proud of the progress you’ve made. You’ve learned new concepts, built something valuable, and taken another step toward mastering your skills. Keep up the great work, and don’t hesitate to dive into the next challenge! Happy coding! 😊