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

Define View As Select From Association (.. ) To As On $projection. - (Key

The document defines two transactional views for sales orders and sales order items in an ABAP environment, including their associations and metadata. The views ZI_SALESORDERHEADERTP and ZI_SALESORDERITEMTP enable create, update, and delete operations while specifying their relationships. Additionally, basic views ZI_SalesOrderHeader and ZI_SalesOrderItem are defined for underlying data retrieval from the respective database tables.

Uploaded by

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

Define View As Select From Association (.. ) To As On $projection. - (Key

The document defines two transactional views for sales orders and sales order items in an ABAP environment, including their associations and metadata. The views ZI_SALESORDERHEADERTP and ZI_SALESORDERITEMTP enable create, update, and delete operations while specifying their relationships. Additionally, basic views ZI_SalesOrderHeader and ZI_SalesOrderItem are defined for underlying data retrieval from the respective database tables.

Uploaded by

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

ZSNWD_DB_SO - SNWD_SO

ZSNWD_DB_SO_I - SNWD_SO_I

@[Link]: 'ZI_KATP'
@[Link]: true
@[Link]: #NOT_REQUIRED
@[Link]: 'EPM: Sales Order Header (transaktional)'

@[Link]: #TRANSACTIONAL

@[Link]: #BUSINESS_OBJECT
@[Link]: true
@[Link]: true
@[Link]: 'ZSNWD_SO'
@[Link]: ['SalesOrderID' ]
@[Link]: true
@[Link]: true
@[Link]: true

define view ZI_SALESORDERHEADERTP


as select from ZI_SalesOrderHeader
/* Publizierung der Assoziation */
association [0..*] to ZI_SALESORDERITEMTP as _Item
on $[Link] = _Item.SalesOrderKey
{
key SalesOrderHeaderKey,
SalesOrderID,
BuyerKey,
LifecycleStatus,
BillingStatus,
DeliveryStatus,
OverallStatus,
/* Definition der Kompositionsbeziehung zum Kind */
@[Link]: #TO_COMPOSITION_CHILD
_Item
}

@[Link]: 'ZI_KAPTP'
@[Link]: true
@[Link]: #NOT_REQUIRED
@[Link]: 'EPM: Sales Order Item (transaktional)'

@[Link]: #TRANSACTIONAL

@[Link]: #BUSINESS_OBJECT

@[Link]: true
@[Link]: 'ZSNWD_SO_I'
@[Link]: ['SalesOrderKey', 'SalesOrderItemPosition' ]
@[Link]: true
@[Link]: true
@[Link]: true
define view ZI_SALESORDERITEMTP
as select from ZI_SalesOrderItem
/* Publizierung der Assoziation */
association [1..1] to ZI_SALESORDERHEADERTP as _Header
on $[Link] = _Header.SalesOrderHeaderKey
{
key SalesOrderItemKey,
SalesOrderKey,
SalesOrderItemPosition,
ProductKey,
Currency,
GrossAmount,
NetAmount,
TaxAmount,
/* Definition der Kompositionsbeziehung zur Wurzelentität.
Die Beziehung zeigt zum Vaterknoten, der gleichzeitig der
Wurzelknoten ist. Daher werden beide Typen gleichzeitig vergeben */
@[Link]: [ #TO_COMPOSITION_PARENT,
#TO_COMPOSITION_ROOT ]
_Header
}

/* Definition des SQL-View-Names */


@[Link]: 'ZI_SOH'

@[Link]: #NOT_ALLOWED
/* Definition des Labels des CDS-Views */
@[Link]: 'EPM: Sales Order Header'
/* Definition des VDM-View-Typs als Basic */
@[Link]: #BASIC
define view ZI_SalesOrderHeader
as select from snwd_so
{
/* Mapping der einzelnen Feldnamen entsprechend Datenbank-View */
key node_key as SalesOrderHeaderKey,
so_id as SalesOrderID,
buyer_guid as BuyerKey,
lifecycle_status as LifecycleStatus,
billing_status as BillingStatus,
delivery_status as DeliveryStatus,
overall_status as OverallStatus,
@[Link]: true
currency_code as CurrencyCode,
@[Link]: 'CurrencyCode'
gross_amount as GrossAmount,
@[Link]: 'CurrencyCode'
net_amount as NetAmount,
changed_at as ChangedAt,
changed_by as ChangedBy,
created_at as CreatedAt,
created_by as CreatedBy
}
@[Link]: 'ZI_SOI'
@[Link]: 'EPM: Sales Order Item'
@[Link]: #BASIC
define view ZI_SalesOrderItem
as select from snwd_so_i
{
key node_key as SalesOrderItemKey,
parent_key as SalesOrderKey,
so_item_pos as SalesOrderItemPosition,
product_guid as ProductKey,
@[Link]: true
currency_code as Currency,
@[Link]: 'Currency'
gross_amount as GrossAmount,
@[Link]: 'Currency'
net_amount as NetAmount,
@[Link]: 'Currency'
tax_amount as TaxAmount,
item_atp_status as AtpStatus
//,
//changed_at as ChangedAt,
//changed_by as ChangedBy,
//created_at as CreatedAt,
//created_by as CreatedBy
}
//S.161 Listing 3.2 Basic CDS View für Kundenauftragspositionen

You might also like