ABAP Keyword Documentation →  ABAP − Reference →  Processing External Data →  ABAP Database Access →  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 database 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. There are AMDP table functions and AMDP scalar funktions.

AMDP Table Functions

There are two types of AMDP table functions:

AMDP table functions for AMDP methods

An AMDP function implementation for an AMDP table function that can only 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:

The AMDP table function of a AMDP table function can be called from other AMDP methods. It cannot be called in ABAP programs like a regular functional method.

Notes

Executable Example

AMDP functions

AMDP Table Functions for CDS Table Functions

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

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

In addition, calls from other AMDP methods are possible. Calls as regular functional methods are not possible in an ABAP program.

Notes

Executable Example

AMDP functions

AMDP Scalar Functions

An AMDP is declared in an AMDP class like a regular static method or instance method in any visibility section. An AMDP function implementation like this is unknown in the declaration part of the class and the same basically applies as to AMDP table functions for AMDP methods with the following differences:

The AMDP scalar function defined using an AMDP function implementation like this can be used in other AMDP methods in accordance with the rules for scalar functions.

Notes

Executable Example

AMDP functions