04-10-2006 5:40 AM
Hello Everyone,
While declaring the internal table as:
TYPES: BEGIN OF t_data.
INCLUDE STRUCTURE mara.
TYPES: END OF t_data.
DATA: it_data TYPE table of t_data.
When performing extended check, i get following error:
The current ABAP command is obsolete and problematic, especially so in ABAP
Objects
Within classes and interfaces, you can only use "TYPE" to refer to ABAP Dictionary
types, not "LIKE" or "STRUCTURE".
I am using 4.7 version.
Any clue how to avoid this error during extended check.
Regards,
Tarun
04-10-2006 5:44 AM
Tarun,
Use it like this.
TYPES : T_DATA type table of MARA.
Regards,
Ravi
04-10-2006 5:47 AM
Hello Ravi,
Suppose i have the requirement like this:
types: begin of t_data,
werks type werks_d.
include structure mara
types: end of t_data.
Data: gt_data type table of t_data.
Then how to avoid the error getting in extended check.
Regards,
Tarun
04-10-2006 5:50 AM
Tarun,
With WAS 6.20 you should not declare internal tables with header line or using the old syntax as they are not compatible with OO ABAP.
So, you either declare a TYPE the way you have done, in case you want additional fields apart from the INCLUDE structure, or declare the table directly like the way I have shown.
Good thing, you can even specify the type of internal table that you want to create using this - STANDARD, SORTED, HASH. These tables will help you with the performance issues.
regards,
Ravi
Note : Please mark the helpful answers
04-10-2006 5:55 AM
Hi,
try this.
TABLES : MARA.
DATA : BEGIN OF T_DATA OCCURS 0.
WERKS TYPE WERKS_D.
INCLUDE STRUCTURE MARA.
DATA : END OF RFCTAB.
Hope it helps.
Regards,
Shashank