Professional Documents
Culture Documents
Products
Products Industries
Industries Services and Support
Services Support Training
Training Community
Community Developer
Developer Partner
Partner About
About
Ask a Question Write a Blog Post Login
Naramani Siddu
November 23, 2016 5 minute read
https://blogs.sap.com/2016/11/23/step-by-step-procedure-for-creation-execution-and-storing-of-abap-managed-database-procedures-in-hana/ 1/13
6/14/2019 Step-by-Step procedure for creation, execution and storing of ABAP Managed Database Procedures in HANA | SAP Blogs
https://blogs.sap.com/2016/11/23/step-by-step-procedure-for-creation-execution-and-storing-of-abap-managed-database-procedures-in-hana/ 2/13
6/14/2019 Step-by-Step procedure for creation, execution and storing of ABAP Managed Database Procedures in HANA | SAP Blogs
Logic:
https://blogs.sap.com/2016/11/23/step-by-step-procedure-for-creation-execution-and-storing-of-abap-managed-database-procedures-in-hana/ 3/13
6/14/2019 Step-by-Step procedure for creation, execution and storing of ABAP Managed Database Procedures in HANA | SAP Blogs
Logic:
https://blogs.sap.com/2016/11/23/step-by-step-procedure-for-creation-execution-and-storing-of-abap-managed-database-procedures-in-hana/ 4/13
6/14/2019 Step-by-Step procedure for creation, execution and storing of ABAP Managed Database Procedures in HANA | SAP Blogs
6. Activate the AMDP Class and Check the created class in Transaction SE24.
https://blogs.sap.com/2016/11/23/step-by-step-procedure-for-creation-execution-and-storing-of-abap-managed-database-procedures-in-hana/ 5/13
6/14/2019 Step-by-Step procedure for creation, execution and storing of ABAP Managed Database Procedures in HANA | SAP Blogs
Logic:
REPORT zr_call_amdp.
PARAMETER p_vbeln TYPE vbeln.
* To Call AMDP Method
zcl_salesorder_details=>get_salesorder_details(
EXPORTING iv_vbeln = p_vbeln
IMPORTING et_order = data(lt_order) ).
* To display Sales Order Details
cl_demo_output=>display_data( name = ‘Sales Order Details’
value = lt_order ).
Output:
Provide the sales order number as the input
https://blogs.sap.com/2016/11/23/step-by-step-procedure-for-creation-execution-and-storing-of-abap-managed-database-procedures-in-hana/ 6/13
6/14/2019 Step-by-Step procedure for creation, execution and storing of ABAP Managed Database Procedures in HANA | SAP Blogs
2. Database procedure will create in HANA DB at the first call of AMDP Method .
3. Go to SAP HANA Development perspective –> HANA DB System –> Catalog –>
Schema –> Procedures.
The AMDP Method Implementation will be stored as Database procedure
and Table Types of AMDP Class also stored under Schema ‘SAPABAP1’.
https://blogs.sap.com/2016/11/23/step-by-step-procedure-for-creation-execution-and-storing-of-abap-managed-database-procedures-in-hana/ 7/13
6/14/2019 Step-by-Step procedure for creation, execution and storing of ABAP Managed Database Procedures in HANA | SAP Blogs
Logic:
create procedure
“ZCL_SALESORDER_DETAILS=>GET_SALESORDER_DETAILS”
(
in “IV_VBELN” NVARCHAR (000010),
out “ET_ORDER” “ZCL_SALESORDER_DETAILS=>GET_SALESORDER_DETAILS=>P00000#ttyp”
)
language sqlscript sql security invoker reads sql data as begin
–To get Sales Order details
et_order = SELECT vbak.vbeln,
vbap.posnr,
vbak.vkorg,
vbap.netwr as item_price,
CASE LFSTA
WHEN ‘ ‘ then ‘Not Relevant’
WHEN ‘A’ then ‘Not yet processed’
WHEN ‘B’ then ‘Partially processed’
WHEN ‘C’ then ‘Completely processed’
https://blogs.sap.com/2016/11/23/step-by-step-procedure-for-creation-execution-and-storing-of-abap-managed-database-procedures-in-hana/ 8/13
6/14/2019 Step-by-Step procedure for creation, execution and storing of ABAP Managed Database Procedures in HANA | SAP Blogs
END AS status
FROM “ZCL_SALESORDER_DETAILS=>VBAK#covw” AS vbak
INNER JOIN “ZCL_SALESORDER_DETAILS=>VBAP#covw” AS vbap
ON vbak.vbeln = vbap.vbeln
INNER JOIN “ZCL_SALESORDER_DETAILS=>VBUP#covw” AS vbup
ON vbup.vbeln = vbap.vbeln AND vbup.posnr = vbap.posnr
WHERE vbak.vbeln = iv_vbeln;
end;
6. ZCL_SALESORDER_DETAILS=>GET_SALESORDER_DETAILS#stb2#20160831121018 and
ZCL_SALESORDER_DETAILS=>GET_SALESORDER_DETAILS#stub#20160831121018 are for calling Database procedure
“ZCL_SALESORDER_DETAILS=>GET_SALESORDER_DETAILS”
Logic:
create procedure
“ZCL_SALESORDER_DETAILS=>GET_SALESORDER_DETAILS#stb2#20160831121018”
(
in “IV_VBELN” NVARCHAR (000010)
)
language sqlscript sql security invoker reads sql data as begin
call “ZCL_SALESORDER_DETAILS=>GET_SALESORDER_DETAILS” (
“IV_VBELN” => :IV_VBELN ,
“ET_ORDER” => :ET_ORDER
);
select * from :ET_ORDER;
end;
Logic:
create procedure
https://blogs.sap.com/2016/11/23/step-by-step-procedure-for-creation-execution-and-storing-of-abap-managed-database-procedures-in-hana/ 9/13
6/14/2019 Step-by-Step procedure for creation, execution and storing of ABAP Managed Database Procedures in HANA | SAP Blogs
“ZCL_SALESORDER_DETAILS=>GET_SALESORDER_DETAILS#stub#20160831121018”
(
in “IV_VBELN” NVARCHAR (000010)
)
language sqlscript sql security invoker reads sql data as begin
call “ZCL_SALESORDER_DETAILS=>GET_SALESORDER_DETAILS” (
“IV_VBELN” => :IV_VBELN ,
“ET_ORDER” => :ET_ORDER
);
select * from :ET_ORDER;
end;
7. The database tables VBAK VBAP and VBUP are used in AMDP Method will be created as VIEWS in HANA Database system.
i) ZCL_SALESORDER_DETAILS=>VBAK#covw
ii) ZCL_SALESORDER_DETAILS=>VBAP#covw
https://blogs.sap.com/2016/11/23/step-by-step-procedure-for-creation-execution-and-storing-of-abap-managed-database-procedures-in-hana/ 10/13
6/14/2019 Step-by-Step procedure for creation, execution and storing of ABAP Managed Database Procedures in HANA | SAP Blogs
iii) ZCL_SALESORDER_DETAILS=>VBUP#covw
Thank you,
Mani
Alert Moderator
Assigned tags
ABAP Development |
https://blogs.sap.com/2016/11/23/step-by-step-procedure-for-creation-execution-and-storing-of-abap-managed-database-procedures-in-hana/ 11/13
6/14/2019 Step-by-Step procedure for creation, execution and storing of ABAP Managed Database Procedures in HANA | SAP Blogs
By Jerry Wang , Dec 10, 2013
Tutorial: How to Debug an ABAP Managed Database Procedure
By Jasmin Gruschke , Jan 31, 2014
Related Questions
Connect to MySQL using ABAP for updating and Reading records - Step by Step procedure
By Former Member , Nov 10, 2016
Step by step procedure to create an Outbound IDOC's
By Former Member , Aug 24, 2007
Issue when processing the AMDP - Dump -- AMDP_UNCOMMITTED_DBPROC_CALLED
By Former Member , Mar 30, 2017
5 Comments
Martin Schlegel
Martin
Like (1)
Jonathan Choi
Like (1)
Reynaldo Tupiño
Like (0)
nikhil k
Like (0)
https://blogs.sap.com/2016/11/23/step-by-step-procedure-for-creation-execution-and-storing-of-abap-managed-database-procedures-in-hana/ 12/13
6/14/2019 Step-by-Step procedure for creation, execution and storing of ABAP Managed Database Procedures in HANA | SAP Blogs
Mohit Agrawal
July 23, 2018 at 4:43 am
Hi Mani,
Nice presentation.
Can you please let me know how can I achieve below through AMDP.
1. MAT_SALES table has commision group and materials. Many materials for a commision group.
2. If I want to explode my incoming data that every record for a commision group is exploded into as many records as number of
materials in MAT_SALES table for that particular commision gorup. Every data column would be same except the material for these
exploded records?
Any idea?
Thanks
Mohit
Like (0)
Sitemap Newsletter
https://blogs.sap.com/2016/11/23/step-by-step-procedure-for-creation-execution-and-storing-of-abap-managed-database-procedures-in-hana/ 13/13