SAP BW/4HANA学习笔记1

1.Master Data BW/4HANA

BW/4HANA简介

BW/4HANA的前身是SAP BW(Business Warehouse),本质是一种数据仓库解决方案。

数据仓库解决方案:

1.云端仓库;

2.SAP HANA for SQL,偏个人SQL定制;

3.SAP BW/4HANA;

 

BW/4HANA的三层结构。

 

SAP BW/4HANA,SAP S/4HANA提供报表工具,单一般不使用embedded Analytics。

数据仓库:获取整合管理数据,提供复杂模型获取数据,提供模型视图给分析应用以及报表使用。

SAP HANA赋能BW/4HANA

 

过去,数据大多存储在硬盘,只有运行中数据才读入内存,和硬盘交互的过程耗费大量时间。

现在,内存可以读入更多数据。

SAP HANA是什么?

 

SAP HANA是in-memory数据库。可以决定多少数据存储在内存,多少数据存储在硬盘。SAP HANA不仅数据存储,提供直接数据处理,省略了在应用中处理数据后重新写入数据的时间。

 

SAP HANA提供一般row store table 和column store。column store方式会自动压缩更加节约存储空间。

 

SAP HANA不仅是一个数据仓库产品,更像是一个平台。

可以开发应用服务;

可以提供数据分析处理模型;

可以提供数据整合,ETL;

可以提供数据管理工具,in-memory存储;

BW/4HANA Tools

 

1.BW Modeling Tool(BWMT);

2.SAP BW/4HANA Cockpit;

3.Data Warehousing Workbench;

 

SAP BW/4HANA管理页面,管理监控process chain,

 

InfoObject

DataSource

DTP(data transfer process)

Data Flow Model

SAP BW/4HANA Hierarchies

 

InfoObject

SAP BW/4HANA Content里InfoObject以0开头。

名称要求:不能以数字,特殊字符开头,3-9个字符;

 

Characteristics:维度字段

示例InfoObject: Cost center (0COSTCENTER)、Material (0MATERIAL)

Time Characteristics InfoObjects:时间类型的维度字段

示例InfoObject: Calendar day (0CALDAY)天、Calendar year (0CALYEAR)年 or fiscal year (0FISCYEAR)财年

Key figures:度量字段

示例InfoObject: Quantity (0QUANTITY)、Amount (0AMOUNT)

 

InfoObjects作为BW/4HANA的最小单位。

 

How to Create a InfoObject?

 

1.General页签,定义InfoObject描述、数据类型、长度(最大250)、输出长度;

 

2.Master Data Text页签,设置InfoObject对应长度文本描述;

 

3.Attributes页签,设置Attributes,是否Display Attributes/Navigation Attributes。Navigation Attributes可以用来筛选栏位。

 

4.InfoObject生成对应数据表;

 

5.High Cardinality设置。当数据记录超过2billion,勾选High Cardinality;

仅支持长度小于10的CHAR,NUMC类型。

 

6.SAP HANA View,是否生成外部HANA View。生成的HANA View可以作为访问BW/4HANA数据对象的接口。

SAP Analysis for Microsoft Office;

SAP BusinessObjectsWeb Intelligence;

SAP BusinessObjects Explorer;

SAP Lumira;

BI Clients from third-partyproviders;

都可以访问HANA Calculation View。

Tcode: RS2HANA_ADMIN,管理生成的HANA Calculation View。

 

7.Hierarchies for InfoObjects

 

可以根据时间创建不同Hierarchy;

不能使用其他characteristic,创建characteristic层级结构;

一个characteristic可以有多个层级结构;

如果characteristic有层级结构characteristic最大为32个字符;

 

8.Deletion and Change of Master Data

删除修改已经执行获取到的主数据。

 

 

要删除主数据,主数据必须没有被使用。没有作为attribute被infoobject使用。没有使用hierarchy。

 

How to Create Key Figure?

 

当创建金额类型key figure时,需要指定currency,可以是固定值RMB或者0CURRENCY;

当创建数量类型key figure时,需要指定unit,可以是固定值KG或者0UNIT;

 

Aggregation:指定聚合方式。

non-cumulative:是否非累计字段。

 

ADSO

A Standard DataStore Object:可以存储清洗后统一的数据。

