Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

writing down a tables content generic

Hi experts,

simple question :

When I start the program to be coded, I enter the name of a r/3 table (such as TSAD2).

I save the name in an ordinary char variable.

How can I display the entire content of the table now?

Remember : It is supposed to be generic, so you can't see the table name as pre-requisit.

My first thought was to save the entire r/3 table into an internal table (to reduce rfc calls and traffic) and to display it via a loop at-iteration, but I fail with retrieving the table content.

REPORT z_smoftables_test.

PARAMETERS : input_tablename type char20.

*call the table namend after the user input and save it

*create a generic structure "like line of r/3 table" ---you have to have called the table before...thats my problem

*loop table into structure and write

Thanks in advance!



For anything dynamic about data, check articles about RTTS (Run Time Type Services). See [this|] for a quick overview. Basically with that you can retrieve metadata about types, modify them (at least for structures), dynamically create variables, internal tables, ...

It is certainly not an easy subject, but worth investing some time on it.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question