Wednesday, 8 July 2020

Step-by-step Financial Statement Version Reporting with Currency Type Characteristic on S/4 Hana + Embedded BW

Motivation


During analysis of a business process for reporting, some of the required developments for the need and how to develop them are crystal clear. We tend to think of the required development elements on-the-fly/instinctively while analyzing the process. Almost in a visual way, but sometimes, even after working in BI environment for 10 years, I find myself asking simple how-to-do questions and searching for a relevant blog article to answer the question.

I decided to write this article in order to help those who will have a similar requirement and to motivate myself for researching a subject in depth.

Scenario/Requirement


In my case, a complex calculated/restricted key figure structure was needed. All the measures needed to be filtered by financial statement version hierarchy nodes (GL Account hierarchy based on an FSV created on Tx OB58) and users needed to analyze the report in different 3 currency types.

Enhancing “S/4HANA Financials: Actual Data from ACDOCA – /ERP/SFIN_V01” with required fields and creating restricted key figures (RKF) for each currency types wasn’t a good option because it would increase the required time for development and maintenance. Plus, users should hide/unhide relevant measures to change the currency type.

Before We Start


◉ Developments shown in this article are based on S/4HANA 1809 and embedded BW 7.52 system.

◉ Creating a Calculation View (or a CDS view) is a good way to create data structures but in order to reduce the development time for the report creation, a Hana query (or a Bex query) on top of CalcView/CDS view will be used.

◉ Users who doesn’t need currency type characteristic could also use SAP delivered CDS C_TRIALBALANCEQ0001 report for reporting financial statement reporting with SAP hierarchies. In this case, we only need to replicate the required hierarchy in the system.

◉ In my case, I needed to include only transactional data tables to my hana model because when we create a virtual provider with /ERP/* characteristics, attributes and texts are getting populated automatically by related hana view

◉ In SAP S/4HANA, we can have 8 user defined currencies and two fixed currencies (Local and Global). In this example I’ll be using only company code currency, global currency and transaction currency.

Steps


1- Check which financial reporting version you’ll be using.

Go to Tx OB58 and double click on the FSV statement.

BW SAP HANA Data Warehousing, BW SAP HANA Modeling Tools (Eclipse), SAP HANA Exam Prep, SAP HANA Learning

Check the hierarchy.

BW SAP HANA Data Warehousing, BW SAP HANA Modeling Tools (Eclipse), SAP HANA Exam Prep, SAP HANA Learning

2- Replicate the hierarchy via “HRRP_REP- FIN Runtime Hierarchy Replicator”

Go to Tx HRRP_REP. Enter the Hierarchy ID you want to replicate and execute the replication.

BW SAP HANA Data Warehousing, BW SAP HANA Modeling Tools (Eclipse), SAP HANA Exam Prep, SAP HANA Learning

BW SAP HANA Data Warehousing, BW SAP HANA Modeling Tools (Eclipse), SAP HANA Exam Prep, SAP HANA Learning

3- Create table function

Note: SAP is deprecating SQL Script based Calculation Views. The recommended approach for modelling is using Table Function based Calculation Views but if you’re more comfortable with SQL script based calculation views, you can create an SQL based calculation view and migrate it using the save as function.

BW SAP HANA Data Warehousing, BW SAP HANA Modeling Tools (Eclipse), SAP HANA Exam Prep, SAP HANA Learning

Table function code:

BW SAP HANA Data Warehousing, BW SAP HANA Modeling Tools (Eclipse), SAP HANA Exam Prep, SAP HANA Learning

4- Create Calculation View

Go to Hana Modeler perspective and create a graphical calculation view.

BW SAP HANA Data Warehousing, BW SAP HANA Modeling Tools (Eclipse), SAP HANA Exam Prep, SAP HANA Learning

Note that the warning in the screenshot is caused by the fact that I already created a calculation view with the same name.

BW SAP HANA Data Warehousing, BW SAP HANA Modeling Tools (Eclipse), SAP HANA Exam Prep, SAP HANA Learning

Add the table function to the aggregation component.

BW SAP HANA Data Warehousing, BW SAP HANA Modeling Tools (Eclipse), SAP HANA Exam Prep, SAP HANA Learning

Add all the fields to the output.

BW SAP HANA Data Warehousing, BW SAP HANA Modeling Tools (Eclipse), SAP HANA Exam Prep, SAP HANA Learning

Create an input parameter

BW SAP HANA Data Warehousing, BW SAP HANA Modeling Tools (Eclipse), SAP HANA Exam Prep, SAP HANA Learning

Add list of values to the parameter (i.e. 00-Transaction Currency, 10-Global Currency, 30-Company Code Currency)

BW SAP HANA Data Warehousing, BW SAP HANA Modeling Tools (Eclipse), SAP HANA Exam Prep, SAP HANA Learning

Assign table function parameter to calculation view parameter using semantics details.

BW SAP HANA Data Warehousing, BW SAP HANA Modeling Tools (Eclipse), SAP HANA Exam Prep, SAP HANA Learning

4- Create the virtual infocube (or composite provider)

Create a characteristic for input parameter

BW SAP HANA Data Warehousing, BW SAP HANA Modeling Tools (Eclipse), SAP HANA Exam Prep, SAP HANA Learning

Create a virtual infocube based on the hana calculation view.

BW SAP HANA Data Warehousing, BW SAP HANA Modeling Tools (Eclipse), SAP HANA Exam Prep, SAP HANA Learning

Details

BW SAP HANA Data Warehousing, BW SAP HANA Modeling Tools (Eclipse), SAP HANA Exam Prep, SAP HANA Learning

Add all required infoobjects to the infocube.

BW SAP HANA Data Warehousing, BW SAP HANA Modeling Tools (Eclipse), SAP HANA Exam Prep, SAP HANA Learning

Assign all hana calculation view fields to infoobjects.

BW SAP HANA Data Warehousing, BW SAP HANA Modeling Tools (Eclipse), SAP HANA Exam Prep, SAP HANA Learning

BW SAP HANA Data Warehousing, BW SAP HANA Modeling Tools (Eclipse), SAP HANA Exam Prep, SAP HANA Learning

5- Create the report

BW SAP HANA Data Warehousing, BW SAP HANA Modeling Tools (Eclipse), SAP HANA Exam Prep, SAP HANA Learning

Create a variable for the currency type selection and add it to the report.

BW SAP HANA Data Warehousing, BW SAP HANA Modeling Tools (Eclipse), SAP HANA Exam Prep, SAP HANA Learning

Create a measure with hierarchy node filter.

BW SAP HANA Data Warehousing, BW SAP HANA Modeling Tools (Eclipse), SAP HANA Exam Prep, SAP HANA Learning

6- Validate the report running twice with different currency types.

Report output with “Currency type = 10-Company Code Currency” selection.

BW SAP HANA Data Warehousing, BW SAP HANA Modeling Tools (Eclipse), SAP HANA Exam Prep, SAP HANA Learning

Report output with “Currency type = 30- Global Currency” selection.

BW SAP HANA Data Warehousing, BW SAP HANA Modeling Tools (Eclipse), SAP HANA Exam Prep, SAP HANA Learning

No comments:

Post a Comment