Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
ondrakfi
Advisor
Advisor

There exist multiple alternatives for enhancing CDS Views for Analytical applications, including those such as Cost Centers - Actuals, Cost Centers - Plan/Actuals, amongst others.

As each of our inquiries consistently functions in coordination with either I_JournalEntryItemCube or I_ActualPlanJournalEntryItemCube, these cubes necessitate extension to efficiently integrate with your specific fields within the aforementioned applications.

CDS Query (object)CDS Query (2C+SQL View)CDS Query WebDynpro ConfigurationApp ID
C_CostCenterQ2001CFICOSTCTRQ2001FIS_FPM_OVP_IPACTCCF0963
C_CostCenterPlanActQ2001CFICCPLANACT2001FIS_FPM_OVP_IPPLANACTCC01W0081
C_ProfitCenterQ2701CFIPROFCTRQ2701FIS_FPM_OVP_IPACTPCF0959
C_ProfitCenterPlanActQ2701CFIPCPLANACT2701FIS_FPM_OVP_IPPLANACTPC01W0079
C_MarketSegmentQ2501CFIMARKSEGMQ2501FIS_FPM_OVP_IPACTMSF0960
C_MarketSegmentPlanActQ2501CFIMSPLANACT2501FIS_FPM_OVP_IPPLANACTMS01W0078
C_ProfitAndLossQ2901CFIPROFLOSSQ2901FIS_FPM_OVP_IPACTPLF0958
C_ProfitAndLossPlanActQ2903CFIPLPLANACTFIS_FPM_OVP_IPPLANACTPL03F1710
C_FunctionalAreasQ2801CFIFAQ2801FIS_FPM_OVP_IPACTFAF1583A
C_FunctionalAreaPlanActQ2801CFIFAPLANACT2801FIS_FPM_OVP_IPPLANACTFA01W0077
C_InternalOrderPlanActQ2101CFIIOPLANACT2101FIS_FPM_OVP_IPPLANACTIO01W0076
C_SalesOrderQ2301CFISALESORDQ2301FIS_FPM_OVP_IPACTSOF1582A
C_ProjectQ2201CFIPROJECTQ2201FIS_FPM_OVP_IPACTPR F0961
C_ProjectPlanActQ2201CFIPRPLANACT2201FIS_FPM_OVP_IPPLANACTPR01W0080
  1. Custom Fields and Logic
    The first option is to use the Fiori App Custom Fields and Logic where you can create your field, which will be afterwards present in table ACDOCA/ACDOCP and the Query you select. For this, you will need to know Business Context. You can use FINS_JOURNAL_ENTRY_ITEM as a Business Context and then fill in the rest such as Label, Type, Length etc.
    Snímek obrazovky 2024-01-29 v 11.13.35.png

    Once the field is generated, you can enable it for CDS Views and select only those, where you would require this field for reporting.

    Snímek obrazovky 2024-01-29 v 11.18.25.png

    All you need to do now is to Publish the changes and the field is available in our reporting apps.

    In case you change your mind in the future, or you need to extend some other query, you can use the tab Data Source Extension in the app, select the query you want to extend, name the CDS VIew and then you can select any fields already present in I_JournalEntryItemCube or I_ActualPlanJournalEntryItemCube. The same applies when the field is present in the Cube, but not in the query itself as the query contains only some basic characteristics, but not all of them.
    Snímek obrazovky 2024-01-29 v 12.30.26.png

  2. Extend the already created field in ACDOCA/ACDOCP

    The Fiori App Custom Fields and Logic cannot offer you an extension based on fields, which are already present in the ACDOCA/ACDOCP table. 
    You will first need to enable your custom fields which start on ZZ_ or YY_ with transaction SCFD_EUI(see SAP Note 2672370).
    This will create a connection to the Custom Fields and Logic App. You might see different Business Contexts as it is taken directly from the created field. You do not need to worry as Accounting: Market Segment can be used as well. The most important is if you are then able to select I_ActualPlanJournalEntryItemCube or I_JournalEntryItemCube from the list to enable usage.
    Once the process is done, the field will be visible in Custom Fields and Logic under Custom Fields, where you can select it modify the usage and continue with the first step.


  3. Using a field delivered by SAP, but not available in any CDS View Cube

    There are fields in tables ACDOCA/ACDOCP which are not available in the CDS Cubes I_JournalEntryItemCube, I_ActualPlanJournalEntryItemCube. For this purpose, you need to follow these steps:

    1. A CDS view that selects all of your required fields from your database table. Data Source Extension does not support the selection of fields in database tables, only CDS views can be selected as source.
    2. This CDS view must be registered and released in transaction SCFD_REGISTRY. This is required to ensure that system upgrades do not break the extension (lifecycle stability)

For more information see another SAP Blog:
https://community.sap.com/t5/enterprise-resource-planning-blogs-by-sap/adding-field-in-standard-fior...


4. Extension of Import Financial Plan Data 

You want to use the Fiori App: Import Financial Plan Data with your custom fields, but this is not possible as the field is not present in C_GenericPlanQ3001. Once you do an extension for this CDS View, you will be able to import data for your custom field.

 

5. Extension of API A_CostCenter

You may come across an extension of API CDS View for SAP Analytical Cloud or any other purpose. The process is the same.

This can be extended in two ways.

The first way is to use the Fiori App: Custom Fields and Logic. In this app, you will create a completely new field, which will be added to the CSKS table (Master Data Cost Center) as well as in CDS View E_COSTCENTER, A_COSTCENTER and others, depending on what you choose.

The second option is to choose a field, which is already in the CSKS table and can be either your new custom-made or some other which cannot be seen within the API.

Extension in this case works the same way as with Custom Fields and Logic, except for the fact you need to create the code on your own. First, you need to extend the E_COSTCENTER of your new field and activate it. This will enable this field for I_COSTCENTER which is Master Data view on the table CSKS.

As a second step, you need to extend the A_COSTCENTER, which is the API for the Master Data. This will add the selected field to the Service API_COSTCENTER and enable it for reporting.

The code for the CDS Extension will look like this:

 

 

 

@AbapCatalog.sqlViewAppendName: 'Z_TEST'
extend view E_CostCenter with ZFO_EXTENSIOM
{
Persistence. verak as verak
}
@AbapCatalog.sqlViewAppendName: 'Z_TEST_A' 
extend view A_CostCenter with ZFO_EXTENSION_A
{
_Extension.verak as Z_VERAK
}

 

 

 

Due to the different syntax in both CDS Views, you need to use:

  •  Persistence for the E_COSTCENTER (This needs to be extend first)
  • _Extension for the A_COSTCENTER

Snímek obrazovky 2024-01-29 v 13.21.17.png

 

Please share your feedback or thoughts in the comment section.

Follow me for more tips about BW or BPC in general, so I can create more posts about these topics.

You can also follow BW Planning, post and answer questions (https://answers.sap.com/tags/369280904654660339247670897548678), and read other posts on the topic (https://blogs.sap.com/tags/369280904654660339247670897548678/) for more content.