Sie sind auf Seite 1von 22

SAP S/4HANA & Power BI

Karthik Narayanan Venkatesh

Sydney Power BI User Group (19-Feb-2020)


Agenda

SAP Backend Architecture

Power BI connectivity options

Issues encountered and solutions

Key points to remember


Disclaimer
Q&A
All content in this talk and presentation is the author’s personal
opinions and intended as knowledge share with intended audience.
SAP Architecture & Evolution

R/2 R/3 S/4

Mainframe Era Client Server Era Current

● Two tier ● Three tier ● Two Tier


● Thin Client ● Thin Client ● Browser Client
● Integrated ● Independent ● Application and
Application and Application and Database layers
Database layer Database layer merged
● Heavy Backend. ● Database - HANA
● Database & only
Platform agnostic ● Platform - Linux
only
SAP Architecture - BI & Data Analytics

Legacy S/4HANA
Non-SAP Non-SAP
PowerBI/Tableau/Spot PowerBI/Tableau/Spot
fire fire

Connectors Connectors
- Native (BICS) Connectors - Native (BICS)
- OLAP - OLAP - OLAP Connectors
- OLAP
- Calculation Engine

Data
Warehouse
Layer
Core Data
Services

ERP CRM Non-SAP


Power BI Connection Options

● Three standard out of the box


Power BI connectors available
● Ability to connect with
○ Database Layer
○ Application Layer
● Connection method influences
○ Different processing
engines invoked during
runtime
○ SQL or MDX support
○ Limitations such as data
size, speed etc
● Apart from standard options,
OData connectivity is possible
Power BI Connection Options - Landscape Based

● SAP Business Warehouse Application Server


01 SAP BW on Any Database
● SAP Business Warehouse Message Server

● SAP Business Warehouse Application Server


02 SAP BW on HANA (BW4HANA)
● SAP HANA Database

● SAP Business Warehouse Application Server


03 S/4HANA ●

SAP HANA Database
OData
Data Models - Consumption

Staged Virtual Data Models


Physical Data Loaded via ETL Process
Data Views defined based on HANA Core Data
● Cubes (Aggregated)
Services
● Data Store Objects (Operational)
● Database User Interface
● Dimension, Cube
Business Explorer Queries act as consumption
● Web UI based semantic layer modeling
interface

Connection Data Views defined based on ABAP Core Data


● SAP BW Application Server Services
● Dimension, Fact, Cube, Query
● Script based view definitions

Connection
● SAP BW Application Server - ABAP CDS
● SAP HANA Database - HANA CDS
Power BI Connection Options - Connection Types Details

SAP BW Application Server


SAP BW Message Server
● Calculation Engine - HANA CDS Views
● Internally uses resources as utilized by Application
● OLAP Engine - BW Queries & ABAP CDS Views
Server connection
● Operational Data Provisioning Engine -ABAP CDS
● Only load balancer for connections originating from
Views
different systems

OData
SAP HANA Database
● RFC Based
● Calculation Engine - HANA CDS Views
○ Wrapper application to handle ODATA calls
● Operational Data Provisioning Engine - ABAP CDS
● Annotation based
Views
○ Direct exposure of a view as service
Connector Preview - Application Layer (Cubes & Queries)
Connector Preview - Database Layer (HANA CDS - Flat Structure)
Approach

Connection
● Use SAP BW Application Layer Connection Type
○ Call BEx Queries created by embedded BW system
○ Call ABAP CDS View directly
■ Query
■ Cube

● Imported the data and avoided “DirectQuery” method in Power BI


○ Inherent restrictions of direct query method e.g. cannot join with other tables

● Parameterize for performance and overcome size limitations


○ Parameters can be defined on View or Query

● Object level security delegated to SAP


Limitations

● Cell limits imposed by analytical engine


○ 500K - 1M
● Advance filtering like TOP N or Hierarchy Node(s)
○ Not yet supported
● Restricted aggregation functions in CDS, few unsupported functions are
○ Count Distinct
○ Average
● Parameter vs Variable
○ Variable filters after materializing the data
○ List of Values (LOV) support
Gaps

Hierarchy Objects
SAP S/4HANA
● Organizational objects are stored in Parent Child hierarchy
● Examples
○ Cost Center Hierarchy
○ Position Hierarchy
● Hierarchy is flattened at runtime for reporting
● Runtime error of any object with hierarchy association is used

Power BI
● Direct Parent Child hierarchy not supported
● DAX expressions needed to flatten for interactive visualizations (e.g. PATH)

