Skip to Content
-1

AMDP Error while reading huge data

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Feb 20, 2019 at 01:04 PM

    Here is the error message


    error.png (15.0 kB)
    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.