Skip to Content

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 can be found hereABAP News for 7.40, SP08 – ABAP Managed Database Procedures (AMDP)

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.

To report this post you need to login first.

5 Comments

You must be Logged on to comment or reply to a post.

  1. Albrecht Gass

    Hi,

    along the same lines I remember a session at TechEd a few years ago where SAP demonstrated the ability to configure which DB connection to use for a given program and/or table.  This was in conjunction with using HANA in the side car scenario.

    I have tried to find the information on how to do this but was not successful, does anybody remember how to do this? As fas as I recall you would invoke transaction (I think it stated with R and contained ADMIN) and then have the ability to say for program X use DB connection Y.

    During the presentation they ran the program on the standard RDBMS, then changed the configuration to use HANA using the elusive transaction and rerun the program and you saw tremendous improvements.

    My question therefore, does anybody recall how to do this?

    Thanks

    Albrecht

    (0) 
    1. Panneer Selvam

      Hi Albrecht,

      I think you are talking about ERP accelerators with HANA as secondary DB. The use case you mentioned can be achieved with the help of RDA (Redirect Data Access).

      RDA configuration is maintained using the report RDA_MAINTAIN. The configuration entries are filled in RDA_CONTROL, RDA_CONFIG and RDA_CONTEXT tables.

      Regards,

      Panneer

      (0) 
  2. 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

    This sentence in the above blog raises the expectation, that you can connect to any database using AMDP. But please be aware, that only secondary connections to the current SAP standard database can be used in AMDP. No connections to other databases!

    These so called service connections to the same database can be useful for performing operations in a database LUW, which does not depend on the LUW standard connection.

    (0) 

Leave a Reply