Solution
● Create table expressions needed to flatten hierarchy
● Include custom table as a separate dimension in the query
● Restricted to only one version for each hierarchy object
Gaps

Navigation Attributes as Slicer


SAP S/4HANA
● A dimension table referring to another dimension table in snowflake type model
scenario
● Example
○ Sales Fact (M:1) Customer (M:1) Country
● Only the first level of join is exposed i.e Sales :: Customer
○ All fields (i.e. attributes) are treated as property except Key field
● Native connector identifies and segregates dimension tables

Solution
● Create a calculated column in Power BI referencing the property
● Use calculated column as slicer and thus enabling interactions

Caution
● Does not impact aggregation of measures. Use for interactivity only
Gaps

Navigation Attributes for Drill down and Rollup


SAP S/4HANA
● A dimension table referring to another dimension table in snowflake type model
scenario
● Example
○ Sales Fact (M:1) Customer (M:1) Country
● Only the first level of join is exposed i.e Sales :: Customer
○ All fields (i.e. attributes) are treated as property except Key field
○ Using the property does not automatically aggregate underlying measure
● Native connector identifies and segregates dimension tables automatically up-to
N levels

Solution
● Break data model to use simple star schema
○ Enhance data model to include all dimensions independently
● Use DAX CALCULATE & FILTER based on selection for runtime calculations

Caution
● Too many navigation attributes increases data model complexity
Gaps

Time dependent data Key From To Attribute

1 1/1/2018 31/12/2019 A
SAP S/4HANA
● Many business entity objects follow SCD-3 model in transactional ER design
1 1/1/2020 31/12/9999 AB
● Example
○ Cost Center Object 2 1/1/2018 31/12/9999 B
○ Valid From & Valid To dates are part of Key in table
○ Used to track business changes such as Owner, Business Unit,
Segment etc

Power BI
● Does not support theta joins directly
● Workarounds are cumbersome to be implemented

Solution
● Delegate to database via parameter for key date = current date

Caution
● Provides only latest snapshot.
● Same issues persist when attributes are used as navigational attributes
Gaps

Dual Calendar & xTD Time Slices


SAP S/4HANA
● Fiscal and Calendar Years for reporting based on analysis context
● Ideally both calendars must be in sync
● Practically it is not 100%
● Example
○ Backdated Entries
○ Period end closing and suspense accounting
● Creating combined DIM_DATE to have both years is not possible

Power BI
● Inbuilt calendar & Mark as Date Table follow Gregorian calendar
● Multiple calendars is not supported (also, it is against data modeling standards
for EDW)

Solution
● Create calculated column called FiscalDate of type Date
● FiscalDate derived based on period

Caution
● Not best practice, but got the job done :)
Gaps

Dual Calendar & xTD Time Slices


SAP S/4HANA
● Fiscal and Calendar Years for reporting based on analysis context
● Both calendars overlapping each other
○ Operational Calendar - Jan to Dec
○ Fiscal Calendar - Jul to Jun

Power BI
● DAX xTD function did not meet requirement for Fiscal Year based xTD time slices

Solution
● Create a custom query to compute as individual measures based on current date
○ Current Year
○ Prior Year
○ Inception to Date
● Easy to implement compared to DAX
Performance Considerations

● Keep the data small


DB Engine
○ Inherent restriction based on cells
○ Aggregate data
○ Parameterized queries
Analytic Engine
● Parameter vs Variable
○ Hard Filter @ DB Engine
○ Soft Filter @ Analytic Engine (Post Materialization Filter) Reporting Tools
● Multiple queries
● Caching
○ Query Results
○ Intermediate Results (Query View Materialization)
● Keep drillthrough options minimal. Summarize to entity level rather than
displaying individual transactions
● Beware of Join Traps in aggregation, especially in CDS views
○ Header & Line Item measures
○ Generic Data Models can become quite extensive is SAP
● Row Level Security
○ Checked for each query pre-fetch phase
Quick Recap

● S/4HANA is the evolutionary step from SAP


● Convergence - Many artefacts from legacy products are tightly integrated
into single system
● ABAP CDS Views is recommended data modeling layer
○ SAP recommends to switch all development to this method
○ Future investment and support
● Current connector from Power BI (SAP BW Application Server) does fulfil
majority of requirements
○ New connectors will not be developed/released
○ Ability to directly access data model (CDS Views) as well as Queries
● Think from Power BI perspective
○ Extensive use of DAX, Filters & Interactions
○ Delegate to backend whenever possible
Q&A

Connect with me

https://www.linkedin.com/in/karthiknarayananvenkatesh/