‎2011 Jan 11 3:41 PM
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
‎2011 Jan 11 3:50 PM
There is stricter typing check in ABAP OO programming... the following should not give syntax error,
DATA: wa_level_text TYPE V_level_text.
‎2011 Jan 11 3:50 PM
There is stricter typing check in ABAP OO programming... the following should not give syntax error,
DATA: wa_level_text TYPE V_level_text.
‎2011 Jan 11 3:50 PM
Hello,
Why don't you declare it as DATA: wa_level_text type v_level_text?
Thanks.
Ramya.
‎2011 Jan 11 4:20 PM
>
> Hello,
>
> Why don't you declare it as DATA: wa_level_text type v_level_text?
>
> Thanks.
> Ramya.
Quote!
Types: begin of lvt_testvariable,
......,
end of lv_testvariable.
DATA: lv_testvariable type lvt_testvariable.