2009 May 05 11:10 AM
hi,
In ALV grid, after we've changed some data in its internal table , now we want to refresh the list and change color for some line , how can we do this. we use REUSE_ALV_GRID_DISPLAY.
Thanks
2009 May 05 11:46 AM
Hi,
Refer to this piece of code..
DATA rowcolor(4) TYPE c .
DATA cellcolor TYPE lvc_t_scol .
DATA ls_cellcolor TYPE lvc_s_scol .
...
READ TABLE it_ekko INDEX 5 .
ls_cellcolor-fname = 'MATNR' .
ls_cellcolor-color-col = '7' .
ls_cellcolor-color-int = '1' .
APPEND ls_cellcolor TO it_ekko-cellcolors .
MODIFY it_ekko INDEX 5 .
This would color the cell at row 5 and column 'MATNR'
This is for just one single cell, you may do it for entire row and/or column.
Call whichever ALV FM you are using again and it will work.
Regards.
2009 May 05 11:21 AM
Hi,
define a field colr in the field list,and declare
COLOR TYPE SLIS_T_SPECIALCOL_ALV,
and also
DATA: COLOR_TAB TYPE SLIS_SPECIALCOL_ALV,
COLOR_COL TYPE SLIS_COLOR.
then u can fill the lines with colors.
Regards,
jaya
2009 May 05 11:33 AM
hi
try this code
data : LD_COLOR(1) TYPE C,
LINE_COLOR(4) TYPE C.
FORM LAYOUT_INIT USING P_I_SLIS_LAYOUT_ALV.
V_REPID = SY-REPID.
V_LAYOUT-ZEBRA = 'X'.
V_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
V_LAYOUT-INFO_FIELDNAME = 'LINE_COLOR'.
ENDFORM. " LAYOUT_INIT
FORM USER_COMMAND USING P_UCOMM LIKE SY-UCOMM
P_SELFIELD TYPE SLIS_SELFIELD.
<write ur refresh code>
CONCATENATE 'C' LD_COLOR '10' INTO <itab>-LINE_COLOR.
P_SELFIELD-REFRESH = 'X'.
ENDFORM. "alv_user_command
2009 May 05 11:46 AM
Hi,
Refer to this piece of code..
DATA rowcolor(4) TYPE c .
DATA cellcolor TYPE lvc_t_scol .
DATA ls_cellcolor TYPE lvc_s_scol .
...
READ TABLE it_ekko INDEX 5 .
ls_cellcolor-fname = 'MATNR' .
ls_cellcolor-color-col = '7' .
ls_cellcolor-color-int = '1' .
APPEND ls_cellcolor TO it_ekko-cellcolors .
MODIFY it_ekko INDEX 5 .
This would color the cell at row 5 and column 'MATNR'
This is for just one single cell, you may do it for entire row and/or column.
Call whichever ALV FM you are using again and it will work.
Regards.