Show TOC

Data Model Without Metadata Locate this document in the navigation structure

Starting Point

Let us assume you have already created a DDL source as a development object and implemented it as simple data model for EPM sales order items - as shown in the listing below.

		
	@AbapCatalog.sqlViewName: 'ZSQL_SOIL_ADV'
	@AbapCatalog.compiler.compareFilter: true
	@AccessControl.authorizationCheck: #CHECK
	@EndUserText.label: 'Advanced List Reporting Sales Order Items'
				
	@OData.publish: true
				
	define view ZDEMO_SALES_ORDER_ITEM_ADV 		  as 
	select from sepm_cds_sales_order_item   		 as Item {
	key Item.sales_order.sales_order_id 			as SalesOrderID,
	key Item.so_item_pos                			as ItemPosition, 
	Item.sales_order.lifecycle_status 			  as LifecycleStatus,
	Item.sales_order.customer.company_name 		  as CustomerName,
	Item.product.category 					    as ProductCategory,
	Item.currency_code    					    as CurrencyCode, 
	Item.gross_amount     					    as GrossAmount, 
	Item.net_amount       					    as NetAmount 
	}
				
			

The source code above defines quite a simple CDS view called ZDEMO_SALES_ORDER_ITEM_ADV. This view is implemented by means of a query for performing a SELECT statement, where the predefined CDS view SEPM_CDS_SALES_ORDER_ITEM (that originates from the EPM demo application) is used as the data source. The select list includes a set of fields that are relevant for the new sales order item consumption view. The KEY elements in the selection list are used to define the key field semantic of the CDS view.

When the DDL source is activated, the following objects are created in ABAP Dictionary:

  • The actual entity of the CDS view ZDEMO_SALES_ORDER_ITEM_ADV
  • An SQL view ZSQL_SOIL_ADV.