on 2019 Feb 20 4:12 AM
Hi Everyone,
I am new to ABAP on HANA, I have written a small code in AMDP to read data from my CDS view which is a combination MARA, MARC and MARD tables. The final result of the table should contain 88226275 records(Based on MARD records), but When i execute the program in DEV by using AMDP some exception is happening. Where as when i execute the program with direct select i am seeing 88226275 in my internal table.
Can any one tell me how to get rid of the error.
Here is my code of calling program
START-OF-SELECTION.
.
DATA(lo_amdp) = NEW zgtest_amdp( ).
TRY.
lo_amdp->fetch_matnr_data( EXPORTING ev_client = sy-mandt IMPORTING et_material = DATA(lt_data) ).
CATCH cx_amdp_error INTO DATA(lo_amdp_error).
ENDTRY.
IF lo_amdp_error IS BOUND.
MESSAGE lo_amdp_error->get_longtext( ) TYPE 'I'.
ENDIF.
* This select brings the data
select mandt,
matnr,
werks,
lgort
FROM mard
INTO TABLE @lt_data.
My class code
CLASS zgtest_amdp DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES: if_amdp_marker_hdb.
TYPES: BEGIN OF ty_material,
mandt TYPE mara-mandt,
matnr TYPE mara-matnr,
werks TYPE marc-werks,
lgort TYPE mard-lgort,
END OF ty_material,
tt_material TYPE STANDARD TABLE OF ty_material WITH EMPTY KEY.
METHODS: fetch_matnr_data IMPORTING VALUE(ev_client) TYPE sy-mandt
EXPORTING VALUE(et_material) TYPE tt_material
RAISING cx_amdp_error.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS zgtest_amdp IMPLEMENTATION.
METHOD fetch_matnr_data
BY DATABASE PROCEDURE FOR HDB LANGUAGE SQLSCRIPT OPTIONS READ-ONLY USING zmat_det_001.
et_material =
select
* TOP 5000 " This line is written to make my AMDP work which is commented now
*
from zmat_det_001
where mandt = ev_client
order by mandt, matnr, werks, lgort;
endmethod.
ENDCLASS.
Thanks and regards,
Gupta
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
70 | |
10 | |
10 | |
7 | |
6 | |
6 | |
6 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.