cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Fiori elements preview not displaying cds view fields

YABAPER
Explorer
0 Kudos
1,027

Hi everyone

I have a cds view that extracts some data from the swwflexproc, swwwihead and swwuserwi tables. I have already created the necessary service definition and binding for the view. However after activating and publishing the service binding, when I run the application using the fiori elements preview, the fields that display do not match up with those defined in my cds view. I am new to abap and followed the following tutorial: Create an ABAP Core Data Services (CDS) View in ABAP On-Premise | SAP Tutorials , https://developers.sap.com/tutorials/abap-environment-create-cds-view.html  but cannot seem to figure out where I am going wrong. Any assistance would be greatly appreciated.

my cds view definition:

define view Z_Test_Report with parameters @Environment.systemField: #SYSTEM_DATE p_currdate: datum

as select from swwwihead as ihead

left outer join swwuserwi as userwi on ihead.wi_id = userwi.wi_id

left outer join swwflexproc as flex on ihead.wi_id = flex.wi_id

{

key flex.appl_obj_id as AppplicationObjectID,

ihead.wi_id as WorkItemID,

ihead.wi_cd as Date,

ihead.wi_aagent as Agent,

coalesce(ihead.wi_stat, 'In progress') as Status,

dats_days_between(ihead.wi_cd, :p_currdate) as Overdue,

ihead.wi_text as Comments,

}

Fields for selection in the fiori elements preview:

YD11_0-1732035762681.png

service definition:

@EndUserText.label: 'srvc definition exposing Z_Test_Report'

define service Z_CDS_DEFINITION {

expose Z_Test_Report as TR;

}

Accepted Solutions (1)

Accepted Solutions (1)

YABAPER
Explorer
0 Kudos

After some testing, I found that activating the view via the SAP GUI as well as the @EndUserText.Label annotation seemed to help with the field names.

Answers (1)

Answers (1)

MBartsch71
Participant
0 Kudos

I guess you need to annotate the fields of the CDS view to display them in the app.

This can be done with: 

 

@ui.lineItem: [{ position: 10 }]

YABAPER
Explorer
0 Kudos

Hi @MBartsch71 , I have already tried this but have not noticed a change in the fields displayed