Sie sind auf Seite 1von 26

MM on HANA

HANA Optimizations
EhP7 SP02
November 2013

Objectives

At the end of this module, you will be able to:

Understand what has been optimized in Materials Management in


ERP EhP7.
Check the new objects that are introduced for HANA-specific
optimization

2013 SAP AG. All rights reserved.

Ramp-Up Knowledge Transfer

Customer

Agenda
1. HANA-specific Optimization Introduction
2. Materials Management Inventory Management
a) Optimizations with HANA specific features
b) Optimizations with Open SQL
c) Optimizations with Open SQL and ALV Grid

3. Materials Management Purchasing


a) Optimizations with HANA specific features

2013 SAP AG. All rights reserved.

Ramp-Up Knowledge Transfer

Customer

General Remarks
In many cases porting on HANA DB has improved the performance of reports and
transactions.

For top ranked reports and transactions additional optimizations have been carried out.
The functionality of the reports has not been changed.
All coding changes have been made in one codeline that runs on both HANA DB and
AnyDB.

The maximum performance optimization achievement can differ substantially from report to
report depending on:
Data volume in DB-Tables selected by report
Selection criteria on the selection screen
Selected features of the report
Kind of output
Hierarchical list vs. flat list
ALV Grid vs. ALV List

2013 SAP AG. All rights reserved.

Ramp-Up Knowledge Transfer

Customer

Optimization With HANA Specific Features


Why did we use HANA-specific features?
Performance improvements from using new database techniques are expected to arise from:
Generally

faster data selection by state-of-the-art databases

Aggregation
Reduced

of data on database level instead of ABAP server level

volume of data transferred from the database to the ABAP server

Which HANA-specific features did we use?


The performance improvements have been achieved by code pushdown for database
selection and application logic from ABAP server to the HANA database.
New ABAP feature CALL DATABASE PROCEDURE calls a stored procedure in the HANA
DB, using a generated database procedure proxy.
All HANA-specific features have been switched by a BAdI, that has to be active to enable the
optimizations.

2013 SAP AG. All rights reserved.

Ramp-Up Knowledge Transfer

Customer

Details of Database Procedures and BAdIs


Database Procedures (also known as stored procedures) are:
HANA-specific

artifacts, created in the content of the DB

Created/Maintained

Called

in the SAP HANA Studio (see next slide)

in ABAP with new ABAP statement CALL DATABASE PROCEDURE

Integrated

into the ABAP DDIC as database procedure proxies

2013 SAP AG. All rights reserved.

Ramp-Up Knowledge Transfer

Customer

How can I Find Stored Procedures in SAP HANA Studio?

2013 SAP AG. All rights reserved.

Ramp-Up Knowledge Transfer

Customer

How can I Find the HANA DB Assigned to an SAP ERP?

1
2

In the SAP ERP: Call System Status from the menu:


1.

Database System HDB (i.e. primary Database is a HANA DB)

2. Detail information

Host ldciex1 (i.e. host name of the HANA DB)

Name EX1/02 (i.e. name / instance of HANA DB)


In the SAP HANA Studio: Doubleclick on HANA DB:
3.

Weekstone Version of the HANA database (here: Weekstone 42)

2013 SAP AG. All rights reserved.

Ramp-Up Knowledge Transfer

Customer

How can I Find Database Procedure Proxy?

Database Procedure Proxies could be


displayed via transaction <SE80>:

2013 SAP AG. All rights reserved.

1.

Select Package "MB_OPT (for MMIM optimizations)

2.

Choose Dictionary Objects

3.

Choose Database Procedure Proxies

Ramp-Up Knowledge Transfer

Customer

Reports of Inventory Management


a) Optimizations with HANA specific features
MB5B - Stock on Posting Date

MB5K - Stock Consistency Check


b) Optimizations with Open SQL
MB24/MB25 - Reservation List
MB53 - Plant Availability
MB51 Material Document List
MB52 - Display Warehouse Stocks for Material
MB58 - Display Consignment and Returnable Packaging Stocks at Customer
MB5L List of Stock Value Balances
MB5T - Display Stock in Transit

MB5U - Analyze Conversion Differences


MB90 - Output from Goods Movements
MBGR - Material Documents with Reason for Movement
MI22 - Phys. Inventory Doc. for Material

2013 SAP AG. All rights reserved.

Ramp-Up Knowledge Transfer

Customer

10

Reports of Inventory Management


b) Optimizations with Open SQL (cont.)
MIDO - Physical Inventory Overview

MIR6 - Invoice Overview


