Skip to Content
Technical Articles
Author's profile photo Mayumi Lacerda Blak

Extending P&L Plan/Actual Fiori App with CO-PA fields

Introduction:

On my previous blog post, I explained the logic to map CDS views and its VDM’s and gave an example of how to extend a CDS based Fiori app (Journal Entry Analyzer) with CO-PA fields.

Now, I will show you another extension of a Virtual Data Model that uses Plan and Actual information and is the base for several analytical reports and KPI’s.

The example is on an SAP S/4Hana 1909 on premise edition, and extension in Eclipse.

More detailed steps to map the VDM, create DataDefinition on Eclipse, find Consumption view from Fiori App, you can see on my post:

https://blogs.sap.com/2020/06/09/extending-cds-view-with-copa-field-including-key-and-text/.

 

Extension of C_ProfitAndLossPlanActQ2903

 

The Fiori app “P&L – Plan/Actual” (CDS Based) uses the Consumption view C_ProfitAndLossPlanActQ2903.

 

Mapping the Virtual Data Model (you can map via app “Query views”), I found the following structure:

 

As I mentioned in my previous post, you need to extend the CDS views bottom-up.

So first, extend the Extension Views. The VDM has two Extension views, one for Actual and another for Plan.

E_JournalEntryItem (Actual line Item):

Note: Different to what I showed in my previous post, you do not need to make associations to get the field texts on the extension views, only in the Composite View.

E_FinancialPlanningEntryItem:

 

After activating the Extension views, you will be able to extend the Composite view.

With the Composite view, you can use tcode SCFD_REGISTRY to check the underlying views and ALIAS to use in the extensions. In tab “Extensible CDS Views”, filter the Composite view and double click to get the details:

In the tab “Support for Custom Fields”, you will find relevant information to be used on the extension, like the ALIAS, the Extension views, and in the bellow case, the condition fields to be used in the extension:

 

Extending the Composite view:

Previously, “TEXT” CDS views need to be created to associate the COPA fields with their text fields.

These “Text” views will be associated to the Composite View.

In the Composite view I_ActualPlanJrnlEntryItemCube, the field “ActualPlanCode” is used to differentiate Plan from Actual. So, a CASE statement needs to be used to extend the COPA fields.

This is how the Composite view will be extended:

We can create our own reports based on this Composite view. But we can also extend the consumption view of an existing App.

 

Extending the Consumption view C_ProfitAndLossPlanActQ2903:

 

You need to add the bellow annotations to display the field texts on the report:

Result: fields are available in Fiori Report “P&L Plan/Actual” with Key and Text:

 

Conclusion:

Account-based CO-PA (now called Margin Analysis), has a lot of new features, and with SAP S4/Hana, reports are a lot better than in ECC. Once you understand the logic behind the Fiori apps, you will be able to work with these reports and enhance them with your customers definitions more effectively.

In the next post I will show a creation of a KPI report.

Thanks!

Assigned Tags

      5 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Alexis SCHERPEREEL
      Alexis SCHERPEREEL

      Hello Mayumi,

      Thanks for your helpful explanation. As an experienced controlling consultant, Reporting on CO module in S/4 Hana is a particular topic on which we have actually to learn again how to answer customer needs. KE24/KE30, Report painter... are now technically far from what could provide today CDS views and Fiori. Your post gives the answer to keep providing powerfull reports to customers through latest S/4 innovation.

      Alexis

      Author's profile photo Mayumi Lacerda Blak
      Mayumi Lacerda Blak
      Blog Post Author

      Thanks Alexis!

      I will keep sharing my knowledge as much as possible.

      kind regards

      Mayumi

      Author's profile photo Gaurav Aggarwal
      Gaurav Aggarwal

      Hey Mayumi,

       

      Thanks for sharing the above helpful information. We also got the same requirements and implemented the same as you mentioned in the post.

      It will be great if can also share the Market Segment Actual/Plan CDS Extension blog.

      These and new S/4 HANA posts will help lot of CO consultants and developers to extend CDS views.

      Happy sharing !..

      Thanks Again

      Gary A

      Author's profile photo Mayumi Lacerda Blak
      Mayumi Lacerda Blak
      Blog Post Author

      Hello Garauv,

      for Market Segment Actual Plan, the CDS to be extended are:

       

      Consumption: C_MARKETSEGMENTPLANACTQ2501

      Composite: I_ActualPlanJrnlEntryItemCube

      Extension View: E_JournalEntryItem and E_FinancialPlanningEntryItem

      So the logic is the same as described in this post, except for the Consumption view. Extend first the Extension views, than the Composite, and finally the consumption view.

       

      Regarding the text views, for each COPA field you need to create 2 views to get the source table and text table.  These source tables and text tables are the KEA5 tables generated for each characteristic. Then you need to make the associations in all the CDS (Extension, Composite and Consumption), to make the key and text available in the app for each field. An example on how to create the text Views and make the associations are described in the blog post https://blogs.sap.com/2020/06/09/extending-cds-view-with-copa-field-including-key-and-text/

       

      Kind regards

      Mayumi

       

       

       

      Author's profile photo Daouda Pouye
      Daouda Pouye

      Hello Mayumi,
      I made a CDS View extension for the Fiori application "Journal Entry Analyser".
      I have extended the following Views to add a field:
      - C_GLLINEITEMSQ0001
      - I_GLACCOUNTLINEITEMCUBE
      In Development system, everything is going well.
      The transport Request is well transported in Test/Qual system and the field is present in the tables in Test/Qual system but I don't see the new field that I added in the Fiori application.
      I have cleared the cache via the /n/iwfnd/cache_cleanup and /n/iwbep/cache_cleanup transactions.
      Is there any manipulation to do to make the fields appear in the Fiori application in Test/Qual system?
      Thanks for your help