‎2006 Aug 26 7:44 PM
Hello all,
I need some help in declaring internal table.
I have declared my internal table as
data : itab_wa type ZRESULT_LINE,
itab type ZRESUULT_ROW.
Where ZRESULT_LINE is a structure with FIELD1, FIELD2 and FIELD3. Now I want to add
TCOLOR TYPE SLIS_T_SPECIALCOL_ALV,
in my internal table declaration so that it has the declaration similar to
DATA: BEGIN OF itab OCCURS 0,
FIELD1,
FIELD2,
FIELD3,
<b> TCOLOR TYPE SLIS_T_SPECIALCOL_ALV,</b>
END OF itab.
How can I do this please help. I have to use the structure ZRESULT_LINE in my internal table. Waiting....
‎2006 Aug 26 7:48 PM
Hi,
DATA: BEGIN OF itab OCCURS 0.
INCLUDE STRUCTURE ZRESULT_LINE.
DATA: TCOLOR TYPE SLIS_T_SPECIALCOL_ALV,
END OF itab.
Thanks,
Naren
‎2006 Aug 26 7:55 PM
HI Narendran,
In my code I already used <b>itab_wa</b> (work area) and <b>itab</b> (body) so I dont want to change my code as I have many lines of code. Can you change your sample declaration so that it has <b>itab_wa</b> (work area) and <b>itab</b> (body).
Waiting............
‎2006 Aug 26 8:00 PM
then use the below code..
data: begin of itab_wa.
include structure zresult_line.
data: tcolor type slis_t_specialcol_alv,
end of itab_wa.
data itab like table of itab_wa.
Cheers,
Abdul Hakim
‎2006 Aug 26 7:49 PM
Try like this.
DATA: BEGIN OF itab OCCURS 0,
FIELD1,
FIELD2,
FIELD3,
DATA: TCOLOR TYPE SLIS_T_SPECIALCOL_ALV,
END OF itab.
Thanks,
‎2006 Aug 26 7:54 PM
hi
if ZRESULT_LINE is a structure then your internal table declaration is wrong.
it should be like
<b>data itab like table of zresult_line</b>.
if you wanna add additional field then you could add the same to your structure ZRESULT_LINE by going into SE11 if the structure created thru ABAP Dictionary.
Also you can use the below syntax.
data: begin of itab occurs 0.
include structure zresult_line.
data: tcolor type slis_t_specialcol_alv,
end of itab.
Also note that internal table with header lines are oldest forms of internal table and it wont be supported in OO Context..
Cheers,
Abdul Hakim
‎2006 Aug 26 10:13 PM
Hi,
if you have already declared the itab_wa and if you want to use the work area in the internal table.
DATA: ITAB LIKE ITAB_WA OCCURS 0 WITH HEADER LINE.
Hope this works..
Thanks,
Naren
‎2006 Aug 27 8:21 AM
Hello Raju
That's how I would define the structure (of course never using header lines which are only a soure of errors):
TYPES: begin of ty_s_line.
INCLUDE TYPE zresult_line.
INCLUDE TYPE slis_t_specialcol_alv AS tcolor.
TYPES: end of ty_s_line.
TYPES: ty_t_itab TYPE STANDARD TABLE of ty_s_line
WITH STANDARD KEY.
DATA:
gt_itab TYPE ty_t_itab,
gs_line TYPE ty_s_line.
Regards
Uwe