Tuesday, 21 August 2018

ABAP new Open SQL and CDS runtime

With the introduction of NW AS ABAP 740 SPS5, the New enhanced extended Open SQL was introduced. The new enhanced open sql has some good features such introduction of aggregate functions, right outer join, casting, etc making it a starting step for Code-Push down paradigm.

The Code push down techniques (CDS and New SQL) are compared in the demo here. Below is a demo program of data retrieval from BKPF and BSEG.

1) ABAP program using inner join between BKPF and BSEG

2) ABAP program using CDS view entity

3) ABAP program using enhanced Open SQL features

So its Old SQL vs CDS views vs New Open SQL

The objective of this demo is to determine the run time difference in microseconds.

1) Lets start with the ABAP program using open sql syntax and check the run time.

SAP ABAP Certification, SAP ABAP Learning, SAP ABAP Tutorial and Materials, SAP ABAP Guides

The Output

SAP ABAP Certification, SAP ABAP Learning, SAP ABAP Tutorial and Materials, SAP ABAP Guides

2) Next, lets move to program using CDS views. Not going to elaborate on the CDS views as the intention here is to measure the run time.

CDS Views

SAP ABAP Certification, SAP ABAP Learning, SAP ABAP Tutorial and Materials, SAP ABAP Guides

The ABAP program using the CDS view

SAP ABAP Certification, SAP ABAP Learning, SAP ABAP Tutorial and Materials, SAP ABAP Guides

The Output

SAP ABAP Certification, SAP ABAP Learning, SAP ABAP Tutorial and Materials, SAP ABAP Guides

3) Lastly lets move to program using enhanced open sql syntax.

SAP ABAP Certification, SAP ABAP Learning, SAP ABAP Tutorial and Materials, SAP ABAP Guides

The Output

SAP ABAP Certification, SAP ABAP Learning, SAP ABAP Tutorial and Materials, SAP ABAP Guides

Here is Run time comparisons in micorseconds.

SAP ABAP Certification, SAP ABAP Learning, SAP ABAP Tutorial and Materials, SAP ABAP Guides

Since the system resources load differ at times, multiple run times are recorded.

SAP ABAP Certification, SAP ABAP Learning, SAP ABAP Tutorial and Materials, SAP ABAP Guides

These findings may vary depending on the system load.  Between CDS and New SQL, both stand atop for the new code paradigm.

From the Code-push-down perspective, CDS and New SQL refer to the Top to Bottom approach. However there is Bottom to Top approach which is via HANA views.

No comments:

Post a Comment