2015 Apr 24 4:53 PM
Hi,
I am bit confused about accessing or referring class attributes definition in program..
for example.
below is my first class in that i have declared table type and internal table.
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
TYPES : BEGIN OF LTY_BOM_LIST,
EQUNR TYPE C LENGTH 18,
STLNR TYPE C LENGTH 8,
EQKTX TYPE C LENGTH 40,
IWERK TYPE C LENGTH 4,
SWERK TYPE C LENGTH 4,
END OF LTY_BOM_LIST.
DATA : LT_BOM_LIST TYPE STANDARD TABLE OF LTY_BOM_LIST.
In program suppose i need to declare another internal table with same type which is declared in class.
Any suggestion?
-Amit
2015 Apr 24 5:30 PM
Hi You use the below code if y:
DATA : itab TYPE TABLE OF <class_name>=><type_name>
e.g.
CLASS lcl_test DEFINITION.
PUBLIC SECTION.
TYPES : BEGIN OF ty_lcl,
matnr TYPE matnr,
END OF ty_lcl.
DATA : it_mara TYPE TABLE OF ty_lcl.
ENDCLASS.
START-OF-SELECTION.
DATA : itab TYPE TABLE OF lcl_test=>ty_lcl. " declaration
Thanks & Regards-
Vishal
2015 Apr 24 5:30 PM
Hi You use the below code if y:
DATA : itab TYPE TABLE OF <class_name>=><type_name>
e.g.
CLASS lcl_test DEFINITION.
PUBLIC SECTION.
TYPES : BEGIN OF ty_lcl,
matnr TYPE matnr,
END OF ty_lcl.
DATA : it_mara TYPE TABLE OF ty_lcl.
ENDCLASS.
START-OF-SELECTION.
DATA : itab TYPE TABLE OF lcl_test=>ty_lcl. " declaration
Thanks & Regards-
Vishal