How can i create a workarea from an internal table in a method of a class. the problem is that the internal table gets a generic type when passing it to the method.
i tried:
data wa type ref to data.
create data wa like line of itab.
but when trying...
loop itab into wa.
... i get a conversion error.
Hello Tobias,
the brutal way is:
Define into the method (or global) an internal table as
you need and relate the passing table to it.
fex.:
data: lt_tab type standard table of 'Hugo'.
data: lf_itab type 'HUGO'.
lt_tab[] = Par_Tab[]. " type any table
loop at itab into lf_itab.
...
endloop.
Hope i could help You
BR
Michael
Hallo Tobias,
if you really need a workarea you can also use the following:
DATA: wa TYPE REF TO data.
FIELD-SYMBOLS: <wa> TYPE ANY.
CREATE DATA wa LIKE LINE OF itab.
ASSIGN wa->* TO <wa>.
LOOP AT itab INTO <wa>.
ENDLOOP.
Regards,
Oliver
Add a comment