Create CDS view
@AbapCatalog.sqlViewName: 'ZAMARMNFE1'
@EndUserText.label: 'ZAMARMN_FE1'
define view ZAMARMN_FE1 as select from SEPM_I_SalesOrder {
key SalesOrder,
_Customer.BusinessPartner as CustomerID,
_Customer.CompanyName as CustomerName,
GrossAmountInTransacCurrency as GrossAmount
}
Add annotations
@OData.publish:true : auto exposures the CDS view as OData Service
@UI.headerInfo.typeNamePlural : determines text displayed for the list report
@UI.lineItem is used to set default columns for the list report. The mandatory property is position, which determines the sequence of columns. The label for each field comes from field label of data element for a field.
@UI.lineItem.label is used to assign a label if field label of data element is not available.
@semantics.currencyCode/@semantics.unitofMeasure to annotate for currency/unit field.
@semantics.amount.currencyCode/@semantics.quantity.unitofMeasure to annotate amount/quantity field and tell them which field has the information of currencyCode/ unitofMeasure
@UI.lineItem.importance to determine in which clients the field should display:
#HIGH: default value, display in all clients
#MEDIUM: Only display in desktop browser or tablet
#LOW: Only display in browser
@UI.hidden to hide fields that need not be exposed to end user
@AbapCatalog.sqlViewName: 'ZAMARMNFE1'
@UI.headerInfo: {
typeName: 'Sales Order',
typeNamePlural: 'Sales Orders',
title: {
value: 'SalesOrderID'
}
}
@EndUserText.label: 'ZAMARMN_FE1'
@OData.publish: true
define view ZAMARMN_FE1
as select from SEPM_I_SalesOrder
{
@UI.lineItem: [{position: 10 }]
key SalesOrder as SalesOrderID,
@UI.lineItem: [{position: 20 }]
_Customer.BusinessPartner as CustomerID,
@UI.lineItem: [{position: 30 }]
_Customer.CompanyName as CustomerName,
@UI.lineItem: [{position: 40, importance: #MEDIUM }]
@UI.hidden: true
GrossAmountInTransacCurrency as GrossAmount,
@UI.lineItem: [{position: 50, label: 'Tax Amount', importance: #LOW }]
@Semantics.amount.currencyCode: 'Currency'
GrossAmountInTransacCurrency - NetAmountInTransactionCurrency as TaxAmount,
@Semantics.currencyCode: true
TransactionCurrency as Currency
}