Guide:Create SAP S/4HANA External GL Account Hierarchy within SAP Datasphere through Community Content packages
2024-1-15 23:32:44 Author: blogs.sap.com(查看原文) 阅读量:33 收藏

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.In the blog series, we will be using the community content delivered packages, present @ GITHUB, for creating SAP S/4HANA External Hierarchies like GL Account, Cost Center in SAP Datasphere.

For the first blog in this journey, I am going to use the GL Account replication flow package from the community content. This package contains GL Account objects within the the red rectangle as shown in the Fig 1.

Fig 1 :GL Account Entities Logical Diagram

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

On 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, and for this a new blog will be published explaining how to make use community content package for different enterprise scenarios.

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/b607a12931d74c4a93506ea64c55ab4e.html.

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

Fig%201.1%20Current%20Step

1.1 First step, download the community content package for GL Account for Replication flow  from GITHUB URL.

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.

Fig%201.2%20Community%20Package%20import

Fig 1.2: Community Package – Start Import Process

1.3 Next, select the downloaded package and choose Open.

Fig 1.3: Select the package

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

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 .

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.

Fig%201.6%20%3A%20Import%20Finish

Fig 1.6: Import Success message

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

Fig%201.7%3A

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.

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.

Fig 1.9: GL Account Entity Logical Diagram

Numerical Value

Purpose

Technical Name

Business Name

Semantic

1
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)
Text
2
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)
Text
3
GL Account Master Data External Hierarchy
SAP_CC_FI_HRF_GLAccountHierarchyView
HRF: G/L Account Hierarchy (Hierarchy with Directory)
Hierarchy with directory
4
GL Account Master Data Text
SAP_CC_FI_H_IL_T_GLAccount
HRF: G/L Account – Text (IL)
Text
5
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.

Fig%202.1

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‘.

Fig%202.1%3A%20Create%20New%20Replication%20Flow

Fig 2.1: Create New Replication Flow

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

Fig%202.2%20Add%20Source%20Connection

Fig 2.2 Add Source Connection

2.3 Then, click on ‘Select Container’ and choose ‘CDS_Extraction’, as shown below.

   Fig%202.3%3A%20Select%20container

Fig 2.3: Select container

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

Fig%202.4%3A%20Add%20Source%20objects

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.

Fig%202.5%20Choose%20CDS%20Objects

Fig 2.5 Choose CDS Objects

2.6 Next, click on ‘Add selection’, as shown below.

Fig%202.6%3A%20Add%20Selected%20CDS%20objects

Fig 2.6: Add Selected CDS objects

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

Fig%202.7%20Choose%20Target%20Repository

Fig 2.7 Choose Target Repository

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

Fig%202.8%3A%20Add%20Datasphere%20as%20target%20repository

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’.

Fig%202.9%3A%20Map%20to%20Existing%20Target%20local%20Table

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.

Fig%202.10%3A%20Choose%20Imported%20Local%20Tables

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.

Fig%202.11%3A%20Deploy%20RF

Fig 2.11: Deploy RF

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

Fig%202.12%3A%20Run%20RF

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.

Fig%202.13%3A%20RF%20Status

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.

Fig%202.15%3A%20RF%20Monitor

Fig 2.14: RF Monitor

Fig%203.1%20High%20Level%20Steps%20Overview

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.

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.Fig%203.3%20Create%20GL%20Account%20fact

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:

Fig%203.4%20Associate%20fact%20with%20GL%20Account%20Master%20data

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).

Fig%204.1%20High%20level%20Overview

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.

Fig%204.1%3A%20Create%20Analytic%20Model

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.

Fig%204.2%3A%20Analytic%20model

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.

Fig%204.4%20Ref%20Date%20Variable%20AM

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.

Fig%205.1%20High%20Level%20Steps%20Overview

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.

Fig%205.2%20Analytic%20Model%20Preview

Fig 5.1 Analytic Model Preview

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

Fig%205.3%20Choose%20GL%20Account%20External%20Hierarchy

Fig 5.2 Drag GL Account To Rows/Columns

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

Fig%205.4%20Select%20GL%20Account%20Hierarchy

Fig 5.3 Select GL Account Hierarchy

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

Fig%205.5%20Choose%20Hierarchy

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.

Fig%205.6%20GL%20Account%20Hierarchy%20Output

Fig 5.5 GL Account Hierarchy Output

• For the root node, the Parent Node value must be NULL. Otherwise, you might experience an error, during the data preview of the Analytical Model. In BW, the parent node value was 00000 instead of NULL for the node type R (root node). And the system was searching for the parent node 00000 which is not available. In this a formula or a transformation should be applied accordingly.

• If the data is not replicated, and if it’s getting fetched from remote system, please expect a delayed response. To have better performance of the Analytical Models, please replicate the data in local tables.

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, as mentioned in beginning for enterprise scenarios, where you may want to use you different space or spaces instead of SAP_COMMUNITY, a new blog will be published sooner.

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

Best wishes,

Jai Gupta

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


文章来源: https://blogs.sap.com/2024/01/15/guidecreate-sap-s-4hana-external-gl-account-hierarchy-within-sap-datasphere-through-community-content-packages/
如有侵权请联系:admin#unsafe.sh