Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to refresh ALV list ?

Former Member
0 Kudos
150

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos
77

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.

3 REPLIES 3

Former Member
0 Kudos
77

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

Former Member
0 Kudos
77

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


Former Member
0 Kudos
78

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.