6

Guide:Create SAP S/4HANA External GL Account Hiera... - SAP Community

 7 months ago
source link: https://community.sap.com/t5/technology-blogs-by-sap/guide-create-sap-s-4hana-external-gl-account-hierarchy-within-sap/ba-p/13574648
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

2024-01-11_15-25-41.gif

image028-1.png

Introduction

Recently, Analytical models within SAP Datasphere started supporting the External Hierarchy Directory feature. To assist SAP Datasphere users with this feature, we are starting with this new blog series. 

Further, in the current and upcoming blogs, we will be explore this feature with the help of community content delivered packages, present @ GITHUB, within context of SAP S/4HANA External Hierarchies like GL Account, Cost Center etc. in SAP Datasphere.
In current blog, I am going to use the GL Account replication flow package from the community content. This package contains the GL Account entities as shown within the the red rectangle in Fig 1.

Screenshot-2024-01-12-150301.png

Fig 1 :GL Account Entities Logical Diagram

Once we import this package, these entities will get created within the SAP Datasphere and , thereafter, they can be linked with facts and subsequently consumed via Analytic Models.

On a high level, below steps will be shown in this blog.

  • Download and Import Package – This will create the data entities related to GL Account Master Data Dimension along with Texts and External Directory Hierarchy in SAP Datasphere, as shown in Fig 1.
  • Replication Flow – This is required to replicate data into the underlying Local tables of the Hierarchy objects, imported in the previous step, via ABAP CDS views from SAP S/4HANA.
  • Create/Adapt Fact – Create or reuse transactional data objects(Facts) for GL Account Line-Item data and then associate it with the GL Account Master Data Dimension from previous step.
  • Create/Adapt Analytic Model – Create or reuse Analytic Model on top of Fact created/adapted in the previous step.
  • Analytic Model Preview – Last step, use Analytic Model preview to view the External GL Account Hierarchy.

Please note that community content package can only be imported to default SAP_COMMUNITY space. This may or may not fit your Datasphere landscape architecture.
Please refer to blog - Walkthrough of different Enterprise Scenarios via Community Content package – GL Account External Hi... which build upon current blog knowledge and further explains how community content package can be used for different enterprise scenarios.

Prerequisites

First and foremost, please ensure that the target space - SAP_COMMUNITY, is already present/created within your SAP Datasphere tenant because, as mentioned previously, we can only import the community content package into this space. Also, please make sure you have the relevant Scoped roles assigned to you on this space for working on these imported objects.

If you are working with community content for the first time then please make yourself familiar with it by checking the  help.sap documentation, mainly section - 'How to download and install community content in general'.

Also, check if you have proper configurations in place in SAP Datasphere, as mentioned in Downloading and Uploading Local Files with the Content Network | SAP Help Portal.

Further, please note that only DW Administrator or DW Space Administrator can import the packages within SAP Datasphere tenant as mentioned in - https://help.sap.com/docs/SAP_DATASPHERE/be5967d099974c69b77f4549425ca4c0/b607a12931d74c4a93506ea64c...

Last but not least always refer to README file in the GITHUB for specific installation instructions before proceeding with the package installation.

Step 1: Import Package

image003.png

1.1 First step, download the Community Content package - GL Account External Hierarchy with replication Flow from GITHUB URL.

Screenshot-2024-01-12-142008.jpg

Fig 1.1: GITHUB GL Account package

1.2 Once the file is downloaded, go to the Transport->Import and click on the Upload icon, as shown below.

image005.png

Fig 1.2: Community Package - Start Import Process

1.3 Next, select the downloaded package and choose Open.

Screenshot-2024-01-12-153654.png

Fig 1.3: Select the package

1.4 Once the package is uploaded, refresh the screen and search for your package.

Screenshot-2024-01-12-142905.png

Fig 1.4: Check Uploaded Package

1.5 To start the import of the package, click on the package name and then select the 'Import options' and Click on Import button, as shown below .

Screenshot-2024-01-12-143154.png

Fig 1.5: Select Import options and Start Import

1.6 Once import is done, refresh the screen to get the Success message.Further, you can click on Success to view the Import Summary.

image013.png

Fig 1.6: Import Success message

1.7 After the import, please check if below objects are available within the SAP_COMMUNITY space.

image017-1.png

Fig 1.7: Imported Objects

1.8 Finally, deploy all the objects by selecting the checkbox icon on the left and then clicking on Deploy icon.

Screenshot-2024-01-12-145448.png

Fig 1.8 Deploy objects

Therefore, by the end of this step, for each Numerical value,1-5, mentioned in the Fig 1.9, a corresponding data object gets created in space SAP_COMMUNITY matching with the Numerical value mentioned in the column 'Numerical Value' in Table 1.