Data Mart DataStore Objects:存储一段时间汇总聚合数据。

 

A DataStore Object (advanced) consists of three core tables which are generated in the background when the ADSO is created and activated.

Inbound table: /BIC/A<ADSO technicalname>1;

Table of active data: /BIC/A <ADSO technicalname>2;

Change log (not used for Data Mart DataStore Objects): /BIC/A<ADSOtechnical name>3;

 

Data Mart Data Store Object:初始化数据进入inbound Table,激活后数据写入Active Data Table,清空Inbound Table。

 

创建Standard DataStore Object

 

各种DataStore Object Modeling区别?

Standard DataStore Object:

    Write Change Log:是否写入log;

    Snapshot Support:可以将快照保存记录写入log;

    Unique Data Records:记录唯一;

 

Staging DataStore Object:

Inbound Queue:所有Inbound数据需要request;

Compress Data:压缩数据,您将只看到已激活的数据。节省内存空间

为了提高加载性能,从不使用更改日志;

Reporting-Enabled:数据保存在active table和inbound table,查询时只访问active table数据;

 

 

Direct Update DataStore Object:

    直接通过API或数据写入数据。只支持全量更新。

 

Data Mart DataStore Object:

    数据总是加载到inbound table和根据request有选择写入active table。报表访问inbound table和active table合并后数据。

 

InfoProvider

InfoProvider提供给Query使用。InfoProvider可以使用持久数据,也可以是其他InfoProvider虚拟数据。

 

CompositeProvider

    多个InfoProvider聚合。本身并不包含数据。

    CompositeProvider可以包含一下BW Objects:InfoObjects;DataStore Objects (advanced);CompositeProviders;Open ODS Views。

 

为何要创建CompositeProvider?

1.提供给BW Query接口;

2.虚拟数据集市层;

 

多个数据源union联合返回数据。

 

CompositeProviders特性。

 

 

Union join,Inner Join。

Open ODS Views

Open ODS Views支持定义虚拟模型,访问SAP HANA Database tables,views和BW/4HANA DataSources。Open ODS Views不存储数据。

 

1.Consume external data without staging;

2.Combine external data with SAP BW/4HANA models;

3.Physical integration of external data (staging);

 

The Open ODS view is integrated into the TLOGO framework and can be transported;

当使用table,view作为Open ODS view的Source,table,view在传输Open ODS时必须在目标系统存在。当使用SAP HANA smart data access,table,view链接必须可用。

 

定义Open ODS View Field权限动作。

Direct Usage of Associated Object by Name;

Usage of System-Wide Unique Name;

还可自定义Associated Object,选择Usage of System-Wide Unique Name。

 

Open ODS views Source:

DataSources in SAP BW/4HANA;

DataStore objects (advanced);

database tables or views of the SAP BW/4HANA or SAP HANA database;

databases connected to SAP BW/4HANA using SAP HANA smart data access;

创建Data Source By Open ODS view.

 

 

A DataSource, Transformation, and DataStore Object (advanced) can be

generated from an Open ODS view using the Generate DataFlow option of the Open ODS view。

 

DataSource

DataSource是SAP BW用于从源中提取和暂存数据的对象系统。根据应用场景将不同数据源提取部分数据,加载数据到SAP BW/4HANA。

 

可以从SAP Source加载数据或非SAP Source加载数据。

1.Operational Data Provisioning (ODP)

ODP接受数据渠道:RFC, Web Service (SOAP via HTTP or HTTPS);

ODP提供接口支持增量更新;

 

 

Source System Type:

SAP HANA Local Database Schema;

SAP HANA Smart Data Access;

 

Load File as DataSource:

 

1. In the Context menu of DataSources, choose New→Source System;

2. Optional: Under General Properties, specify the business content type and release。

3. Save and activate the source system。

4. Go to the Project Explorer view in the Data Sources tree in the folder Context menu for the source system type, and choose Refresh.

 

 

 

 

 The Delta Queue Monitor(transactionODQMON)

监控数据订阅请求变化。

Queues:所有订阅请求;

Subscriptions:订阅详细信息;

Requests:请求详细信息;

Units:可联合传输请求单位;

 

创建DataSources,对应数据库Table,使用InfoSet,使用FunctionModules;

 

Transformation and DTP

DataFlow

 

1.创建DataSource;

