0% found this document useful (0 votes)
22 views3 pages

Sales Order Header and Item CDS Views

The document defines two CDS views for sales orders: 'ZCSALESHDR1' for the sales order header and 'ZCSALESITM1' for the sales order items. Both views are designed for consumption with capabilities for creating, updating, and deleting records, and include various fields such as document date, description, order type, and item details. Associations between the header and item views are established to facilitate data retrieval and management.

Uploaded by

Deb Dutta
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views3 pages

Sales Order Header and Item CDS Views

The document defines two CDS views for sales orders: 'ZCSALESHDR1' for the sales order header and 'ZCSALESITM1' for the sales order items. Both views are designed for consumption with capabilities for creating, updating, and deleting records, and include various fields such as document date, description, order type, and item details. Associations between the header and item views are established to facilitate data retrieval and management.

Uploaded by

Deb Dutta
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Final Consumption Views code

Sales Order Header CDS View

@[Link]: 'ZCSALESHDR1'
@[Link]: true
@[Link]: true
@[Link]: #CHECK
@[Link]: 'Header consumption view'

@[Link]: #CONSUMPTION
@[Link]: true
@[Link]: true
@[Link]: true
@[Link]: true
@[Link]: true

define view zc_sales_hdr1 as select from zi_saleshdrtp


association [1..*] to zc_sales_itm1 as _salesitm on $projection.sd_key =
_salesitm.parentkey
{

@[Link]: true
key sd_key,
@[Link]: 10
@[Link]: 'Document Date'
@[Link]
doc_date,

@[Link]: 20
@[Link]
@[Link]: 'Desription'
name,

@[Link]: 30
@[Link]
@[Link]: 'Document Category'
catg,

@[Link]: 40
@[Link]: 'Order Type'
@[Link]
order_type,

@[Link]: 50
@[Link]: 'Order Reason'
@[Link]
order_reason,

@[Link]: 60
@[Link]: 'Total Amount'
@[Link]
net_value,

@[Link]: 70
@[Link]: 'Currency'
@[Link]:true
currency,

@[Link]: [#TO_COMPOSITION_CHILD]
_salesitm
}
Sales Order item CDS View
@[Link]: 'ZCSALESITM1'
@[Link]: true
@[Link]: true
@[Link]: #CHECK
@[Link]: 'Sales Orders'

@[Link]: #CONSUMPTION
@[Link]: true
@[Link]: true
@[Link]: true
@[Link]: true

define view zc_sales_itm1 as select from zi_salesitemtp


association [1..1] to zc_sales_hdr1 as _saleshdr on $[Link] =
_saleshdr.sd_key
{
@[Link]: true
key itm_key,

@[Link]: true
parentkey,

@[Link]: 10
@[Link]: 'Material Number'
@[Link]
mat_num,

@[Link]: 20
@[Link]: 'Material Group'
@[Link]
mat_grp,

@[Link]: 30
@[Link]: 'Item Type'
@[Link]
itm_type,

@[Link]: 40
@[Link]: 'Amount'
@[Link]
@[Link]: 'currency'
item_value,

@[Link]: 50
@[Link]: 'Currency'
@[Link]
currency,

@[Link]: [#TO_COMPOSITION_ROOT,#TO_COMPOSITION_PARENT]
_saleshdr

You might also like