2006 Sep 05 10:01 PM
Hi all
I have declared my internal table in my program as
data : itab_wa type ZRESULT_LINE,
itab type ZRESULT_ROW.
Where ZRESULT_LINE and ZRESULT_ROW are the structure and table types.
Now I want to add
data: TCOLOR TYPE SLIS_T_SPECIALCOL_ALV.
in my internal table declaration. How can I do this. Please remember I need to have work area and body in my internal table as I have used work area and body in my code.
Waiting..............
Message was edited by: Raju Boda
Hi all
I have declared my internal table in my program as
data : itab_wa type ZRESULT_LINE,
itab type ZRESULT_ROW.
Where ZRESULT_LINE and ZRESULT_ROW are the structure and table types.
Now I want to add
data: TCOLOR TYPE SLIS_T_SPECIALCOL_ALV.
in my internal table declaration. How can I do this. Please remember I need to have work area and body in my internal table as I have used work area and body in my code.
Waiting..............
Message was edited by: Raju Boda
2006 Sep 05 10:06 PM
If the table type is SLIS_T_SPECIALCOL_ALV, then your work area would be SLIS_SPECIALCOL_ALV. So your declaration will be like
DATA : it_color type SLIS_T_SPECIALCOL_ALV,
wa_color type SLIS_SPECIALCOL_ALV.
Also you need to include the following statement in the TOP include of your program:
TYPE-POOLS: SLIS.
hith
Sunil Achyut
Message was edited by: Sunil Achyut
2006 Sep 05 10:08 PM
HI,
See the Declarion types of workarea and Internal tables
* Table declaration (old method)
DATA: BEGIN OF tab_ekpo OCCURS 0, "itab with header line
ebeln TYPE ekpo-ebeln,
ebelp TYPE ekpo-ebelp,
END OF tab_ekpo.
*Table declaration (new method) "USE THIS WAY!!!
TYPES: BEGIN OF t_ekpo,
ebeln TYPE ekpo-ebeln,
ebelp TYPE ekpo-ebelp,
END OF t_ekpo.
DATA: it_ekpo TYPE STANDARD TABLE OF t_ekpo INITIAL SIZE 0, "itab
wa_ekpo TYPE t_ekpo. "work area (header line)
* Build internal table and work area from existing internal table
DATA: it_datatab LIKE tab_ekpo OCCURS 0, "old method
wa_datatab LIKE LINE OF tab_ekpo.
* Build internal table and work area from existing internal table,
* adding additional fields
TYPES: BEGIN OF t_repdata.
INCLUDE STRUCTURE tab_ekpo. "could include EKKO table itself!!
TYPES: bukrs TYPE ekpo-werks,
bstyp TYPE ekpo-bukrs.
TYPES: END OF t_repdata.
DATA: it_repdata TYPE STANDARD TABLE OF t_repdata INITIAL SIZE 0, "itab
wa_repdata TYPE t_repdata. "work area (header line.
you need to maintain same structure for both workarea as well Internal table
Regards
Sudheer
2006 Sep 05 11:23 PM
2006 Sep 05 11:32 PM
i think you are using nested table for coloring the cells
use this way..
types: begin of i_struc,
field1 type ....,
field2 type ....,
field3 type ....,
field4 type ....,
TCOLOR TYPE SLIS_T_SPECIALCOL_ALV,
end of i_struc.
data: itab type standard table of i_struc,
line type i_struc,
col_line type slis_specialcol_alv.
now while populating
col_line-fild = ''
..
..
line-tcol = col_line.
append line to itab.
2006 Sep 05 11:34 PM
data : tcol type slis_t_specialcol_alv,
scol type slis_specialcol_alv.
scol-filed1 = ''
scol-filed1 = ''
scol-filed1 = ''
append scol to tcol.
move this tcol to your line.
then append this line to your internal table.
all the best
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |