Extending CDS Queries with CO-PA (WW) Fields

SAP Blog

Kayıtlı Üye
Katılım
22 Ara 2017
Mesajlar
1,925
Tepki puanı
7
Puanları
6
Business Background: Extensibility for CO-PA (WW) Fields


The operating concern can be extended with custom characteristics created in KEA5. These fields are also generated in journal entries in the ACDOCA table.

However, for some analytical applications which are based on CDS queries, CO-PA (WW) fields can’t be added to the CDS-based cubes and queries via S/4HANA key user extensibility nor via classic coding block extensibility (see Note 2453614).

Therefore, you need to manually add CO-PA (WW) fields to such queries. This applies to the queries included in Note 2535903 and to other queries based on I_GLAccountLineItemCube, I_GLAccountLineItemSemTag, I_JournalEntryItemCube and I_ActualPlanJrnlEntryItemCube.

The query and the underlying CDS views need to be extended with the custom field so that the field is available in the respective Fiori analytical app.

How to Extend Underlying Views with CO-PA (WW) Fields


In order for the custom field to be displayed in the Fiori analytical app, the underlying views need to be extended. In the following example (extension for Journal Entry Analyzer) the following views need to be extended:

ext_views.png


The underlying views can be identified by looking at the consumption view in ABAP Development Tools for Eclipse.

  1. Create a package in transaction SE21.
  2. Open ABAP Development Tools for Eclipse and add the package to your favorites. In the following, names that can be freely defined are marked in green and views/fields that need to be assigned are marked in red.
  3. Choose File > Create > ABAP Repository Object > Core Data Services > Data Definition and create an extension for E_JournalEntryItem (the extension view of the virtual data model).• Use the Extend View template.
    • Add the name of the append view and the view to be extended.
    • Insert the WW fields you want to add to the report (in this case the WW field WWCLR). Use the Persistence alias as in E_JournalEntryItem to address the field of the underlying table ACDOCA.
    pers1.png
  4. Create an extension for I_GLAccountLineItemCube (the CDS view for the analytics cube).• Use the Extend View template.
    • Add the name of the append view and the view to be extended.
    • Insert the WW fields that you want to add to the cube. Use the _Extension alias that is used for E_JournalEntryItem in I_GLAccountLineItemCube to address these fields.
    pers2.png
  5. Create an extension for C_GLLineItemsQ0001 (the CDS view for the analytics query).• Use the Extend View template.
    • Add the name of the append view and the view to be extended.
    • Insert the WW fields that you want to add to the query. Use the I_GLAccountLineItemCube alias that is used for the cube in C_GLLineItemsQ0001 to address these fields.
    pers3.png

Note: Don’t create such extensions for “private” CDS views. Only E_JournalEntryItem, released public views that have an association to E_JournalEntryItem (such as I_GLAccountLineItemCube), and views on top of these views (such as C_GLLineItemsQ0001) may be extended. The view stack below I_GLAccountLineItemCube, for example, might be changed in an incompatible way by SAP in a future release, which could damage the extension and lead to activation errors in the upgrade.

Result: CO-PA field in Fiori analytical app


The CO-PA (WW) field WWCLR (Colors) is shown in the Fiori analytical app Journal Entry Analyzer as an available field:

avaail_fields.png


The CO-PA (WW) field can be included in the report as an additional characteristic:

WW_app.png


Okumaya devam et...
 
Üst