Screenshot-2024-01-13-150814.png

Fig 1.9: GL Account Entity Logical Diagram

Numerical Value

Purpose

Technical Name

Business Name

Semantic

GL Account Hierarchy Directory
SAP_CC_FI_HRF_GLAccountHierDir
HRF: G/L Account Hierarchy Directory (DIM)
Dimension
GL Account Hierarchy Directory Text
SAP_CC_FI_HRF_IL_T_GLAccountHierDir
HRF: G/L Account Hierarchy Directory - Text (IL)
GL Account Hierarchy Directory Node
SAP_CC_FI_HRF_GLAccountHierNode
HRF: G/L Account Group (Hierarchy Node) (DIM)
Dimension
GL Account Hierarchy Directory Node Text
SAP_CC_FI_HRF_IL_T_GLAccountHierNode
HRF: G/L Account Group (Hierarchy Node) - Text (IL)
GL Account Master Data External Hierarchy
SAP_CC_FI_HRF_GLAccountHierarchyView
HRF: G/L Account Hierarchy (Hierarchy with Directory)
Hierarchy with directory
GL Account Master Data Text
SAP_CC_FI_H_IL_T_GLAccount
HRF: G/L Account - Text (IL)
GL Account Master Data Dimension
SAP_CC_FI_HRF_GLAccount
HRF: G/L Account (DIM)
Dimension

Table 1: GL Account Logical Diagram and Community package objects Relationship

Please note that Table 1 doesn’t list all the intermediate or wrapper views which are imported as well from the package.

Step 2: Replication Flow

image020.png

As external hierarchies are data-driven, therefore, to feed the imported Local tables from the community content package below mentioned ABAP CDS views will be used in the replication flow.

Source CDS View

Imported Local Table

Purpose

I_GLACCOUNTHIERARCHY
SAP_CC_FI_HRF_IL_I_GLACCOUNTHIERARCHY
Local Table for GL Account Hierarchy View
I_GLACCOUNTHIERARCHYTEXT
SAP_CC_FI_HRF_IL_I_GLACCOUNTHIERARCHYTEXT
Local Table for GL Account Hierarchy Text
I_GLACCOUNTHIERARCHYNODE
SAP_CC_FI_HRF_IL_I_GLACCOUNTHIERARCHYNODE
Local Table for GL Account Hierarchy Node
I_GLACCOUNTHIERARCHYNODET
SAP_CC_FI_HRF_IL_I_GLACCOUNTHIERARCHYNODET
Local Table for GL Account Hierarchy Node Text
I_GLACCOUNTINCHARTOFACCOUNTS
SAP_CC_FI_HRF_IL_I_GLACCOUNTINCHARTOFACCOUNTS
Local Table for GL Account Master data Attributes
I_GLACCOUNTTEXTRAWDATA
SAP_CC_FI_HRF_IL_I_GLACCOUNTTEXTRAWDATA
Local Table for GL Account Master data Text

Table 2: Replication Flow ABAP CDS View mapping

Please note that before creating a replication flow, an active SAP S/4HANA connection is needed for this scenario.

2.1 Go to SAP_COMMUNITY within Data Builder and choose 'New Replication flow'.

image022-1.png

Fig 2.1: Create New Replication Flow

2.2 Next, Select 'Browse Source Connection' and choose desired SAP S/4HANA connection in your landscape.

image024-1.png

image026-1.png

Fig 2.2 Add Source Connection

2.3 Then, click on 'Select Container' and choose 'CDS_Extraction', as shown below.image028-3.png

image030-1.png

Fig 2.3: Select container

2.4 After this, click on 'Add Source Objects' button in the Canvas, as shown below.

image032-1.png

Fig 2.4: Add Source objects

2.5 In the pop up window, search for the term I_GLACCOUNT to get the list of CDS views related to GL Account, choose the one mentioned in the Table 2 column 'Source CDS View' at the beginning of this section, and click on Next.

image034-1.png

Fig 2.5 Choose CDS Objects

2.6 Next, click on 'Add selection', as shown below.

image036-2.png

Fig 2.6: Add Selected CDS objects

2.7 Then, add the target repository, as shown below:

image038-1.png

Fig 2.7 Choose Target Repository

2.8 For target, please choose 'SAP Datasphere Local repository', as shown below.

image040-1.png

Fig 2.8: Add Datasphere as target repository

2.9 Next, click on ellipsis icon next to each target object and select 'Map to Existing Target object'.

image042-1.png

image044-2.png

Fig 2.9: Map to Existing Target local Table

