Friday 25 May 2018

ABAP Dictionary External Views for Overcoming ABAP CDS Views Limitations

This post I would like to share usage of ABAP Dictionary External Views in ABAP CDS views development to overcome some limitations.

SAP ABAP Tutorials and Materials, SAP ABAP Certifications, SAP ABAP Learning, SAP ABAP CDS, SAP ABAP DB

Scenario 1


Imagine that we have S/4HANA system and HANA DB also used for other applications. In this case we usually have and use in HANA not only main schema of S/4HANA system. We use ABAP CDS views in S/4HANA for reporting reasons.

How to use data from REPZME schema in our ABAP CDS views? By default you could use only tables visible in ABAP Dictionary of T85 Application server and placed in SAPT85 schema.

Scenario 2


Imagine that we have S/4HANA system and using ABAP CDS views for reporting reasons. But some developers in your company are good at HANA Information Models development or already exist some Calculation Views with complex logic.

Do you need to rebuild them using ABAP CDS views or may be you could reuse it?

Solution


In this post I would like to show solution for Scenario 1 and Scenario 2.

From ABAP 7.4 SP02 it is possible to create Dictionary External Views for this reasons.

We would like to use table MARA from REPZME Schema in ABAP CDS views.

SAP ABAP Tutorials and Materials, SAP ABAP Certifications, SAP ABAP Learning, SAP ABAP CDS, SAP ABAP DB

SAP ABAP Tutorials and Materials, SAP ABAP Certifications, SAP ABAP Learning, SAP ABAP CDS, SAP ABAP DB

1.Go to HANA Studio Modeler Perspective, create in Content Area some package and Calculation VIew for table MARA. I just select 4 fields for demo purpose. In CV we could use tables not only from main SAPT85 Schema.

SAP ABAP Tutorials and Materials, SAP ABAP Certifications, SAP ABAP Learning, SAP ABAP CDS, SAP ABAP DB

2. Go to HANA Studio ADT Perspective, create some ABAP Package and create new “Dictionary view”. Give it a name, description and select External View option and find our Calculation Views with Browse button.

SAP ABAP Tutorials and Materials, SAP ABAP Certifications, SAP ABAP Learning, SAP ABAP CDS, SAP ABAP DB

SAP ABAP Tutorials and Materials, SAP ABAP Certifications, SAP ABAP Learning, SAP ABAP CDS, SAP ABAP DB

3. Change DDIC fields type if needed and activate.

SAP ABAP Tutorials and Materials, SAP ABAP Certifications, SAP ABAP Learning, SAP ABAP CDS, SAP ABAP DB

4. Go to ABAP Dictionary and check existence and look at data.

SAP ABAP Tutorials and Materials, SAP ABAP Certifications, SAP ABAP Learning, SAP ABAP CDS, SAP ABAP DB

SAP ABAP Tutorials and Materials, SAP ABAP Certifications, SAP ABAP Learning, SAP ABAP CDS, SAP ABAP DB

SAP ABAP Tutorials and Materials, SAP ABAP Certifications, SAP ABAP Learning, SAP ABAP CDS, SAP ABAP DB

5. Go back to ADT Perspective and create ABAP CDS views Data definition based on External view ZT04_PROXY.

SAP ABAP Tutorials and Materials, SAP ABAP Certifications, SAP ABAP Learning, SAP ABAP CDS, SAP ABAP DB

SAP ABAP Tutorials and Materials, SAP ABAP Certifications, SAP ABAP Learning, SAP ABAP CDS, SAP ABAP DB

Result


We use in ABAP CDS views data from table not in visible by default in ABAP Dictionary or reuse in ABAP CDS views complex logic that was written in Calculation Views.

1 comment:

  1. Are you still searching for Best SAP MM Training in Chennai? 
    Do you want to become an Expert in SAP MM Functional Module? 
    Are you looking for SAP MM implementation Training institute in Chennai?
    sap mm training

    ReplyDelete