Skip to Content

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

Looping at variated internal tables with one single statement

Hello guys,

I'm tring to loop at tree different tables with the same loop statement.

The code looks like this:

DATA w_table_name TYPE string.

IF r_contr = 'X'. " Contratos

w_table_name = 'it_contrato'.

ELSEIF r_oper = 'X'. " Operandos

w_table_name = 'it_operando'.

ENDIF.

LOOP AT (w_table_name).

CODE...

ENDLOOP.

The problem is, it dosen't work at all!

I've also tried to use FIELD-SYMBOLS, but it failed again (field-symbols don't support this kind of reference).

Thanks for the help.

Daniel Parreira

Former Member
Not what you were looking for? View more on this topic or Ask a question