Skip to content

ABAP Keyword Documentation →  ABAP − Reference →  Processing External Data →  ABAP Database Access →  AMDP - ABAP Managed Database Procedures 

AMDP - Classes

An AMDP class is a global class in the class library that contains one or more of the following tag interfaces:

  • IF_AMDP_MARKER_HDB for the SAP HANA database

The names of the interfaces all start with IF_AMDP_MARKER and a suffix indicates the database system for which the ABAP Managed Database Procedures can be implemented in AMDP methods of the class.

An AMDP class can contain both regular methods and AMDP methods. It can contain one or more AMDP methods for each database system specified by a tag interface.

Other versions: 7.31 | 7.40 | 7.54


Example

Simple example for an AMDP class. The class CL_DEMO_AMDP_SCARR binds the interface IF_AMDP_MARKER_HDB and contains an AMDP method SELECT_SCARR that gets data from the database table SCARR:

METHOD select_scarr
       BY DATABASE PROCEDURE FOR HDB
       LANGUAGE SQLSCRIPT
       OPTIONS READ-ONLY
       USING scarr.
  scarr_tab =
  SELECT *
         FROM "SCARR"
         WHERE mandt = clnt
         ORDER BY carrid;
ENDMETHOD.

The following program section calls the method and produces the result.

DATA result TYPE cl_demo_amdp_scarr=>scarr_tab. 

NEW cl_demo_amdp_scarr( )->select_scarr( 
  EXPORTING clnt = sy-mandt 
  IMPORTING scarr_tab = result ). 

cl_demo_output=>display( result ).