on 11-29-2023 10:24 AM
With the old SAPI Datasources we can enhance them using custom appends and exit/badi code or for LO datasources we can choose additional pool fields via the LBWE Logistics cockpit etc..
How do we enhance the newer CDS based Datasources? Take for example C_PurchaseOrderItemDEX. Is it just a case of creating your own CDS Extension? Or Extensions since the underlying CDS view I_PurchaseOrderItemAPI01 might also need an extension to supply selected additional fields?
Like many CDS views, I_PurchaseOrderItemAPI01 has an Extension association included in it. Should this inbuilt Extension Association be used?
If so, do we following the steps in the below blog, which deals with extending COPA CDS query views (approach recommended in note 3005736)?
https://blogs.sap.com/2018/01/11/extending-cds-queries-with-co-pa-ww-fields/
This would mean creating an Extend view on E_PurchasingDocumentItem, one on I_PurchaseOrderItemAPI01 and finally one on C_PurchaseOrderItemDEX?
Is there a best practice approach for enhancing these SAP Standard CDS based DataSources?
Hello Steven,
yes, best way is to use this already available extension. Here one of my examples:
In SD we included new Subtotal Amounts into VBRP and so we created one Extend view for the standard view:
C_BillingDocItemBasicDEX_1
See:
@AbapCatalog.sqlViewAppendName: 'YSDEBILLITMD'
@EndUserText.label: 'Extend E_BillingDocumentItem VBRP Subtotals'
extend view C_BillingDocItemBasicDEX_1 with YSD_INV_E_SDBILLITEMDEX1 {
_ExtensionItem.Subtotal7Amount,
_ExtensionItem.Subtotal8Amount,
_ExtensionItem.Subtotal9Amount,
_ExtensionItem.Subtotal10Amount
In that way you create your own in Y- or Z-namespace and can extend the regular C_ one.
This works because the standard view has alreay an extension:
define view C_BillingDocItemBasicDEX_1
as select from I_BillingDocExtdItemBasic as BillingDocumentItemBasic
//Extension
association [0..1] to E_BillingDocumentItem as _ExtensionItem
I hope this helps.
BR, Martin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Martin, I'll give that a try.
But where does the field re-naming take place? YYKZWI07 becomes Subtotal7Amount somewhere. Isn't there an extend view for E_BillingDocumentItem that does this? Something like this?
extend view E_BillingDocumentItem with ZE_BillingDocumentItem {
Persistence.yykzwi07 as Subtotal7Amount,
Persistence.yykzwi08 as Subtotal8Amount,
Persistence.yykzwi09 as Subtotal9Amount
Persistence.yykzwi10 as Subtotal10Amount
}
Hello Steven,
I did another check ... it is already 6 months ago 🙂
You are right... there is one more:
@AbapCatalog.sqlViewAppendName: 'YBIEVBRPZSUM'
@EndUserText.label: 'Erweiterung View E_BillingDocumentItem'
extend view E_BillingDocumentItem with YBI_CDS_E_VBRP_ZWISUM {
yykzwi07 as Subtotal7Amount,
yykzwi08 as Subtotal8Amount,
yykzwi09 as Subtotal9Amount,
yykzwi10 as Subtotal10Amount}
User | Count |
---|---|
68 | |
8 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.