10-31-2005 9:05 PM
Hy !
Friends, i have a report alv-grid, this report using a dynamic table, this dynamic table was created using fieldcats, my doubt, how can i can do to put the structure LVC_T_SCOL in fieldcat ? i need this structure to use color in cells.
Example:
OBS: this example is incorrect...
COLOR_CELL
i = i + 1.
CLEAR afield2.
afield2-col_pos = i.
afield2-fieldname = 'COLOR_CELL'.
afield2-inttype = 'h'. " Tipo de campo
afield2-ref_table = 'LVC_T_SCOL'.
afield2-ref_field = 'COLOR_CELL'.
APPEND afield2 TO it_fieldcatalog.
Thanks.
Fabrício
10-31-2005 11:02 PM
Hi,
LVC_T_SCOL will be used to fill your output internal table. you can use this to fill the colors for each line differently based on conditional data.
Hope the example below helps you.
regards,
Satya
*--- Internal table holding list data
DATA BEGIN OF gt_list OCCURS 0 .
INCLUDE STRUCTURE SFLIGHT .
DATA rowcolor(4) TYPE c .
DATA cellcolors TYPE lvc_t_scol .
DATA END OF gt_list .
A sample code to make the cell at row 5 and column MATNR colored
DATA ls_cellcolor TYPE lvc_s_scol .
...
READ TABLE gt_list INDEX 5 .
ls_cellcolor-fname = 'MATNR' .
ls_cellcolor-color-col = '7' . "colors as in the write
ls_cellcolor-color-int = '1' . "intensified on 1 / 0 off
APPEND ls_cellcolor TO gt_list-cellcolors .
MODIFY gt_list INDEX 5 .
10-31-2005 11:02 PM
Hi,
LVC_T_SCOL will be used to fill your output internal table. you can use this to fill the colors for each line differently based on conditional data.
Hope the example below helps you.
regards,
Satya
*--- Internal table holding list data
DATA BEGIN OF gt_list OCCURS 0 .
INCLUDE STRUCTURE SFLIGHT .
DATA rowcolor(4) TYPE c .
DATA cellcolors TYPE lvc_t_scol .
DATA END OF gt_list .
A sample code to make the cell at row 5 and column MATNR colored
DATA ls_cellcolor TYPE lvc_s_scol .
...
READ TABLE gt_list INDEX 5 .
ls_cellcolor-fname = 'MATNR' .
ls_cellcolor-color-col = '7' . "colors as in the write
ls_cellcolor-color-int = '1' . "intensified on 1 / 0 off
APPEND ls_cellcolor TO gt_list-cellcolors .
MODIFY gt_list INDEX 5 .
11-01-2005 11:26 AM
Hi !
I understod your explanation, but, my dynamic internal table was created using fieldcats, i´ve tried to do it as in the example above, but a short dump has ocurred.
Thanks.