
New AMDP Debugger available in ADT starting with release ABAP 7.5. Check how to use it here... |
This document describes how to debug an ABAP Managed Database Procedure in SAP NetWeaver 7.4 SP5 and higher.
For a video tutorial please visit How to debug an ABAP Managed Database Procedure (AMDP) - YouTube.
In order to debug an ABAP Managed database procedure (AMDP) in AS ABAP 7.4 SP5, an ABAP user as well as a HANA user is required.
We assume that the AMDB is executed via an ABAP report and is subject to a debugging procedure initiated by the HANA user DEBUGUSER.
For the ABAP user the standard ABAP authorization to execute the corresponding report is required.
For the HANA user DEBUGUSER, the authorization to read the catalogue needs to be granted by the SYSTEM user:
grant catalog read to DEBUGUSER;
Additionally, debugging authorizations are required as described in SAP note 1942471 (http://service.sap.com/sap/support/notes/1942471). According to the note, for SAP HANA releases >= SPS7, three authorizations are required:
The corresponding grant statements to be executed in the SQL console of the SAP HANA studio (as SAP<SID> user) for the ABAP Managed DB procedure <AMDP_NAME> are:
grant debug on "SAPHANAABAP"."<AMDP_NAME>" to DEBUGUSER;
grant execute on "SAPHANAABAP"."<AMDP_NAME>" to DEBUGUSER;
grant attach debugger to DEBUGUSER;
Alternatively, the grant statements for the authorization to debug any ABAP Managed database procedure in the schema SAPHANAABAP are:
grant debug on schema SAPHANAABAP to DEBUGUSER;
grant select on schema SAPHANAABAP to DEBUGUSER;
grant attach debugger to DEBUGUSER;
Remark: For SAP HANA release SPS6, only the authorization to execute SYS.DEBUG is required.
Since ABAP Managed database procedures are created in the HANA catalogue at first execution – during ABAP class activation – you might need to generate the catalogue object before you can start the debugging. For this purpose you can execute the ABAP report RSDBGEN_AMDP.
Go to the SAP HANA Development perspective and open the ABAP Managed database procedure (AMDP) catalogue object you would like to debug:
In this document, the ABAP report ZR_DEMO_AMDP is executed. In the report the call of the class method zcl_demo_amdp=>get_open_so_inv_for_customer leads to the call of the corresponding AMDP procedure. The coding for both, the ABAP report and the ABAP class, can be found in the attached files.
Remark: Please explicitely terminate the debugging process once you are finished. The debug procedure described attaches externally to a running session based on certain filter criteria (in our case "HANA user" SAPHANAABAP and "Application user" DEVELOPER) and if an active breakpoint is set. Therefore, you might accidentially/unintentionally debug a colleagues' report execution if the criteria are matched - your colleague then either has to wait until you press F8 or until the debugger time out helps .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
3 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |