Accessing table data from SAP system


Using Select statement you can read data with a dynamic table name. Try using below code &are

DATA: lv_tablename TYPE string,
   ev_filelength TYPE i.
lv_tablename = 'mara'. "e.g. a parameter
DATA dref TYPE REF TO data.
CREATE DATA dref TYPE TABLE OF (lv_tablename).
FIELD-SYMBOLS: <wa> TYPE ANY TABLE.
ASSIGN dref->* to <wa>.
SELECT * FROM (lv_tablename) INTO TABLE <wa>.


Updated on: 14-Feb-2020

422 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements