Hi All, following on from looking at ABAP Managed Database Procedures I started looking at CDS views on our CRM on HANA system and wanted to see what was happening at the HANA layer and how the views performed.
So first off I created the CDS view. My view is based on Business Partner details. In my project I created a new DDL source and added the following:
@AbapCatalog.sqlViewName: 'ZPM_V_PARTNERS'
define view zpm_partners as
select bt.partner,
bt.name_org1,
bt.name_last,
bt.name_first,
bt.type,
partcat.ddtext,
bt_fs.addrnumber,
adrc.name1,
adrc.city1,
adrc.city2,
adrc.home_city,
adrc.street,
adrc.post_code1,
adrc.house_num1,
adrc.house_num2,
adrc.building,
adrc.floor,
adrc.roomnumber,
adrc.country,
adrc.region
from but000 as bt left outer join dd07t as partcat on bt.type = partcat.domvalue_l and partcat.domname = 'BU_TYPE' and partcat.as4local ='A' and partcat.ddlanguage = 'E' left outer join but021_fs as bt_fs on bt.partner = bt_fs.partner left outer join adrc as adrc on bt_fs.client = adrc.client and bt_fs.addrnumber = adrc.addrnumber and adrc.langu = 'E'
I saved and activated the view successfully. I then went to the HANA layer and took a look at what was created there. In our CRM schema I found the new view ZPM_V_PARTNERS:
On opening the definition I could see the following create view statement:
CREATE VIEW "SAPSR3"."ZPM_V_PARTNERS" ( "MANDT", "PARTNER", "NAME_ORG1", "NAME_LAST", "NAME_FIRST", "TYPE", "DDTEXT", "ADDRNUMBER", "NAME1", "CITY1", "CITY2", "HOME_CITY", "STREET", "POST_CODE1", "HOUSE_NUM1", "HOUSE_NUM2", "BUILDING", "FLOOR", "ROOMNUMBER", "COUNTRY", "REGION" ) AS SELECT "BT"."CLIENT" AS "MANDT", "BT"."PARTNER", "BT"."NAME_ORG1", "BT"."NAME_LAST", "BT"."NAME_FIRST", "BT"."TYPE", "PARTCAT"."DDTEXT", "BT_FS"."ADDRNUMBER", "ADRC"."NAME1", "ADRC"."CITY1", "ADRC"."CITY2", "ADRC"."HOME_CITY", "ADRC"."STREET", "ADRC"."POST_CODE1", "ADRC"."HOUSE_NUM1", "ADRC"."HOUSE_NUM2", "ADRC"."BUILDING", "ADRC"."FLOOR", "ADRC"."ROOMNUMBER", "ADRC"."COUNTRY", "ADRC"."REGION"
FROM ( ( "BUT000" "BT" LEFT OUTER JOIN "DD07T" "PARTCAT" ON ( "BT"."TYPE" = "PARTCAT"."DOMVALUE_L" AND "PARTCAT"."DOMNAME" = 'BU_TYPE' AND "PARTCAT"."AS4LOCAL" = 'A' AND "PARTCAT"."DDLANGUAGE" = 'E' ) ) LEFT OUTER JOIN "BUT021_FS" "BT_FS" ON ( "BT"."CLIENT" = "BT_FS"."CLIENT" AND "BT"."PARTNER" = "BT_FS"."PARTNER" ) )
LEFT OUTER JOIN "ADRC" "ADRC" ON ( "BT_FS"."CLIENT" = "ADRC"."CLIENT" AND "BT_FS"."ADDRNUMBER" = "ADRC"."ADDRNUMBER" AND "ADRC"."LANGU" = 'E' AND "BT"."CLIENT" = "ADRC"."CLIENT" ) WITH READ ONLY
Nothing too out of the ordinary here except I did notice one subtle thing - the inclusion of opening and closing brackets () around the datasource joins.
(( "BUT000" "BT"
LEFT OUTER JOIN "DD07T" "PARTCAT" ON ( "BT"."TYPE" = "PARTCAT"."DOMVALUE_L"
AND "PARTCAT"."DOMNAME" = 'BU_TYPE'
AND "PARTCAT"."AS4LOCAL" = 'A'
AND "PARTCAT"."DDLANGUAGE" = 'E' ) )
LEFT OUTER JOIN "BUT021_FS" "BT_FS" ON ( "BT"."CLIENT" = "BT_FS"."CLIENT"
AND "BT"."PARTNER" = "BT_FS"."PARTNER" ) )
LEFT OUTER JOIN "ADRC" "ADRC" ON ( "BT_FS"."CLIENT" = "ADRC"."CLIENT"
AND "BT_FS"."ADDRNUMBER" = "ADRC"."ADDRNUMBER"
AND "ADRC"."LANGU" = 'E'
AND "BT"."CLIENT" = "ADRC"."CLIENT" )
Would this have an affect on the execution and performance of the query? To investigate this I decided to compare the execution of the view with the execution of the raw SQL query.
In my HANA Studio SQL Editor I queried the view for one business partner a number of times to get the average execution time:
select * from "SAPSR3"."ZPM_V_PARTNERS" where partner = '1000184087'
And then executed the raw query without any of the opening or closing brackets querying the same partner:
select bt.partner,
bt.name_org1,
bt.name_last,
bt.name_first,
bt.type,
partcat.ddtext,
bt_fs.addrnumber,
adrc.name1,
adrc.city1,
adrc.city2,
adrc.home_city,
adrc.street,
adrc.post_code1,
adrc.house_num1,
adrc.house_num2,
adrc.building,
adrc.floor,
adrc.roomnumber,
adrc.country,
adrc.region
from sapsr3.but000 as bt left outer join sapsr3.dd07t as partcat on bt.type = partcat.domvalue_l and partcat.domname = 'BU_TYPE' and partcat.as4local ='A' and partcat.ddlanguage = 'E' left outer join sapsr3.but021_fs as bt_fs on bt.partner = bt_fs.partner left outer join sapsr3.adrc as adrc on bt_fs.client = adrc.client and bt_fs.addrnumber = adrc.addrnumber and adrc.langu = 'E'
where bt.partner = '1000184087';
The SQL plan cache was interesting. The raw SQL query without the opening and closing brackets was 3 times faster than the query on the view.
It would seem that the brackets are causing the view to perform slower. Just to confirm I took the SQL from the generated view and executed that a number of times querying on the same partner again:
SELECT "BT"."CLIENT" AS "MANDT", "BT"."PARTNER", "BT"."NAME_ORG1", "BT"."NAME_LAST", "BT"."NAME_FIRST", "BT"."TYPE", "PARTCAT"."DDTEXT", "BT_FS"."ADDRNUMBER", "ADRC"."NAME1", "ADRC"."CITY1", "ADRC"."CITY2", "ADRC"."HOME_CITY", "ADRC"."STREET", "ADRC"."POST_CODE1", "ADRC"."HOUSE_NUM1", "ADRC"."HOUSE_NUM2", "ADRC"."BUILDING", "ADRC"."FLOOR", "ADRC"."ROOMNUMBER", "ADRC"."COUNTRY", "ADRC"."REGION"
FROM ( ( sapsr3."BUT000" "BT" LEFT OUTER JOIN sapsr3."DD07T" "PARTCAT" ON ( "BT"."TYPE" = "PARTCAT"."DOMVALUE_L" AND "PARTCAT"."DOMNAME" = 'BU_TYPE' AND "PARTCAT"."AS4LOCAL" = 'A' AND "PARTCAT"."DDLANGUAGE" = 'E' ) ) LEFT OUTER JOIN sapsr3."BUT021_FS" "BT_FS" ON ( "BT"."CLIENT" = "BT_FS"."CLIENT" AND "BT"."PARTNER" = "BT_FS"."PARTNER" ) )
LEFT OUTER JOIN sapsr3."ADRC" "ADRC" ON ( "BT_FS"."CLIENT" = "ADRC"."CLIENT" AND "BT_FS"."ADDRNUMBER" = "ADRC"."ADDRNUMBER" AND "ADRC"."LANGU" = 'E' AND "BT"."CLIENT" = "ADRC"."CLIENT" )
where bt.partner = '1000184087';
As expected the SQL plan cache showed similar average run-time to the view.
On analysis, first off it joins BUT000 to BUT021_FS, assembles the results, then joins ADRC to DD07T, assembles the results and then joins up these 2 result sets all in a linear execution it seems.
And here then is the viz plan for the direct query
As you can see from the plans for the direct query the joins on BUT000 and DD07T and the joins on ADRC and BUT021_FS look to be done in a parallel execution and then the results are assembled.
Conclusion
So the inclusion of the opening and closing brackets surrounding the datasource joins are resulting in a different execution plan for the view compared to the execution plan of the directly executed query. From the evidence above this has a negative impact on the execution time of the view. Would be interesting to hear from some SAP folks if this is by design and if so are there best practice gudelines available in terms of performance optimization on CDS views....
This page is the entry point for the ABAP for SAP HANA Reference Scenario Open Items Analysis. It will provide links to the different ressources (such as guides, articles, blogs, and tutorials) around the reference scenario which is an integral part of the SAP Netweaver AS ABAP 7.4.
This document provides a brief overview of the Open Items Analysis demo application which is intended to provide how-tos about the consumption of SAP HANA features in ABAP as of SAP NetWeaver 7.4. August 23, 2013
This blog provides a compact overview of the different approaches to leverage SAP HANA in your ABAP-based applications provided by the SAP NetWeaver AS ABAP 7.4 SP5. February 3, 2014
Implementation Overviews
The documents in this chapter gives you an overview about the development objects available with AS ABAP 7.4 of the Open Items Analysis Implementation
This brand-new guide provides an end to end example about how to leverage the power of SAP HANA in an ABAP-based application based on the reference scenario, making use of the latest SAP NetWeaver AS ABAP 7.4 SP5 features. April 24, 2014
This tutorial demonstrates step-by-step how to create a SAP HANA Database Procedure and easily consume it from an ABAP program as of AS ABAP 7.4 SP5. March 18, 2014
This guide provides an end to end example about how to accelerate your business coding using SAP HANA and SAP NetWeaver AS ABAP 7.4 SP2 based on the reference scenario. May 13, 2013
This tutorial demonstrates step-by-step how to create a SAP HANA Database Procedure and easily consume it from an ABAP program as of SAP NetWeaver AS ABAP 7.4 SP2. May 16, 2013
This tutorial demonstrates step-by-step how to create a SAP HANA Attribute View and easily access it in ABAP using External View and Open SQL as of SAP NetWeaver AS ABAP 7.4 SP2.
This document provides an overview on the SAP HANA Transport Container (HTC) and demonstrate how to use it.
Video Tutorials
Find various HowTo video tutorials around for the ABAP for SAP HANA development (e.g. ABAP Managed Database Procedures, CDS Views, External Views, etc) hier :
This document provides a brief overview of the Open Items Analytics dashboard showing how to realize Analytics on top of transactional data using SAP NetWeaver BI technology as well as a BEx Web Application for visualizing the data. May 7, 2013
Analytical UIBB is a new offering contained in SAP Business Information Warehouse. It provides the capability to analyse data from a BEx Query.... Feb, 2014
I have been working as a ABAP SRM techno-Functional Consultant for 5 years. Now I feel like to switch into something new and increase my knowledge. Can someone help me regarding learning of HANA for ABAP. Also can SAP HANA somehow be used in SRM. Will HANA provide me something more towards my carrier.
How ADBC connection is benefits by using SAP HANA as secondary database in terms of performance wise for the access of data from HANA database as a secondary database.
I have 2 options and which is better for the good performance for accessing the data-
1 . In ABAP Reports in the SELECT statements by using CONNECTION (“HDB”) will this improve the performance. e.g : select * from BSEG into TABLE IT_TAB CONNECTION (“HDB”).
2. Will Create the Stored procedure in HANA studio and Call from ABAP as below by using NATIVE SQL–
EXEC SQL
SET CONNECTION (‘HDB’).
ENDEXEC.
EXEC SQL.
EXECUTE PROCEDURE proc (IN p_in1 OUT p_out1 OUT p_out2 )
does anyone know if there is a possibility to delete a graphical HANA view (attribute/analytical/calculation view) from ABAP source code, e.g., using an SQL statement or an ABAP method.
The videos (ALV and FPM on SAP HANA, ALV transformation) and document concerning ALV on HANA are using features which we delivered in NW7.40. But as we are continuously developing the tool, it is not always clearly stated in which support package they are available. This matrix will help you to get an overview on the availability of features in SAPGUI for Windows.
Feature
Next SP
SAP UI SP8
SAP UI SP7
SAP UI SP6***
NW 7.40 SP4
NW 7.40 SP3
NW 7.40 SP2
NW 7.40 SP0*
Basic consumption scenario
Consumption of DDIC views and tables with query push down, paging, filtering, sorting, grouping and aggregation in the ALV Grid
X
X
X
X
X
X
X
X
Consumption of CDS views - using CDS name
X
X
API: selection parameters
X
X
X
X
X
X
X
API: Initial Grouping
X
X
X
X
X
X
X
API: Initial Aggregation
X
X
X
X
Integrated authority-check on SAP HANA
X
X
X
X
X
X
X
Application defined authority provider
X
X
Unified consumption API for all databases - capability service
X
X
X
Integrated text search
X
Special SAP HANA features
Text and fuzzy search on SAP HANA
X
X
X
X
X
X
X
Definition of the search scope for text search
X
X
X
X
Consumption of DDIC external views
X
X
X
X
X
X
X
Support for HANA native data types representing DDIC types (e.g. date, time)
X
X
X
API: Support for SAP HANA view placeholder
X
X
X
X
X
X
X
Field catalogue API: setting of texts (directly or using a data element)****
X
X
X
X
X
X
Field catalogue API: setting of refererence fields (currency and unit relationship)****
X
X
X
X
X
X
Default sorting with locale, binary search electable
X
X
X
Layouting and Personalisation**
Basic layouting features (enabling, disabling of columns) in API and grid
X
X
X
X
X
X
X
Fixed key columns
X
X
X
X
X
Personalized toolbar buttons
X
X
X
X
X
Field display options (as button, icon, link) and their cell actions
Non persistent personalisation (settings dialogue)
X
X
X
X
X
X
X
Persisted personalisation (ALV variants)
X
X
X
X
X
X
Access of ALV variants in toolbar
X
X
Usability improvements (cell merging of sorted columns, empty table text)
X
X
Additional navigation possibilities
X
Functions
Single row selection and application functions
X
X
X
X
X
X
X
Double click enablement
X
X
X
X
Printing and Excel Export (limited to 10 000 selected rows)
X
X
X
X
X
X
X
Disabling of standard functions for business reasons (e.g. aggregation of status codes not allowed)
X
X
X
X
Special features
Complex where conditions
X
X
X
X
X
X
X
Treating null values as initial values in database selection
X
X
X
X
X
X
Calculated fields in ABAP (e.g. determination of icons)
X
X
X
X
X
X
Constant Currency for all values in a column
X
X
X
X
X
Integrated fullscreen mode
X
X
X
X
*NW 7.40 SP0: ALV on HANA is not released for productive usage - only for test purposes
**Frontend Features require SAPGUI 7.30 Patch 5 (see note 1883738)
*** SAPUI 7.40 SP06 is delivered with NW 7.40 SP05 or separately. As UI delivers on a faster tact, we continue with the UI SPs
****Fields in SAP HANA views do not refer to data elements, hence there are no texts or further DDIC conveniences available. These elements must be handled via the field catalogue API. These features can also be used for DDIC views and tables, but normally they are not necessary in this context
Recently my client is going on for Sap Hana Consolidation and SLO (System Landscape Optimization) project with existing Sap Solutions ( SRM, BW, Portal , PPM , ECC and PI) . Now I want to know the possible ways to perform this. As we are moving on one system on client for SAP Hana Platform. Can someone guide me the correct process regarding above migration.Mainly the project scope is :-
All SAP Instances (SRM, BW, Portal, PPM, ECC, PI) to run on SAP HANA Platform.
ECC System Consolidation, Final Goal will be one system one client on SAP HANA Platform.
Please provide me the idea for above process to be performed.Can some one provide me better guidance for this .
I think by this time, most of us are aware of the difference between Row Store and Column store in SAP HANA ( Column store actually uses an internal memory layout, which is highly optimized for column operations such as search and aggregation.)
Recommendation from SAP is to always use Column store for tables with Business Data (i.e. Master Data and Transaction data ) within SAP HANA and Row Store to be used very selectively for Application server system tables. I have these queries :
1. What kind of system tables are referred here ?
2. Can we use Row store for Configuration tables ? In this case, we can optimize the query by using SELECT SINGLE * for required condition.
3. For Side car scenarios, where in we may have SAP ERP on Classical d/b and required Tables/data are replicated to HANA by SLT, then I understand that SLT would automatically decide which tables will be Column Store and Row store.
4. Are the recommendations different for Suite on HANA ? I think a Hybrid Row and Column store is used here to provide optimizations in the OLTP system.
5. So, what is the approach to be followed when we are doing any Native HANA development and we need to create few Custom tables. Although by default, they need to be Column store, are there any special cases to be considered for Row store ?
I have knowledge of implementing SAP Business one and learning knowledge in SAP SD,i would like to learn SAP ABAP.How do i proceed in a step by step manner?