This blog is about the workarounds for String functions in ABAP CDS Views and talks about the implementation using CDS Table and AMDP Functions.

This process involves creation of the calculation view, expose the HANA view as Dictionary table and use the same in CDS view to fetch the area code.

Create a calculation view as mentioned in the below example:

Extended View based on HANA Views

 

The below calculated column is created to fetch the Area code based on characteristics “_” and “.”

Extended View based on HANA Views

Note: All column names (Fields) should be in the Capital case.

 

Output of the calculation view:

Extended View based on HANA Views

 

An SAP HANA View (Attribute View, Analytic View, Calculation View) is an entity of the SAP HANA database and is defined here using SAP HANA Studio. This uses HANA-specific data types and different naming conventions which means the direct access to an SAP HANA view in CDS view is not possible. To access the SAP HANA view in ABAP programs we will create external views which creates a DDIC type table. This can be used as a proxy for the SAP HANA view which can be used to access the data in CDS views.

Process to create Dictionary table based on the SAP HANA view.

  1. Open the ABAP perspective and choose to create a new Other ABAP repository Object.

Extended View based on HANA Views

2. Search for the object of type dictionary view and proceed further

Extended View based on HANA Views

3. Provide the name and description and choose the view which you want to create the dictionary view

Extended View based on HANA Views

4. Verify the fields and active the dictionary view

Extended View based on HANA Views

5. Use the dictionary view and created above CDS view to fetch the area code based on ID

 

Below is the output of the CDS view with area codes(required_value)

Extended View based on HANA Views

 

As a continuation of this blog, please refer to the this blog on ABAP CDS Table Function with AMDP Function Implementation.

Subscribe to our Newsletter

5600 Tennyson Pkwy
Suite 120
Plano TX 75024.

+1 888-227-2794

+1 972-232-2233

+1 888-227-7192

solutions@visualbi.com