Hello,
The codes below works fine from a stand alone ABAP program.
TYPES: BEGIN OF v_level_text,
level type /BI0/HPROD_HIER-tlevel,
text type /BI0/TPROD_HIER-txtlg,
END OF v_level_text.
DATA: i_level_text type table of v_level_text.
DATA: wa_level_text like line of i_level_text. ***** error is from this line *******
However, when put in a method, I get the error
E:Within classes and interfaces, you can only use "TYPE" to refer to ABAP Dictionary types, not "LIKE" or "STRUCTURE'.
When I changed 'LIKE' to 'TYPE', I get the error as below:
E:The type "I_LEVEL_TEXT" is unknown, but there is a type with the similar name "V_LEVEL_TEXT". "V_LEVEL_TEXT.
Please advise the correct way to rewrite this code so can work in OO.
Thanks,
Ravi