0% found this document useful (0 votes)
538 views

CDS - SAP ABAP - Table Function - This Blog Is About The Workarounds For

This document discusses implementing string functions in ABAP CDS views using CDS table functions and AMDP functions. It explains the process of creating a CDS table function, the corresponding ABAP class, and consuming the table function in a CDS view. The table function returns data in a table that can be used as a data source in other CDS entities.

Uploaded by

fiotui
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
538 views

CDS - SAP ABAP - Table Function - This Blog Is About The Workarounds For

This document discusses implementing string functions in ABAP CDS views using CDS table functions and AMDP functions. It explains the process of creating a CDS table function, the corresponding ABAP class, and consuming the table function in a CDS view. The table function returns data in a table that can be used as a data source in other CDS entities.

Uploaded by

fiotui
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

This blog is about the workarounds for 

String functions in ABAP CDS Views and talks about


the implementation using CDS Table and AMDP Functions.

ABAP CDS table function is defined in the type CDS DDL. In general, the CDS table is
implemented using the AMDP method amdp_function, which is created using the AMDP
framework in the database system as an AMDP function. This blog is a follow up blog from
the previous one where we discussed string operations in HANA Models and workarounds to
achieving the same.

A CDS table function returns data of type table and it is available in the namespace of the data
types in the ABAP dictionary so this can be used as a data source in other CDS entities.

Process

Steps to create the CDS table function, ABAP class and consuming it in CDS view is
explained below:

1. Go to ABAP perspective and create a CDS table function by using the same approach
as of CDS view. Specify the columns which are required as output of the table
function.
2. To create AMDP methods select the ABAP class in as mentioned in the below image.

3. Provide proper naming standards and click on finish.

4. Kindly note that AMDP function implementation for a CDS table function can only be
declared in the public visibility section of a static AMDP class. Use the below image
example to create class for table function. Here we also include the logic to determine
the Area Code within the ID Description.

5. Consume the above created CDS Table Function in the CDS view to fetch Area code
based on ID.
Below is the output for the CDS view with area codes(required_value)

You might also like