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: 
JerryWang
Advisor
Advisor

ABAP Managed Database Procedures are new feature available in AS ABAP 7.40, SP05 which enables you to manage and call stored procedures or database procedure in AS ABAP. An ABAP Managed Database Procedure is a procedure written in its database-specific language (Native SQL, SQLScript, ...) implemented in an AMDP method of an AMDP class.

I use a simple example to show how it works. In line 21 the check is done against database type. Since I will demonstrate to manage and call store procedure writtin in SQLScript in HANA, the sample must be running in HANA DB.

http://farm6.staticflickr.com/5473/11303408906_88f9f419c6_o.png

http://farm3.staticflickr.com/2809/11303432254_5a6ef6e018_o.png

Then in line 26 a pop up is displayed to allow user input how much price he would like to increase. In line 33, the price is increased by calling

HANA store procedure, with the help of AMDP class CL_DEMO_AMDP.

An AMDP class to handle with HANA stuff must inherit the tag interface IF_AMDP_MARKER_HDB

http://farm4.staticflickr.com/3832/11303376995_9ce72c0e7b_o.png

And AMDP method must specify the database type ( HDB ) and language type ( SQLSCRIPT ) using keyword shown below.

The ":" in line 4 and line 5 are specific syntax of SQLScript - the importing parameter should have it as prefix.

http://farm8.staticflickr.com/7372/11303376945_36b91f586f_o.png

The most important part is the AMDP class could not be developed in SAP GUI, but only possible in ABAP development Tools ( i.e ABAP in Eclipse)

http://farm6.staticflickr.com/5506/11303418906_be85370fe6_o.png

http://farm3.staticflickr.com/2844/11303408616_6ab2c8d047_o.png

Every AMDP method corresponds to a store procedure which you can find in HANA studio. Or you can also find it via ST05:

http://farm8.staticflickr.com/7314/11303432054_ff70a15540_o.png

Meanwhile this document Implement and consume your first ABAP Managed Database Procedure on HANA also introduces another good example.

6 Comments