MIRO - Enter Incoming Invoice - add. optimizations (Show Worklist)
MR11 - Maintain GR/IR Clearing Account
c) Optimizations with Open SQL and ALV Grid
MB5M - Expiration Date List
MBBS - Valuated Sales Order and Project Stock

2013 SAP AG. All rights reserved.

Ramp-Up Knowledge Transfer

Customer

11

Report MB5B Stock on Posting Date


What did we Optimize?
1.

Quantities + Posting Date

2.

Storage Location/Batch Stock

3.

Special Stocks

4.

Quantities with Batches

1
2
3

2013 SAP AG. All rights reserved.

Ramp-Up Knowledge Transfer

Customer

12

Report MB5B Stock on Posting Date


How did we Optimize?
Database Procedures:
Three stored procedures are used for the code pushdown of transaction MB5B:
MM_IM_MB5B_PROXY
This procedure is mainly used as a wrapper for the input of the select-options of the selection screen of
transaction MB5B.

MM_IM_MB5B_MAIN
This procedure contains the main logic of the report.

MM_IM_MB5B_INVENTORY
Here the current inventory is read from the relevant inventory tables of the Database.

2013 SAP AG. All rights reserved.

Ramp-Up Knowledge Transfer

Customer

13

Report MB5K Stock Consistency Check


What did we Optimize?

1.

Material valuation actual period

6.

Sales order stock valuation previous


period/year

2.

Material valuation previous period/year

3.

Material split valuation actual period

7.

Project stock valuation actual period

4.

Material split valuation previous period/year

8.

Project stock valuation previous period/year

5.

Sales order stock valuation actual period

2013 SAP AG. All rights reserved.

Ramp-Up Knowledge Transfer

Customer

14

Report MB5K Stock Consistency Check


How did we Optimize?
Database Procedures:
Four stored procedures are used for transaction MB5K. These are
MM_IM_MB5K
MM_IM_MB5K_ACTUAL_PERIOD
MM_IM_MB5K_REVIOUS_PERIOD
MM_IM_MB5K_INCONS_MSG

2013 SAP AG. All rights reserved.

Ramp-Up Knowledge Transfer

Customer

15

Reports Optimized With Open SQL And/Or ALV Grid


How did we Optimize?

The following slides show some examples how the optimization has been carried
out with ABAP Open SQL and/or ALV Grid Control (instead of ALV List Variant).

2013 SAP AG. All rights reserved.

Ramp-Up Knowledge Transfer

Customer

16

Report MB5M Expiration Date List


ALV GRID Control
ALV List (old):
Selection Screen:

ALV Grid (new):

2013 SAP AG. All rights reserved.

Ramp-Up Knowledge Transfer

Customer

17

Report MB5M Expiration Date List


How did we Optimize?
ABAP Open SQL and ALV GRID Control
1. Form DATENSELEKTION
The following three optimizations have been carried out for the data selection:
The data selection runs with one SELECT-statement on the table view V_MMIM_LC_MB5M instead of two selects. The
conditions of both selections have been combined in one selection.
The selection has been reduced to the needed fields. Therefore the new table view V_MMIM_LC_MB5M has been created.
The third selection from table MCHB is not needed because the required quantity in field CLABS is already available in field
LABST from view V_MMIM_LC. The internal result table from the first selection already contains the quantity field.

4. Form BERECHTIGUNG_PRUEFEN
The authority check for the plant has been done for each storage location. The authority check for the plants has been
reduced to single check for each plant.

5. Form LISTAUSGABE
The hierarchical list is created based on the internal tables HEADER and BESTAND. These two tables are combined in table
LT_BESTAND_GRID which is used to create the grid list. The grid list is displayed by using function
REUSE_ALV_GRID_DISPLAY.
The grid display offers the same additional functions (display material, display batch) as the list display.

2013 SAP AG. All rights reserved.

Ramp-Up Knowledge Transfer

Customer

18

Report MI22 - Phys. Inventory Doc. for Material


How did we Optimize?

ABAP Open SQL


1. Optimization of Report transaction MI22
Performance measurement and code scan on report RM07IMAT (Transaction MI22) showed
a) a vast amount of SELECT SINGLE database accesses and
b) related authority check

2. Substitution of SELECT SINGLE


At END-OF-SELECTION routine YISEG_FUELLEN
database accesses on seven db-tables (during loop at pre-output table XISEG) via SELECT SINGLE are substituted:

SELECT * into new internal tables, seized by FOR ALL ENTRIES, are used now beforehand; then, inside the loop, specified
READ TABLE access the internal tables.

3. Relocation of Authority Check


