SAP Fiori Elements List Reports

CDS Tipps & Tricks

Im Rahmen der ABAPConf 2021 durfte die CloudDNA GmbH einen Vortrag zum Thema SAP Fiori Elements – CDS Tipps und Tricks halten.

Dabei zeigen wir Ihnen gängige Anwendungsfälle in der Entwicklung von SAP Fiori Elements Apps. 

Listendarstellung (@UI.lineItem)

@Metadata.layer: #CUSTOMER  annotate view ZC_AC_FLIGHTS with
{
 @UI.lineItem: [{ position: 10, importance: #HIGH }]
 Carrid;  @UI.lineItem: [{ position: 20, importance: #HIGH }]
 Connid;  @UI.lineItem: [{ position: 30, importance: #HIGH }]
 Fldate;  @UI.lineItem: [{position: 40, importance: #MEDIUM }]
 Price;  @UI.lineItem: [{position: 50, importance: #MEDIUM }]
 Seatsocc;  @UI.hidden: true
 SeatsCritical; 
}

Listendarstellung mit Header (@UI.headerInfo)

@Metadata.layer: #CUSTOMER
@Search.searchable: true
@UI.headerInfo.typeName: 'Flight'
@UI.headerInfo.typeNamePlural: 'Flights'  annotate view ZC_AC_FLIGHTS with
{
 @Search.defaultSearchElement: true
 @UI.lineItem: [{ position: 10, importance: #HIGH }]
 Carrid;  @UI.lineItem: [{ position: 20, importance: #HIGH }]
 Connid;  @UI.lineItem: [{ position: 30, importance: #HIGH }]
 Fldate;  @UI.lineItem: [{position: 40, importance: #MEDIUM }]
 Price;  @UI.lineItem: [{position: 50, importance: #MEDIUM }]
 Seatsocc;  @UI.hidden: true
 SeatsCritical; 
}

Listendarstellung mit Suche (@Search)

@Metadata.layer: #CUSTOMER
@Search.searchable: true
@UI.headerInfo.typeName: 'Flight'
@UI.headerInfo.typeNamePlural: 'Flights'  annotate view ZC_AC_FLIGHTS with
{
 @Search.defaultSearchElement: true
 @UI.lineItem: [{ position: 10, importance: #HIGH }]
 Carrid;  @UI.lineItem: [{ position: 20, importance: #HIGH }]
 Connid;  @UI.lineItem: [{ position: 30, importance: #HIGH }]
 Fldate;  @UI.lineItem: [{position: 40, importance: #MEDIUM }]
 Price;  @UI.lineItem: [{position: 50, importance: #MEDIUM }]
 Seatsocc;  @UI.hidden: true
 SeatsCritical; 
}

Listendarstellung mit Filtern (@SelectionFields)

@Metadata.layer: #CUSTOMER
@Search.searchable: true
@UI.headerInfo.typeName: 'Flight'
@UI.headerInfo.typeNamePlural: 'Flights'  annotate view ZC_AC_FLIGHTS with
{
 @Search.defaultSearchElement: true
 @UI.lineItem: [{ position: 10, importance: #HIGH }]
 @UI.selectionField: [{ position: 10 }]
 Carrid;  @UI.lineItem: [{ position: 20, importance: #HIGH }]
 @UI.selectionField: [{ position: 20 }]
 Connid;  @UI.lineItem: [{ position: 30, importance: #HIGH }]
 @UI.selectionField: [{ position: 30 }]
 Fldate;  @UI.lineItem: [{position: 40, importance: #MEDIUM }]
 Price;  @UI.lineItem: [{position: 50, importance: #MEDIUM }]
 Seatsocc;  @UI.hidden: true
 SeatsCritical; 
}

Listendarstellung mit Value Help (@Consumption.valueHelp)

Listendarstellung mit Select Filter (@ObjectModel.resultSet.sizeCategory)

Listendarstellung mit Date Range (@Consumption.filter.selectionType)

@Metadata.layer: #CUSTOMER
@Search.searchable: true
@UI.headerInfo.typeName: 'Flight'
@UI.headerInfo.typeNamePlural: 'Flights'  annotate view ZC_AC_FLIGHTS with
{
 @Search.defaultSearchElement: true
 @UI.lineItem: [{ position: 10, importance: #HIGH }]
 @UI.selectionField: [{ position: 10 }]
 Carrid;  @UI.lineItem: [{ position: 20, importance: #HIGH }]
 @UI.selectionField: [{ position: 20 }]
 Connid;  @UI.lineItem: [{ position: 30, importance: #HIGH }]
 @UI.selectionField: [{ position: 30 }]
 @Consumption.filter.selectionType: #INTERVAL
 Fldate;  @UI.lineItem: [{position: 40, importance: #MEDIUM }]
 Price;  @UI.lineItem: [{position: 50, importance: #MEDIUM }]
 Seatsocc;  @UI.hidden: true
 SeatsCritical;
}

Listendarstellung LineItem Status Indicator (@UI.lineItem.criticality)

@Metadata.layer: #CUSTOMER
@Search.searchable: true
@UI.headerInfo.typeName: 'Flight'
@UI.headerInfo.typeNamePlural: 'Flights'
@UI.lineItem: [{criticality: 'SeatsCritical'}]
annotate view ZC_AC_FLIGHTS with
{
 @Search.defaultSearchElement: true
 @UI.lineItem: [{ position: 10, importance: #HIGH }]
 @UI.selectionField: [{ position: 10 }]
 Carrid;  @UI.lineItem: [{ position: 20, importance: #HIGH }]
 @UI.selectionField: [{ position: 20 }]
 Connid;  @UI.lineItem: [{ position: 30, importance: #HIGH }]
 @UI.selectionField: [{ position: 30 }]
 @Consumption.filter.selectionType: #INTERVAL
 Fldate;  @UI.lineItem: [{position: 40, importance: #MEDIUM }]
 Price;  @UI.lineItem: [{position: 50, importance: #MEDIUM }]
 Seatsocc;  @UI.hidden: true
 SeatsCritical;
}

Listendarstellung LineItem Link (@UI.lineItem.type: #WITH_URL)

@Metadata.layer: #CUSTOMER
@Search.searchable: true
@UI.headerInfo.typeName: 'Flight'
@UI.headerInfo.typeNamePlural: 'Flights'
@UI.lineItem: [{criticality: 'SeatsCritical'}]
annotate view ZC_AC_FLIGHTS with
{
 @Search.defaultSearchElement: true
 @UI.lineItem: [{ position: 10, importance: #HIGH, type: #WITH_URL, url: 'Url' }]
 @UI.selectionField: [{ position: 10 }]
 Carrid;  @UI.lineItem: [{ position: 20, importance: #HIGH }]
 @UI.selectionField: [{ position: 20 }]
 Connid;  @UI.lineItem: [{ position: 30, importance: #HIGH }]
 @UI.selectionField: [{ position: 30 }]
 @Consumption.filter.selectionType: #INTERVAL
 Fldate;  @UI.lineItem: [{position: 40, importance: #MEDIUM }]
 Price;  @UI.lineItem: [{position: 50, importance: #MEDIUM }]
 Seatsocc;  @UI.hidden: true
 SeatsCritical; 
}

Listendarstellung LineItem Progress Indicator (@UI.datapoint.visualization)

@Metadata.layer: #CUSTOMER
@Search.searchable: true
@UI.headerInfo.typeName: 'Flight'
@UI.headerInfo.typeNamePlural: 'Flights'
@UI.lineItem: [{criticality: 'SeatsCritical'}]
annotate view ZC_AC_FLIGHTS with
{
 @Search.defaultSearchElement: true
 @UI.lineItem: [{ position: 10, importance: #HIGH, type: #WITH_URL, url: 'Url' }]
 @UI.selectionField: [{ position: 10 }]
 Carrid;  @UI.lineItem: [{ position: 20, importance: #HIGH }]
 @UI.selectionField: [{ position: 20 }]
 Connid;  @UI.lineItem: [{ position: 30, importance: #HIGH }]
 @UI.selectionField: [{ position: 30 }]
 @Consumption.filter.selectionType: #INTERVAL
 Fldate;  @UI.lineItem: [{position: 40, importance: #MEDIUM }]
 Price;  @UI.lineItem: [{position: 50, importance: #MEDIUM, type: #AS_DATAPOINT }]
 @UI.dataPoint: {targetValueElement: 'Seatsmax', visualization: #PROGRESS, criticality: 'SeatsCritical'}
 Seatsocc;  @UI.hidden: true
 SeatsCritical;
}

Solltet ihr die ABAPConf 2021 verpasst haben kommt Ihr hier zu You tube , ab 5:22:40 gehts mit unserem Beitrag CDS Tipps & Tricks für Fiori Elements Entwicklung

Unsere Empfehlung SAP Fiori Elememts das Handbuch klicken sie hier: SAP Fiori Elements das Praxishandbuch

SAP Fiori Elements - Das Praxishandbuch