Skip to Content

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

declaring table of type any table

Is it possible to declare a table variable of type any table

data: i_tab type any table.

I know this can be done as a parameter in the interface of a function module but can it be done in a program. I have a strong requirement to do such a thing.

I need to write some code in a user exit function module, the interface of which contains many tables. I want to call a program dynamically based on which of the tables has been populated.

if i_tab1 is not initial. 
move itab1 to i_tab.
elseif i_tab2 is not initial.
move itab2 to i_itab.
....
...
endif. 

perform routine from program (lv_prog_name) tables i_tab.

and then I can create numerous programs

Tags:
Former Member
Former Member replied

Hi,

I think your itab is declared with header line..

Try adding the body operator..

ASSIGN itab[] TO <fs>.

Thanks

Naren

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