At START-OF-SELECTION routines S6000_EINSTIEG_KOEPFE & S6000_EINSTIEG_POSITIONEN
the authority checks on plant level with subsequent, where necessary, deletion of entries from pre-output table XIKPF or
XISEG are relocated:
Authorized plants are now selected beforehand into range table for later usage in WHERE-clause of SELECTs on db-tables
IKPF and ISEG.

2013 SAP AG. All rights reserved.

Ramp-Up Knowledge Transfer

Customer

19

Report MBGR - Material Doc. With Reason for Movement


How did we Optimize?

ABAP Open SQL


Optimization of Report MBGR
The main tables for this report are: EKKO; EKBE; EKPO; MKPF and MSEG. Based on the input parameters there are 3
strategies considered for reading document from DBs:
Strategy (a) : Input parameter Vendor(LIFNR)
Strategy (b) : Input parameter Purchasing Document (EBELN)
Strategy (c) : Input parameters without Vendor(LIFNR) and Purchasing Document (EBELN)
The strategies (a) and (b) have been optimized, but there is no further possibility for optimizing the strategy (c) via OPEN
SQL. Another approach for the strategy (c) is to move the logic to HANA SQL which may result in some performance
improvement due to reduction in the amount of data transfer between the database and the application layer. However, since
procedures do not support ranges moving the code till now, that may result in reduction of performance as master data such
as material is also an input parameter. Hence we have retained the existing logic for scenario c.

2013 SAP AG. All rights reserved.

Ramp-Up Knowledge Transfer

Customer

20

Reports of Purchasing

Optimizations with HANA specific features

Purchase Order History - used in all follow on documents to PO, such as


MIRO Enter Incoming Invoice
MIGO Goods Receipt
ME2K - Purchase Orders by Account Assignment,
ME2L - Purchase Orders by Vendor,
ME2M - Purchase Orders by Material,
ME2N - Purchase Orders by PO Number

2013 SAP AG. All rights reserved.

Ramp-Up Knowledge Transfer

Customer

21

Appendix

The following slides have the technical details regarding the changes and the
performance improvement factors for some key transactions

2013 SAP AG. All rights reserved.

Ramp-Up Knowledge Transfer

Customer

22

Performance Statistics for key Transactions


The statistics is based on internal testing with sample data *
Transaction Code

MB5B (Stock on Posting Date)

Acceleration Factor post HANA


migration (HANA DB optimized
versus Any DB optimized)
12 times

Selection Criteria and other


information
2 Million records in MSEG. No selection
within area "Database Selections" of
MB5B and "Storage loc./batch stock"
flagged within area "Stock Type"

MB5K (Stock Consistency Check)

4.2 times

15.9 Million records in MBEW table

MB5U (Analyze Conversion


Differences)
MB5M (Expiration Date List )

19 times

50 Million records in MKPF and MSEG


tables
14 Million records in MCHA, MCHB and
MCH1
2.3 Million records in EBEW, 11 Million
records in VBAK, 2.6 Million records in
QBEW

MBBS (Valuated Sales Order and


Project Stock)

Transaction Code
MB51 (Material Document List)

19.1 times
2.3 times

Acceleration Factor post HANA


migration (w/o optimization)
8 times

Selection Criteria and other


information
58 Million records in MSEG.

* Based on internal lab tests


2013 SAP AG. All rights reserved.

Ramp-Up Knowledge Transfer

Customer

23

Summary

You should now be able to

Explain which MM reporting transactions have been optimized with


HANA SQL and ABAP Open SQL
Check in ERP System, if database procedures are available and
BAdIs are active
Check in SAP HANA Studio, if stored procedures are available

2013 SAP AG. All rights reserved.

Ramp-Up Knowledge Transfer

Customer

24

Additional Information

SAP notes for details on the SAP HANA Optimizations and other information

Note 1761546 - SAP ERP powered by SAP HANA Optimizations


Note 1785057 - Recommendations for migrating suite systems to SAP HANA

2013 SAP AG. All rights reserved.

Ramp-Up Knowledge Transfer

Customer

25

2013 SAP AG. All rights reserved.

No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG.
The information contained herein may be changed without prior notice.
Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors.
National product specifications may vary.
These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or
warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group
products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing
herein should be construed as constituting an additional warranty.

SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in
Germany and other countries.
Please see http://www.sap.com/corporate-en/legal/copyright/index.epx#trademark for additional trademark information and notices.

2013 SAP AG. All rights reserved.

Ramp-Up Knowledge Transfer

Customer

26

Das könnte Ihnen auch gefallen