2. RODPS_OS,发布DataSource;

3.复制DataSource到SAP BW/4HANA;

4.激活DataSource;

5.插入Characteristic作为InfoProvider;

6.创建Transformation,定义DataSource到字段Characteristic关系;

7.创建Data Transfer Process(DTP),从ODQ Delta Queue读取数据;

 

定义Transformation。

Transformation:Source to SAP BW4/HANA.

A transformation converts the fields of the source into the format of the target.

 

Transformation,清洗,聚合数据的逻辑主要在Start Routine,Transformation Rule,End Routine。Expert Routine逻辑完全自己实现。

 

示例:

METHOD GLOBAL_END.
     FIELD-SYMBOLS:
       <RESULT_FIELDS>    TYPE _ty_s_TG_1.
  DATA: MONITOR_REC     TYPE rstmonitor.
* Note the _M class are not considered for DTP execution.
* ABAP Breakpoints must be set in the generated program instead* ABAP Breakpoints within an ABAP End-Routine must be set
* in the _A class if the transformation runtime is set to SAP HANA!**** begin of routine - insert your code only below this line       ****
... "insert your code here
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    "ABAPmodel,输入SOURCE_PACKAGE,输出RESULT_PACKAGE
    delete RESULT_PACKAGE where bukrs = 'BW00'.

    "hana model,必须先删除abap runtime routine,再切换hana runtime routine
    "输入Intab,输出ouTab
    "temp_tab = select * from :inTab where bukrs <> 'BW00'.
    "outTab = select * from :temp_tab.**** end of routine - insert your code only before this line        ****
ENDMETHOD.

选择DataStore Object,右键->New->Transformation。其中ABAP Runtime,Routines中代码为ABAP代码。如果选择HANA Runtime,Routines中代码为HANA Script代码。

 

Rules页签,可以单独定义Source Field到Target Field的Rule。

 

Navigation attributes of the source of the transformation are not available in the expert routine.

Start Routine参数:

Importing

REQUEST: Request ID.

DATAPAKID: Number of current data package.

Exporting

MONITOR: Table for user-defined monitoring. This table is filled by means of row structure MONITOR_REC (the record number of the processed record is inserted automatically from the framework).

Changing

SOURCE_PACKAGE: Structure that contains the inbound fields of the routine.

Raising

CX_RSROUT_ABORT: If a raise exception type CX RSROUT_ABORT is triggered in the routine, the system terminates the entire load process. The request is highlighted in the extraction monitor as having been terminated. The system stops processing the current data package. This is useful for serious errors.

 

End Routine参数:

Importing

REQUEST: Request ID.

DATAPAKID: Number of current data package.

Exporting

MONITOR: Table for user-defined monitoring. This table is filled using row structure MONITOR_REC(the record number of the processed record is inserted automatically

from the framework).

Changing

RESULT_PACKAGE: Contains all data that has been processed by the transformation.

Raising

CX_RSROUT_ABORT: If a raise exception type

CX_RSROUT_ABORT is triggered in the routine, the system terminates the entire loading process. The request is highlighted in the extraction monitor as Terminated. The system stops processing the current data package. This can be useful if serious errors occur.

 

Rule Group:

 

 

DTP

DTP定义数据传输方式。

 

InfoSources are used to break up transformations into several layers so that multiple sources and targets are easy to integrate into the dataflow;

 

Graphical Data Flow Modeling

图形数据流建模。

 

创建步骤:

1.菜单New->Data Flow;

2.设置Data Flow名称,最长30个字符;

3.将持久对象和非持久对象拖动到Data Flow工作区;

4.创建各个对象连接关系;

5.检查数据一致性,当存在非持久对象时,会有警告,但是可以保存;

6.保存激活Data Flow;

Integration of SAP HANA Models with SAP BW/4HANA

管理SAP HANA平台

1.SAP HANA Studio,使用插件(SAP BW Modeling Tools, BWMT);

2.SAP HANA Web-Based Development Workbench;

3.SAP Web IDE for SAP HANA;

 

具有两个视图:Development view和Database Explorer view。

 

 

1.创建Project;

2.创建Development Module;

右键HDB Module,可以看到module下可以创建的:

Procedure

Function

Calculation View

Flowgraph

Analytic Privilege

CDS Artifact

