10-01-2008 12:00 PM
hi all,
in an alv list in which fields are made editable, i want make the entire row grayed out for particular condition. how can it be done. i know to gray individual fields, but i want to gray the entire row.
Thanks in advance.
Regards,
Radhika
10-01-2008 12:08 PM
Use style in this case.
use the style CL_GUI_ALV_GRID=>MC_STYLE_DISABLED to disable a particular row.
Cheers,
KD
10-01-2008 12:10 PM
ya... but this has to be used for individual fields. i want to gray the entire row. isn't ther any other method??
10-01-2008 12:17 PM
you need to do the same for all the cells.
LS_EDIT-FIELDNAME = 'VBELN'.
LS_EDIT-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_DISABLED.
LS_EDIT-STYLE2 = SPACE.
LS_EDIT-STYLE3 = SPACE.
LS_EDIT-STYLE4 = SPACE.
LS_EDIT-MAXLEN = 10.
INSERT LS_EDIT INTO TABLE LT_EDIT.
LS_EDIT-FIELDNAME = 'POSNR'.
LS_EDIT-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_DISABLED.
LS_EDIT-STYLE2 = SPACE.
LS_EDIT-STYLE3 = SPACE.
LS_EDIT-STYLE4 = SPACE.
LS_EDIT-MAXLEN = 6.
INSERT LS_EDIT INTO TABLE LT_EDIT.
"For other columns too then the row completely Disabled
....
....
....
INSERT LINES OF LT_EDIT INTO TABLE LS_OUTTAB-HANDLE_STYLE.
MODIFY IT_VBAP INDEX SY-TABIX FROM LS_OUTTAB TRANSPORTING
HANDLE_STYLE .
10-01-2008 1:37 PM
Hi,
This would help--
*--- 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 .
Code Part 14 u2013 Adding inner table that will contain cell color data
DATA ls_cellcolor TYPE lvc_s_scol .
...
READ TABLE gt_list INDEX 5 .
ls_cellcolor-fname = 'SEATSOCC' .
ls_cellcolor-color-col = '7' .
ls_cellcolor-color-int = '1' .
.....same for all the fields in the row
APPEND ls_cellcolor TO gt_list-cellcolors .
MODIFY gt_list INDEX 5 .
**Code Part 15 u2013 A sample code to make the cell at row 5 to a particular color
Cheers,
KD
10-01-2008 1:44 PM