2.10 Then, choose the corresponding local tables which are imported via community content as per Table 2 columns 'Source CDS View' and 'Imported Local Table', mentioned at the beginning of this step.

image046-1.png

Fig 2.10: Choose Imported Local Tables

Here, I am not using any filters, projections and doing the initial/full load to replicate the data within GL Account community package local tables because none of these ABAP CDS views support Change Data Capture.

2.11 Next, deploy the replication flow.

image048-1.png

Fig 2.11: Deploy RF

2.12 Once deployed, trigger the replication flow by clicking on Run icon, as shown below.

image050-1.png

Fig 2.12: Run RF

2.13 Next, wait for the status to change to Completed. Further, to get detail logs, please open Replication Flow monitor, as shown below.

image052.png

Fig 2.13: RF Status

2.14 As a quick validation step, please check the Initial Load operations in Metrics to check the no of rows added to each view.

image054.png

Fig 2.14: RF Monitor

Step 3: Fact

image024.png

3.1 Next, please replicate the GL Account line-item data(Fact) using replication flow. For replication flow, please follow the same steps as shown in Step 2 and this time use ABAP CDS VIEW, I_GLACCOUNTLINEITEMRAWDATA.

image058.png

Fig 3.1: GL Account line Item RF

In my scenario, I am only loading data for FY 2022 but feel free to change or alter it as per your requirement.

3.2 After that, please build a view with semantic as Fact on top of the local table.

image028.png
Screenshot-2024-01-13-154100.png

Fig 3.2: Create GL Account fact

3.3 Once Fact view is there, please associate it with the GL Account Master Data Dimension - HRF: G/L Account (DIM) (SAP_CC_FI_HRF_GLAccount), as shown below:

image030.png

Fig 3.3: Associate fact with GL Account Master data

At the end of this step, you should have built the GL Account Fact source and associated it with the GL Account Master Data dimension view - HRF: G/L Account (DIM) (SAP_CC_FI_HRF_GLAccount).

Step 4: Analytical Model

image032.png

4.1 As the final step,please create an analytical model on the Fact Source created in the previous step by clicking on 'Create Analytic Model' option in the Fact View.

image066.png

Fig 4.1: Create Analytic Model

4.2 Once the Analytic model is created, then please select the required dimensions, attributes and measures from the Fact Source. Please don't forget to add the GL Account Master data dimension as it will be used for showing the Hierarchy feature later.

image068.png

Fig 4.2: Analytic model

4.3 Further in my Analytic model, I have also created the Reference Date variable as well which will be used to identify the valid time intervals for the time-dependent feature within hierarchies like valid hierarchies and their description, valid hierarchy nodes and their descriptions etc. within the Datasphere.

image034.png

Fig 4.3 Ref Date Variable AM

Please note in the absence of this variable, for time-dependent related features current date is used as default.

4.4 Finally, deploy the Analytic Model.

Step 5: Analytic Model Preview

image036.png

5.1 Next, to view the GL Account External Hierarchy, please switch to Analytic Model preview and  enter the relevant input Key Date to get the relevant time-dependent Hierarchy data in the preview.

image038.png

Fig 5.1 Analytic Model Preview

5.2 After entering the relevant Input Date, please drag the GL Account into the Rows/Columns.

image044.png

Fig 5.2 Drag GL Account To Rows/Columns

5.3 Then, right click and choose Hierarchy->Select Hierarchy.

image040.png

Fig 5.3 Select GL Account Hierarchy

5.4 Next, from the opened dialog box, please select the relevant hierarchy.

image042.png

Fig 5.4 Choose Hierarchy

Please note that here the hierarchy list and its descriptions will be different in your system and they are loaded based on the valid time intervals on the input reference date variable. Further, for the descriptions/texts, default language setting in the Datasphere user account is used.

5.5 Once the hierarchy is selected, preview screen gets refresh to show the selected hierarchy, as shown below.

image044-1.png

Fig 5.5 GL Account Hierarchy Output

Conclusion

image046.png

In this blog, I have shown a quick approach on How to use the community content GL Account Replication Flow package for consuming the GL Account External Hierarchy from S/4HANA within SAP Datasphere.

Further, I have shown how it can be linked to the GL Account transaction data and consumed for further analysis within Analytic Model for analytical scenarios within SAP Datasphere.

Also, you can now refer to next blog - Walkthrough of different Enterprise Scenarios via Community Content package – GL Account External Hi... which build upon current blog knowledge and further explains how community content package can be used for different enterprise scenarios.

Thanks for reading! I hope you find this blog helpful. For any questions or feedback just leave a comment.

Best wishes,
Jai Gupta

image028-2.png

Find more information and related blog posts on the topic page for SAP Datasphere .


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK