This is a test message to test the length of the message box.
Login
ABAP RAP Draft
Created by Software-Heroes

RAP - Draft (Part 2)

1081

The second part on the subject of draft handling in RAP objects is about better displaying the draft status at the individual positions in the list.



In the last article we added draft handling to our app. However, you should also have noticed that the display of the current draft in the list was not very good, since the status of the sentence was not recognizable. In this article we will show you how the display can be made even better and more detailed.

 

Introduction

After we activated and made the draft handling available, we could admire the first version of the list report:

 

Unfortunately, the draft status is still not displayed in this version and we can only find positions that have been changed but not yet saved via the filter. We want to change this with this article and take over the necessary components. In the last article we implemented the minimum for draft handling.

 

Tables

First of all, the partner table has to be adjusted again. At the end we add further information about the person who made the change, but also about the creator of the data record. The ZBS_DMO_PARTNER table now looks like this:

define table zbs_dmo_partner {
  key client       : abap.clnt not null;
  key partner      : abap.char(10) not null;
  name             : abap.char(60);
  street           : abap.char(80);
  city             : abap.char(60);
  country          : land1;
  payment_currency : abap.cuky;
  last_changed_at  : abp_locinst_lastchange_tstmpl;
  last_changed_by  : abp_locinst_lastchange_user;
  created_at       : abp_creation_tstmpl;
  created_by       : abp_creation_user;
}

 

For a clean management of the status, the implementation of all 5 fields is recommended. In the next step, the draft table must also be adjusted to include the new information. You should make sure that the field names correspond to the names in the interface view and thus differ from the table fields:

define table zbs_dmo_dpartner {
  key mandt         : mandt not null;
  key partnernumber : abap.char(10) not null;
  key draftuuid     : sdraft_uuid not null;
  partnername       : abap.char(60);
  street            : abap.char(80);
  city              : abap.char(60);
  country           : land1;
  paymentcurrency   : abap.cuky;
  lastchangedat     : abp_locinst_lastchange_tstmpl;
  lastchangedby     : abp_locinst_lastchange_user;
  createdat         : abp_creation_tstmpl;
  createdby         : abp_creation_user;
  "%admin"          : include sych_bdl_draft_admin_inc;
}

 

Core Data Service

As a next step, the call stack of the Core Data Services has to be expanded, for this the fields of the table are taken over. There is a corresponding annotation for each field, which we now assign so that the meta information can be properly derived in the app.

@Semantics.systemDateTime.lastChangedAt: true
last_changed_at  as LastChangedAt,
@Semantics.user.lastChangedBy: true
last_changed_by  as LastChangedBy,
@Semantics.systemDateTime.createdAt: true
created_at       as CreatedAt,
@Semantics.user.createdBy: true
created_by       as CreatedBy

 

Furthermore, the following objects still have to be adjusted, which we won't go into in detail here because they are small adjustments. You can find more information in the commit in the git repository:

  • Projection View - Adoption of the new fields in the projection layer and thus make them available in the app.
  • Behavior Definition - Extension of the mapping in the behavior definition to include the new fields.

 

Metadata Extension

After the adjustments, however, the information for the draft is still not visible in the positions. To do this, the metadata, specifically the header information, must be expanded. To do this, we add the following UI annotation in the header:

@UI.headerInfo.title: { type: #STANDARD, value: 'PartnerName' }

 

What exactly happened in the app? First of all, additional information was displayed in the header area on the detail screen when an entry was selected:

 

Furthermore, the draft status is now displayed in the list of entries. If you click on the entry, you will receive information about the last change. If you are the changer, then only "Draft" is displayed, if someone else is the changer, then information about the user is also displayed:

 

Conclusion

In addition to a better presentation of the draft information, your app now also has an automatic management of the technical information. Not even many changes are necessary to implement a certain standard in the apps.


Included topics:
RAPBTPDraftDraft Handling
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.


RAP - Generator (from Scratch)

Category - ABAP

Does your development with RAP sometimes feel very slow? Generators do the work for you, building the actual stack and eliminating repetitive work.

08/05/2025

RAP - Action (Processing options)

Category - ABAP

How do you actually enable multi-select in RAP and control the various processing options? Here we'll look at the different options in the framework.

08/01/2025

RAP - Custom Entity with Action

Category - ABAP

How can you cleanly implement an action in a Custom Entity to update the UI und utilize EML? Let's take a closer look at the different steps.

07/29/2025

RAP - API Pattern

Category - ABAP

In this article, we look at the API pattern for RAP and how you can use it flexibly in ABAP development to provide interfaces.

06/20/2025

RAP - Multiple filters and settings

Category - ABAP

What happens if we want to set several filters and fields as default in RAP and also need a default sorting?

05/16/2025