Application Development Blog Posts
Learn and share on deeper, cross technology development topics such as integration and connectivity, automation, cloud extensibility, developing at scale, and security.
cancel
Showing results for 
Search instead for 
Did you mean: 
sundaresan_k
Explorer
0 Kudos

Just a recap of ABAP Managed Database Procedures (AMDP)   another amazing feature for code push down introduced in AS ABAP 7.4 SP5,

AMDP allows you to do code-push down to HANA and is ideal in cases where there is  scope for making use of HANA specific features during code push down. AMDPs enable you to create database procedures directly in ABAP using e.g. SQL Script and to seamlessly integrate it in modern ABAP development. An AMDP can be implemented using an ABAP method.


An overview about the new AMDP features introduced in AS ABAP 7.4 SP8 by horst.keller

In general AMDP methods when called are executed on SAP standard database (primary HANA database). From AS ABAP 7.4 SP8 onwards it is possible to call AMDP method implementation by specifying a database connection explicitly

Special Input Parameter

  • An input parameter with the name connection and type DBCON_NAME needs to be declared for an AMDP method.

class zcl_demo_amdp definition
  public
  final
  create public .
  public section.
    interfaces if_amdp_marker_hdb .
    methods increase_price
      importing
                value(connection) type dbcon_name default ''
                value(clnt)       type sy-mandt
                value(inc)        type sflight-price
      raising   cx_amdp_error.
endclass

Calling the AMDP Method with Connection information

    • Pass initial value or the value "DEFAULT" to use the standard database connection
    • Pass as value a name "R/3*name"(With prefix “R3*” in upper case letters and a user-defined name “name” (case sensitive)) to use a service connection of this name “name”



****  Call using Standard Database Connection(Primary HANA DB)
    lo_amdp_demo->increase_price(
      exporting
        connection    = 'DEFAULT'
        clnt          = '000'
        inc           =  10
    ).
 
****  Call using named Database Connection "SECDB"
    lo_amdp_demo->increase_price(
      exporting
        connection    = 'R/3*SECDB'
        clnt          = '000'
        inc           =  10
    ).

Restricted Names

The names "R/3*AMDP_SYNC" and "R/3*AMDP_ADBC" are reserved for the AMDP framework and would lead to exceptions at runtime if used.

7 Comments