Starting Point
Let us assume you - as an SAP customer – are accessing our own Fiori Launchpad where you open a list reporting app displaying all parties that are relevant for your business activities.
However, in your business context you may require some further details that were not foreseen by the application’s UI delivered by SAP. For example, you would like to display the role (supplier, customer, partner, and so on) or the contact details for each organization displayed in the list. In other words: You would like to provide additional fields in the given business application context that is represented by the UI actually used.
Let us also assume you have identified the development object (data definition) that implements the original data model for Party Address Data - as shown in the listing below.
@AbapCatalog.sqlViewName: 'SQL_PARTY_ORIG' @AbapCatalog.compiler.compareFilter: true @AccessControl.authorizationCheck: #NOT_REQUIRED @EndUserText.label: 'Party Address Data' @Search.searchable: true @OData.publish: true define view DEMO_PARTY_ORIG as select from SEPM_I_Party_E as Organization { @UI.lineItem: { importance: #HIGH, label: 'Org ID', position: 10 } key Organization.Party as OrgID, @Search.defaultSearchElement: true @UI.lineItem: { importance: #HIGH, label: 'Organization', position: 20 } Organization.PartyName as OrgName, @UI.selectionField.position: 10 @Search.defaultSearchElement: true @Search.fuzzinessThreshold: 0.5 @UI.lineItem: { label: 'Location', position: 30 } Organization.CityName as City }
The original source code defines quite a simple data model based on the CDS view called DEMO_PARTY_ORIG. This view is implemented by means of a query for performing a SELECT statement, where the predefined CDS view (that originates from the EPM demo application) SEPM_I_Party_E is used as the data source. The select list includes a rather small set of fields for the ID, name, and location of the parties. In addition to the original CDS view, the SQL view (database view) SQL_PARTY_ORIG has also been created in the ABAP Dictionary.
To create a data definition for extending a CDS view, proceed as follows:
If you have not yet already done so, open the newly created data definition and specify the names of the...