Hello Experts,
I am receiving below dump when calling my AMDP method. I am not able to figure out the reason.
Request your help. Google has resulted only 7 results for this dump. None seem relevant.
Dump details:
Category ABAP programming error Runtime Errors AMDP_EXECUTION_FAILED Except. CX_AMDP_EXECUTION_FAILED ABAP Program ZCL_AMDP_EXAMPLE==============CPApplication Component Not assigned
Dump location: The dump occurs at declaration of AMDP method i.e. at below statement
METHOD GET_MAT_DET_AMDP
BY DATABASE PROCEDURE FOR HDB
LANGUAGE SQLSCRIPT
options READ-ONLY
using mara makt marc.
Report call: The report calls method GET_MAT_DET2 which calls method GET_MAT_DET_AMDP
AMDP Class details
CLASS zcl_amdp_example DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES if_amdp_marker_hdb.
TYPES: BEGIN OF ty_mara,
matnr TYPE mara-matnr,
ersda TYPE mara-ersda,
ernam TYPE mara-ernam,
maktx TYPE makt-maktx,
END OF ty_mara,
tt_mara TYPE TABLE OF ty_mara.
TYPES: BEGIN OF ty_marc,
matnr type mara-matnr,
werks type marc-werks,
END OF ty_marc,
tt_marc type TABLE OF ty_marc.
methods GET_MAT_DET2
importing
IM_MATNR type MARA-MATNR
exporting
EX_MATDET type TT_MARA
EX_MARC type TT_marc.
PROTECTED SECTION.
private section.
methods GET_MAT_DET_AMDP
importing
VALUE(IM_MATNR) type MARA-MATNR
exporting
VALUE(IM_client) type mandt
VALUE(EX_MATDET) type TT_MARA
VALUE(EX_MARC) type TT_marc.
ENDCLASS.
CLASS ZCL_AMDP_EXAMPLE IMPLEMENTATION.
METHOD GET_MAT_DET_AMDP
BY DATABASE PROCEDURE FOR HDB
LANGUAGE SQLSCRIPT
options READ-ONLY
using mara makt marc.
ex_matdet = SELECT mara.matnr,
mara.ersda,
mara.ernam,
makt.maktx
FROM mara as mara JOIN makt as makt
on mara.mandt = makt.mandt
AND mara.matnr = makt.matnr
WHERE mara.mandt = :im_client
AND mara.matnr = :im_matnr
AND makt.spras = 'E';
ex_marc = SELECT marc.matnr, marc.werks
from marc as marc JOIN :ex_matdet as ex_matdet
ON marc.matnr = ex_matdet.matnr
where marc.mandt = :im_client
and marc.matnr = :im_matnr;
ENDMETHOD.
METHOD GET_MAT_DET2.
CALL METHOD get_mat_det_amdp
EXPORTING
im_matnr = im_matnr
IMPORTING
im_client = sy-mandt
ex_matdet = ex_matdet
ex_marc = ex_marc.
ENDMETHOD.
ENDCLASS.
Report details
REPORT zgen_amdp_example.
PARAMETERS: p_matnr type mara-matnr.
DATA: it_matdet TYPE zcl_amdp_example=>tt_mara,
it_marc TYPE zcl_amdp_example=>tt_marc.
* instantiation
DATA(lo_amdp_example) = new zcl_amdp_example( ).
* execution
lo_amdp_example->get_mat_det2(
EXPORTING
im_matnr = p_matnr
IMPORTING
ex_matdet = it_matdet
ex_marc = it_marc
).
Hello Sanket,
please can you add an exception handling to your method call to find out more details (add exception class CX_AMDP_ERROR to the declaration fo method GET_MET_DET2 and catch the exception when the method is called; check with methods GET_TEXT, GET_LONGTEXT if more details are provided).
Another point is how you work with the client. It is not correct that the client is an exporting parameter in the AMDP method. You have to declare it as importing parameter to be able to use it successfully with the correct client value in your where clause. As you have used already the naming convention IM_CLIENT I think it was already in your mind to do so.
Regards,
Florian
Add a comment