Text Analysis dictionaries and rule sets

 

Overview of Data Provisioning in SAP HANA

 

EIM:更加高效加强、清洗、传输数据。

A simplified landscape。one environment in which to provision and consume data;

Access to more data formats, including an open framework for new data sources;

In-memory performance, which means increased speed and decreased latency;

 

SAP HANA主要两个方面:

1.Enterprise Information Management;

Smart data integration,实时高效数据批量移动。SAP EIM提供内部适配器和SDK。

包含一下工具:

1.Replication Editor in the SAP HANA Web-based DevelopmentWorkbench;

2. Smart data integration transformations;

3. Data provisioning agent;

4. Data provisioning adapters for connectivity to remote sources;

5. Adapter SDK to create custom adapters;

6. SAP HANA Cockpit;

2.Smart data quality;

实时、高速数据清理、地址清理和地理位置清理,丰富空间数据。

SAP HANA smart data access,让SAP HANA可以创建虚拟表访问远程数据,不需要数据复制存储到SAP HANA。

SAP HANA smart data streaming,处理传入数据流,实时收集事件数据,对传入数据收集整理。

SAP Replication Server,实时传输同步数据;

SAP Data Services,提供给数据管理角色管理数据工具;

 

SAP HANA直接数据导入;

 

定义数据栏位映射;

 

Introduction to SAP HANA Native Modeling

 

 

创建Calculation View。

Dimension type calculation views cannot contain measures, they can only contain attributes;

 

Modeling Cubes,The next type of calculation view is the type Cube;

 

Modeling Star Schemas,Now we come to the most powerful of all the calculation views: the Cube type, but with an additional setting –star join;

 

 

 

SAP HANA1.0 ->SAP HANA2.0

 

However, you should be aware that the BW-generated calculation views are based on XS Classic and not XSA/HDI.

 

Calculation View可以转换CompositeProviders or InfoObjects;

 

使用Tcode: SPRO;

 

Combine BW/4HANA InfoProvider with SAP HANA Model

 

InfoProvider获取SAP HANA VIEW数据

练习:

1.The recommended interface for SAP HANA Modeling and database administration is SAP Web IDE for SAP HANA. 

2.You should combine SAP BW/4HANA models with native SAP HANA models to access the best features of both modeling environments.

3.It is possible to integrate SAP HANA XSA / HDI Calculation Views into SAP BW/4HANA.

4.Attribute Views and Analytic Views are obsolete types of native HANA views and should not be developed any longer. Calculation Views are the only type of native HANA view that you should develop.

5.The SAP HANA Modeler Perspective allows you to create calculation views and view database tables.

 6.Smart data access does not support the extraction, cleansing, and loading of data from remote source to SAP HANA. Smart data access is used to connect to remote data sources for virtual access only and no data is stored in SAP HANA.

7.You create a CompositeProvider to combine calculation views with InfoProviders.

Operate SAP BW/4HANA

Manage DataStore Objects

 

 

 

 

In a Data Mart DataStore Object, you can delete requests only if they are not activated.

Process Chains

Process Chains后台创建的一系列处理事件。

 

 

 

Process Chain类型。

 

创建Process Chain。

 

Process种类。

 

Monitoring of Periodic Process Chains (Transaction RSPCM)

Log view for runs of a process chain in process chain maintenance (transaction RSPC)

process chain maintenance for a given process chain (transaction RSPC1)

BW Monitor in the Computing Center Management System(CCMS)

Process Chain API: RSPC_API_CHAIN_START

 

 

 

SAP HANA Delta Merge in SAP BW/4HANA

 

列存储使用压缩方式存储,对压缩数据进行写操作需要重新组织结构,Update,insert耗费很高。SAP将主存储数据才用列存储读优化,增量存储器写优化,无需排序。将增量存储器修改数据写入主存储数据这个操作就是SAP HANA Delta Merge。

 

 

 

练习:

For a Data Mart DataStore Object,, you can only delete requests if they have notalready been activated;

A process variant is a specific configuration of an individual job step in aprocess chain;

If you do not run an SAP HANA Delta Merge then the read performance of InfoProviders decreases and storage requirements increase;

 

posted @ 2023-02-17 21:28  渔歌晚唱  阅读(951)  评论(0编辑  收藏  举报