10-07-2004 2:58 PM
Hi 4all...
Someone here know how to use the class cl_gui_alv_grid to build a custom ALV Grid display like distinct col colors, remove gridlines, change the background color...???
The public interface of class don't explain me nothing about that. Searching for methods or properties to set, I find nothing...
10-07-2004 3:12 PM
Hi Flavio,
There are several ways to enhance the colouring of your grid.
Coloring rows:
Add a field to your internal table that holds the data to be displayed:
BEGIN OF OUTTAB OCCURS 0.
INCLUDE STRUCTURE <your structure>.
DATA: LINECOLOR(4) TYPE C,
END OF OUTTAB.
Assign a 4 digit color code to this field to change the color of each line. Furthermore you should set the name of this field in the layout:
ZZLAYOUT-INFO_FNAME = 'LINECOLOR'.
Coloring columns:
Set the field EMPHASIZE of the layout structure for the column.
Coloring cells:
Again add a field (in this case a table) to the structure of your table:
BEGIN OF OUTTAB OCCURS 0.
INCLUDE STRUCTURE <your structure>.
DATA: COLORTAB TYPE LVC_T_COL,
END OF OUTTAB.
For each column you want to color add a line to table COLORTAB (for each line of your ALV). Furthermore you should set the name of this table in the layout:
ZZLAYOUT-CTAB_FNAME = 'COLORTAB'.
Hope this helps?
Regards,
John.
10-07-2004 3:35 PM
Thaks for ur help...!!!
But my doubt stand around the class cl_gui_alv_grid. My experience with OO Programing (Java, C#, Delphi...) tell that the Class concept of Abap Objects implements a way to do this directly with method(s) invoke or properties set, that's truth...??? If negative, we must use the routine that you show...
10-07-2004 4:03 PM
Hi Flavio,
Perhaps it was not clear from my previous post, but coloring the grid is done either by method 'SET_TABLE_FOR_FIRST_DISPLAY' (first time) or 'REFRESH_TABLE_DISPLAY' (after something has been changed in the data display).
Regards,
John.
10-07-2004 4:53 PM
But it will be that it does not exist a methos like SET_COLUMN_COLOR USING "col_id" or somethig else that do this work...???
The "methods" concept are so limited....???
10-07-2004 4:54 PM
Are you have a IM like MSN or ICQ to talk....????
my UIN: 160939866
10-07-2004 5:12 PM
Sorry Flavio, we are not allowed to use MSN/ICQ at work....
And indeed, there are no explicit methods to update row/column/cell coloring.
Regards,
John.
10-07-2004 5:31 PM
12-01-2004 1:28 AM
Hi Flavio,
Did the replies help? If so, don't forget to assign points. I gave some, but feel free to increase them!
See: /people/mark.finnern/blog/2004/08/10/spread-the-love for directions.
Click on the Yellow Star icon in each reply.
You can give:
1 - 10 pointer (solves problem, marks as answered)
2 - 6 pointers (very helpful)
Lots of 2 pointers (helpful)
Thanks!
Linda(and Mark Finnern)