This is a test message to test the length of the message box.
Login
|

035: Recycling-Heroes - New entity (Document)

63

After generating the app, the actual development phase begins. The app needs to be adapted and expanded for our use in order to meet our specific requirements. Therefore, we are extending the data model with a new entity.

Advertising


Introduction

In the last episode, we generated our app with relatively little effort. We used various generators for the data model and the RAP stack, which significantly increased development time. However, the real work only begins with customizing the application and defining our own use case.

 

Entity

The standard RAP generator can only generate a single entity. However, our data model also includes a child entity. Therefore, we will extend our data model with another entity for the tags. Since we've already created the table with the generator, we can start defining the Core Data Service directly. Right-clicking the table starts the wizard, and the table is automatically defined as a reference object. After entering the name and description, always make sure you're using the correct type for generation; here, we'll almost always define a VIEW ENTITY. After generation, we clean up the view and activate the object.

Next, we need to establish the relationship in the data model. We'll use small code snippets to help us define the relationship between the objects. From root to child, we need a composition and specify the other view in the definition. Then we assign a descriptive alias and propagate the association externally. At the child level, we define an "Association to parent" to our root entity. After changing the alias and the link, we also specify the association in the field list. Then we can activate both views, thus defining the relationship at the lowest level.

Now we can begin creating the core data service for the projection. Here, you can start the interface view directly and create the new core data service by right-clicking. After assigning a name and description, we select the correct type from the templates and create the view. At this level, we override the association from the interface and redirect to the appropriate core data service at the projection level. We perform this step on both levels and then activate the two views, thus connecting the projection.

 

Behavior

Now that we have extended the data model, we need to adjust the behavior so that the objects can interact with each other and also know which relationships exist. You will also find an entry in the RAP Generator that defines the relationships accordingly. We copy the code snippet to define another entity in the behavior. Now we need to adapt the components to our current data model. We replace the Core Data Service and assign a descriptive alias. We also have our own table in the data model, as well as a new draft table. Here we assign the name, but we still need to generate the table later. In this case, we obtain the locking and permissions via the association from our root entity. We should set the key fields to read-only, as these should no longer be editable in the event of modifications. Next, we define the mapping from Core Data Service to the table so that the database is also populated during write operations. Before we can activate this behavior, we generate the draft table using Quick Fix. This table is automatically created in the system and uses our data table as its basis. To enable us to create new tags later, we must define the association at the root level using Create and then activate the object.

We also need to perform the extension at the projection level. To do this, we define the new entity and the association in the root entity. Finally, we replace the placeholders with the actual objects and relationships and can activate the object.

 

Service

Currently, there is only one entity in the service, and the relationship is not visible in the service binding. Therefore, we also need to make the new entity in the service accessible. To do this, we extend the service definition, specify our entity, and finally activate the service.

 

Summary

In today's episode, we focused on extending an existing data model. Last time, the generator provided us with a simple app, but not the complete data model. As of today, there is no automatic adjustment or wizard, which is why we have to perform the adjustment manually. So we are at the end of this session. Thanks for watching and see you next time.

 

YouTube
Video


Included topics:
YouTubeScriptRecycling-HeroesAdjustment
Comments (0)



And further ...

Are you satisfied with the content of the article? We post new content in the ABAP area every Tuesday and Friday and irregularly in all other areas. Take a look at our tools and apps, we provide them free of charge.


038: Recycling-Heroes - Annotations (Document)

Category - YouTube

In this episode, we'll look at the annotations in the Documents app and how to easily create them. We'll also extend the app and fix a problem with the key.

03/30/2026

037: Core Data Service [Basics] - View and View Entity

Category - YouTube

Let's take a look at the classic View in contrast to the modern View Entity. We'll discuss minor differences, migration to ABAP, and how you can manage Core Data Services more easily.

03/16/2026

036: Core Data Service [Basics] - Analysis

Category - YouTube

Where can you find more information about a Core Data Service in ABAP when it comes to analyzing existing objects? Let's look at various tools for this.

03/09/2026

034: Recycling-Heroes - Object and RAP Generator (Document)

Category - YouTube

In this episode, we create our new document app using generators to create the data model and then to create the RAP object.

02/02/2026

033: Core Data Service [Basics] - Consumption Modeling

Category - YouTube

In this episode, we look at the modeling of a Consumption View and examine various aspects such as functions, associations, session variables, and virtual fields.

01/26/2026