Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8545

Re: Declare a "type" table using parameter

$
0
0

Have a look at this snippet. It creates a data reference of table type specified by user, and then uses a select query to populate 10 records of that database table to data reference via field symbol.

 

PARAMETERS tabname TYPE dd02l-tabname OBLIGATORY DEFAULT 'MARA'.

DATA dref TYPE REF TO data.

CREATE DATA dref TYPE STANDARD TABLE OF (tabname).

FIELD-SYMBOLS <fs> TYPE ANY TABLE.

ASSIGN dref->* TO <fs>.

SELECT * FROM (tabname) INTO TABLE <fs> up to 10 rows.


Viewing all articles
Browse latest Browse all 8545


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>