ABAP - Keyword Documentation →  ABAP - Reference →  Processing External Data →  ABAP Database Accesses →  AMDP - ABAP Managed Database Procedures →  AMDP - Methods → 

AMDP - Function Implementations

An AMDP function implementation is an AMDP method for implementing an AMDP function as a table function. An AMDP function implementation is indicated as an AMDP method in the implementation part of the class using the addition BY DATABASE FUNCTION of the statement METHOD. AMDP functions can be defined that can be accessed only in other AMDP methods and functions defined that implement CDS table functions.

AMDP Functions for AMDP Methods

An AMDP function implementation whose AMDP function can be accessed in AMDP methods is declared in an AMDP class like a regular static method or instance method in any visibility section. An AMDP function implementation like this cannot be detected in the declaration part of the class and the same basically applies as to AMDP procedure implementations with the following differences:

An AMDP function defined using a AMDP function implementation like this can only be called in other AMDP methods and not in database procedures managed in AMDP or in database functions like database table functions.

Executable Example

AMDP functions

AMDP Functions for CDS Table Functions

The same applies to an AMDP function implementation that implements a CDS table function as to the function implementation above, with the following differences:

The AMDP function defined by an AMDP function implementation like this can be used as follows using the CDS entity represented by the CDS table function:

Furthermore, the same uses as in the preceding function implementation are possible in other AMDP methods or other database procedures or database functions


Executable Example

AMDP functions