- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
SAP General Ledger - Extract General Ledger Accounting Data to Power BI with Python Scripts
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
The Power BI Connector for SAP (PCS) from DVW Analytics can be used to extract data directly from SAP into Power BI Reports and Dashboards.
Problem
You are a financial analyst/manager or a Power BI developer and have a requirement to produce or enhance a dashboard which requires SAP General Ledger Accounting data from the SAP Finance General Ledger Module of your SAP System. In particular you require data from the “Big Two” SAP Financial Accounting (FI) Transaction Data Tables: BKPF (Accounting Document Headers) and BSEG (Accounting Document Segments).
Currently you are either manually extracting data from these table saving the extracts to locally stored folder locations and then uploading the data to Power BI . Due to the volume of data you are also having to manually extract the data multiple times. This is an onerous, time consuming and repetitive task which is open to error. You also have a major issue of not being able to automate the refreshing of your Power BI Report and Dashboard.
You need a solution up and running quickly and do not have the time or resources to build a traditional database solution.
Solution
The DVW Power BI Connector for SAP (PCS) has a selection of tools that enable data to be extracted from various SAP sources including SAP Table, Transaction Codes, ABAP Reports, SAP BW Queries and Info providers and SAP Queries. The data can then be loaded into Power BI using Python Scripts generated by PCS. When the Power BI report is refreshed the data is automatically reloaded from SAP.
The following diagram provides an overview of the requirement.
From Power BI use a dynamic list of Fiscal Years and Company Codes to extract Finance Document Header information from BKPF. The list of document numbers extracted will be used to select and extract Financial Document Segment information from BSEG.
The next diagram illustrates the solution.
The DVW PCS the SAP Table Tool is used to create data sources to extract data from SAP Tables BKPF and BSEG. Python scripts will also be generate in DVW PCS which will be used in Power BI to facilitate the injection of filter values into the SAP data calls.
I've outlined below the steps taken in two parts. The first part details the configuration steps taken in the Power BI Connector for SAP (PCS) and the second part outlines the Power BI Desktop steps.
- Power BI
- DVW PCS for Power BI
- Access to an SAP ECC or SAP S/4HANA system
Part 1 :
PCS SAP Table Tool Configuration.
Open the DVW xCS Console
1. In the File Management Tab click Create
In the xCS Configuration Control -->Basic Tab
1. Select the relevant SAP System from the drop down and enter a valid SAP user name and password.
2. Select the SAP Table Data Read Tool from the drop down list.
3. Enter a file name BKPF. This will be used later in Power BI.
In the parameters tab:
4. Enter the Table Name.
5. Click on Search.
6. Select the required fields.
7. Click on Save.8. Repeat the above steps for the SAP table BSEG.
PCS Python Scripts - Dynamic Filter Input
Generate a Python script to a use a selection of dynamic filters to retrieve records from BKPF.
In the Scripts tab:
1. Select the BKPF Data Entity from the dropdown.
2. Select the Target Power BI.
3. Select the Dynamic Filter Input tab.
4. Check the Dynamic Filter Box.
5. Click on Refresh.
6. Click on Save and Copy.
This "BKPF python script" will be used in Power BI in Part 2.
PCS Python Scripts - Dynamic Table Input
Generate a Python script to a use a list of document numbers to retrieve records from BSEG.
In the Scripts tab:
1. Select the BSEG Data Entity from the dropdown.
2. Select the Target Power BI.
3. Select the Dynamic Table Input tab.
4. Check the Dynamic Table box.
5. Click on Refresh.
6. Click on Save and Copy.
This "BSEG python script" will be used in Power BI in Part 2.
Part 2:
In the Power BI Query Editor
Create Query "1 Filter Input Values"
Use the Enter Data to create a Table called "1 Filter Input Values" with the columns shown in the picture below.
Create Query 2 BKPF (Accounting Document Headers)
1. Create a New Blank Source Query with the source query "1 Filter Input Values"
2. From the Transform tab select Run Python script.
3. Paste in the BKPF Python script created in Part 1 above.
4. Expand the BKPF Table.
5. Rename the query to "2 BKPF (Accounting Document Headers)"
Create Query 3 BSEG (Accounting Document Segments)
1. Create a New Blank Source Query with the source query "2 BKPF (Accounting Document Headers)".
2. Remove all the columns except for CompanyCode, FiscalYear and AccountingDocumentNumber.
3. From the Transform tab select Run Python script.
4. Paste in the BSEG Python script created in Part 1 above.
5. Expand the BSEG Table.
6. Rename the query to "3 BSEG (Accounting Document Segments)"
The data is now available in Power BI and can be transformed further or can be combined with other data.
Once the transformations are complete select Close & Apply.
In Power BI
The sap data is now in available in Power BI and Reports and Dashboards can be built using it.
Power BI - Refresh data
When refreshing Power BI reports the data is freshly retrieved from SAP. The calls into SAP can be seen and monitored in the DVW xCS Console --> Monitor tab.
Recap
Using the DVW Power BI Connector for SAP I was able to create data sources to extract data from SAP Tables. Python script were generated in the DVW Power BI Connector which allow dynamic filters to be used to select data from the SAP Accounting Document header table (BKPF) and the extracted Accounting Document numbers were used to select and extract SAP Accounting Document Segment information (BSEG). Once the Power BI model and report was built I was able to refresh the Power BI report and the data was automatically reloaded from SAP.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
- How to Calculate Cumulative Sum in Power BI
- 🏆 Power BI DataViz World Championships | Week 3 F...
- Dynamic Subscriptions
- 🏆 Power BI DataViz World Championships | Week 3 W...
- 🏆 Power BI DataViz World Championships | Week 4 |...
- PBIP fx hack: dynamic expressions for properties -...
- How to add Gradient Text in Power BI dashboard
- 🏆 Power BI DataViz World Championships | Week 2 F...
- 🏆 Power BI DataViz World Championships | Week 2 W...
- How to Append Queries in Power BI
-
Dera__Igboejesi
on: 🏆 Power BI DataViz World Championships | Week 3 F...
- vasavks12 on: Dynamic Subscriptions
-
LucasKoch2900
on: 🏆 Power BI DataViz World Championships | Week 3 W...
-
slindsay on: 🏆 Power BI DataViz World Championships | Week 4 |...
-
mike_honey
on: PBIP fx hack: dynamic expressions for properties -...
- TBH on: How to add Gradient Text in Power BI dashboard
-
Jasmine_319
on: 🏆 Power BI DataViz World Championships | Week 2 F...
-
thefarside
on: 🏆 Power BI DataViz World Championships | Week 2 W...
-
thefarside
on: Basic Power BI accessibility is easier than you th...
-
edchuy
on: 🏆 Power BI DataViz World Championships | Week 3 C...
-
How to
654 -
Tips & Tricks
622 -
Events
127 -
Support insights
121 -
Opinion
80 -
DAX
66 -
Power BI
65 -
Power Query
62 -
Power BI Dev Camp
45 -
Power BI Desktop
40 -
Roundup
37 -
Power BI Embedded
20 -
Time Intelligence
19 -
Tips&Tricks
18 -
Featured User Group Leader
15 -
PowerBI REST API
12 -
Dataflow
9 -
Power BI Service
8 -
Power Query Tips & Tricks
8 -
finance
8 -
Data Protection
7 -
Direct Query
7 -
Auto ML
6 -
financial reporting
6 -
Data Analysis
6 -
Power Automate
6 -
Data Visualization
6 -
Python
6 -
Power BI REST API
6 -
powerbi
5 -
service
5 -
Power BI PowerShell
5 -
Machine Learning
5 -
Income Statement
5 -
Dax studio
5 -
Power BI Goals
4 -
PowerShell
4 -
Desktop
4 -
Bookmarks
4 -
Line chart
4 -
Group By
4 -
community
4 -
RLS
4 -
M language
4 -
Paginated Reports
4 -
External tool
4 -
calendar
3 -
Gateways
3 -
R
3 -
M Query
3 -
Webinar
3 -
CALCULATE
3 -
R visual
3 -
Reports
3 -
PowerApps
3 -
Data Science
3 -
Azure
3 -
Data model
3 -
Conditional Formatting
3 -
Visualisation
3 -
Administration
3 -
M code
3 -
Visuals
3 -
SQL Server 2017 Express Edition
3 -
R script
3 -
Aggregation
3 -
parameter
2 -
Industrial App Store
2 -
Week
2 -
Date duration
2 -
Formatting
2 -
Weekday Calendar
2 -
Support insights.
2 -
construct list
2 -
slicers
2 -
SAP
2 -
Power Platform
2 -
Workday
2 -
external tools
2 -
index
2 -
RANKX
2 -
PBI Desktop
2 -
Date Dimension
2 -
Integer
2 -
Visualization
2 -
Power BI Challenge
2 -
Query Parameter
2 -
Date
2 -
SharePoint
2 -
Power BI Installation and Updates
2 -
How Things Work
2 -
Tabular Editor
2 -
rank
2 -
ladataweb
2 -
Troubleshooting
2 -
Date DIFF
2 -
Transform data
2 -
Tips and Tricks
2 -
Incremental Refresh
2 -
Number Ranges
2 -
Query Plans
2 -
Power BI & Power Apps
2 -
Random numbers
2 -
Day of the Week
2 -
Custom Visual
2 -
VLOOKUP
2 -
pivot
2 -
calculated column
2 -
M
2 -
hierarchies
2 -
Power BI Anniversary
2 -
Language M
2 -
inexact
2 -
Date Comparison
2 -
Power BI Premium Per user
2 -
Forecasting
2 -
REST API
2 -
Editor
2 -
Split
2 -
Life Sciences
2 -
measure
2 -
Microsoft-flow
2 -
Paginated Report Builder
2 -
Working with Non Standatd Periods
2 -
powerbi.tips
2 -
Custom function
2 -
Reverse
2 -
PUG
2 -
Custom Measures
2 -
Filtering
2 -
Row and column conversion
2 -
Python script
2 -
Nulls
2 -
DVW Analytics
2 -
Q&A
1 -
Event
1 -
Custom Visuals
1 -
Free vs Pro
1 -
Format
1 -
Active Employee
1 -
Custom Date Range on Date Slicer
1 -
refresh error
1 -
PAS
1 -
certain duration
1 -
DA-100
1 -
bulk renaming of columns
1 -
Single Date Picker
1 -
Monday
1 -
PCS
1 -
Saturday
1 -
update
1 -
Slicer
1 -
Visual
1 -
forecast
1 -
Regression
1 -
CICD
1 -
Current Employees
1 -
date hierarchy
1 -
relationship
1 -
SIEMENS
1 -
Multiple Currency
1 -
Power BI Premium
1 -
On-premises data gateway
1 -
Binary
1 -
Power BI Connector for SAP
1 -
Sunday
1 -
Training
1 -
Announcement
1 -
Features
1 -
domain
1 -
pbiviz
1 -
sport statistics
1 -
Intelligent Plant
1 -
Circular dependency
1 -
GE
1 -
Exchange rate
1 -
Dendrogram
1 -
range of values
1 -
activity log
1 -
Decimal
1 -
Charticulator Challenge
1 -
Field parameters
1 -
deployment
1 -
ssrs traffic light indicators
1 -
SQL
1 -
trick
1 -
Scripts
1 -
Color Map
1 -
Industrial
1 -
Weekday
1 -
Working Date
1 -
Space Issue
1 -
Emerson
1 -
Date Table
1 -
Cluster Analysis
1 -
Stacked Area Chart
1 -
union tables
1 -
Number
1 -
Start of Week
1 -
Tips& Tricks
1 -
Workspace
1 -
Theme Colours
1 -
Text
1 -
Flow
1 -
Publish to Web
1 -
Extract
1 -
Topper Color On Map
1 -
Historians
1 -
context transition
1 -
Custom textbox
1 -
OPC
1 -
Zabbix
1 -
Label: DAX
1 -
Business Analysis
1 -
Supporting Insight
1 -
rank value
1 -
Synapse
1 -
End of Week
1 -
Tips&Trick
1 -
Showcase
1 -
custom connector
1 -
Waterfall Chart
1 -
Power BI On-Premise Data Gateway
1 -
patch
1 -
Top Category Color
1 -
A&E data
1 -
Previous Order
1 -
Substring
1 -
Wonderware
1 -
Power M
1 -
Format DAX
1 -
Custom functions
1 -
accumulative
1 -
DAX&Power Query
1 -
Premium Per User
1 -
GENERATESERIES
1 -
Report Server
1 -
Audit Logs
1 -
analytics pane
1 -
step by step
1 -
Top Brand Color on Map
1 -
Tutorial
1 -
Previous Date
1 -
XMLA End point
1 -
color reference
1 -
Date Time
1 -
Marker
1 -
Lineage
1 -
CSV file
1 -
conditional accumulative
1 -
Matrix Subtotal
1 -
Check
1 -
null value
1 -
Excel
1 -
Cumulative Totals
1 -
Report Theme
1 -
Bookmarking
1 -
oracle
1 -
mahak
1 -
pandas
1 -
Networkdays
1 -
Button
1 -
Dataset list
1 -
Keyboard Shortcuts
1 -
Fill Function
1 -
LOOKUPVALUE()
1 -
Tips &Tricks
1 -
Plotly package
1 -
Healthcare
1 -
Sameperiodlastyear
1 -
Office Theme
1 -
matrix
1 -
bar chart
1 -
Measures
1 -
powerbi argentina
1 -
Canvas Apps
1 -
total
1 -
Filter context
1 -
Difference between two dates
1 -
get data
1 -
OSI
1 -
Query format convert
1 -
ETL
1 -
Json files
1 -
Merge Rows
1 -
CONCATENATEX()
1 -
take over Datasets;
1 -
Networkdays.Intl
1 -
refresh M language Python script Support Insights
1 -
Governance
1 -
Fun
1 -
Power BI gateway
1 -
gateway
1 -
Elementary
1 -
Custom filters
1 -
Vertipaq Analyzer
1 -
powerbi cordoba
1 -
Model Driven Apps
1 -
REMOVEFILTERS
1 -
XMLA endpoint
1 -
translations
1 -
OSI pi
1 -
Parquet
1 -
Change rows to columns
1 -
remove spaces
1 -
Get row and column totals
1 -
Retail
1 -
Power BI Report Server
1 -
School
1 -
Cost-Benefit Analysis
1 -
DIisconnected Tables
1 -
Sandbox
1 -
Honeywell
1 -
Combine queries
1 -
X axis at different granularity
1 -
ADLS
1 -
Primary Key
1 -
Microsoft 365 usage analytics data
1 -
Randomly filter
1 -
Week of the Day
1 -
Azure AAD
1 -
query
1 -
Dynamic Visuals
1 -
KPI
1 -
Intro
1 -
Icons
1 -
ISV
1 -
Ties
1 -
unpivot
1 -
Practice Model
1 -
Continuous streak
1 -
ProcessVue
1 -
Create function
1 -
Table.Schema
1 -
Acknowledging
1 -
Postman
1 -
Text.ContainsAny
1 -
Power BI Show
1 -
Get latest sign-in data for each user
1 -
API
1 -
Kingsley
1 -
Merge
1 -
variable
1 -
Issues
1 -
function
1 -
stacked column chart
1 -
ho
1 -
ABB
1 -
KNN algorithm
1 -
List.Zip
1 -
optimization
1 -
Artificial Intelligence
1 -
Map Visual
1 -
Text.ContainsAll
1 -
Tuesday
1 -
help
1 -
group
1 -
Scorecard
1 -
Json
1 -
Tops
1 -
financial reporting hierarchies RLS
1 -
Featured Data Stories
1 -
MQTT
1 -
Custom Periods
1 -
Partial group
1 -
Reduce Size
1 -
FBL3N
1 -
Wednesday
1 -
Power Pivot
1 -
Quick Tips
1 -
data
1 -
PBIRS
1 -
Usage Metrics in Power BI
1 -
Multivalued column
1 -
Pipeline
1 -
Path
1 -
Yokogawa
1 -
Dynamic calculation
1 -
Data Wrangling
1 -
native folded query
1 -
transform table
1 -
UX
1 -
Cell content
1 -
General Ledger
1 -
Thursday
1 -
Table
1 -
Natural Query Language
1 -
Infographic
1 -
automation
1 -
Prediction
1 -
newworkspacepowerbi
1 -
Performance KPIs
1 -
HR Analytics
1 -
keepfilters
1 -
Connect Data
1 -
Financial Year
1 -
Schneider
1 -
dynamically delete records
1 -
Copy Measures
1 -
Friday
1