Showing results for 
Search instead for 
Did you mean: 

CAP: Getting Enum Values from OData Service


Hey guys,

I have a CAP entity "Books" with a Property "Status", which is exposed via an Node.js OData V4 Service and which is defined with some enumeration values like this:

entity Books {
    key ID     : Integer;
        title  : localized String;
        author : Association to Authors;
        stock  : Integer;
        status                : String(1)
        @( title: 'Status', ) enum {
          requested = 'R' @( title: 'Requested');
          pending   = 'P' @( title: 'Pending');
          approved  = 'A' @( title: 'Approved');
          rejected  = 'N' @( title: 'Rejected');

The entries of the "Books" entity look like this:

201;Wuthering Heights;101;12;P
207;Jane Eyre;107;11;A
251;The Raven;150;333;A

Now when I read the Books entity from my Fiori Elements List Report I want to have the titles of the "status" property and not only the 1 length characters.

Is this even possible?

Best Regards


View Entire Topic

Hi Dominik,

if you want status names to be displayed in Fiori, having them as symbol names in an enum is not sufficient. You need to define a dedicated entity for that purpose.

As an example, have a look at our SFLIGHT sample app at

In there are the entities "BookingStatus" and "TravelStatus". Their key is the status code (modelled as enum), but via the aspect "CodeList" they also get a "name". These entities are used for the status fields of entities "Booking" and "Travel", respectively.

For display, annotation "@Common.Text" is used to show the status name instead of the code: and

0 Kudos

Hi @steffen_weinstock,

thanks for your solution. However, the scripts in the repo for showing the Status name are no longer available. May I ask you to share the original files, please? >"<