on 06-29-2004 10:58 AM
Hi,
I am currently programming dynamic tables and want to
specify the color of a new row. Obviously, this has to be done in method ->new_row:
CALL METHOD valid_reference->new_row
EXPORTING sap_style = sap_style
sap_color = sap_color
sap_fontsize = sap_fontsize
sap_fontstyle = sap_fontstyle
sap_emphasis = sap_emphasis.
Unfortunately, I did not get any information on how to specify sap_color. Can anyone post an example or state some reference, please.
Thanks
Klaus
Hi!
Is Klaus talking about adding a new row for an ALV gird or something else? Because, as much as I know, ALV grid class has no method as "new_row" (of course this may be a method of a locally defined event handler but it doesn't seem so) or features like "fontsize", "fontstyle".
So, what Klaus means by "dynamic table" is not an ALV grid instance, is it?
*--Serdar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Klaus,
The gc_fields are just global constants whithin Your Program.
Define a Field in Your ITAB type Character(04) and call it f.x. "FARBE"
data: gf_layout type lvc_s_layo.
data: gt_fldcat type lvc_t_fcat.
constants: gc_colc211 LIKE gf_cntrl-farbe VALUE 'C211',
gc_colc311 LIKE gf_cntrl-farbe VALUE 'C311'.
c_fldfarb like f_fldcat-fieldname value 'FARBE'. " Name of the Field
Fill the structure gf_layout with the name of the Color field:
gf_layout-info_fname = c_fldfarb.
Modify the fieldcat-table in this way, that the field "FARBE" should not be displayed (hidden).
read table gt_fldcat into gf_fldcat with key fieldname = c_fldfarb.
if sy-subrc = 0.
gf_fldcat-no_out = 'X'.
modify gt_fldcat from gf_fldcat index sy-tabix.
endif.
if you want to change the color, loop at the itab:
loop at gt_itab into gf_itag.
h_mod = sy-tabix mod 2.
if h_mod = 0.
gf_itab-farbe = c_colc211.
else.
gf_itab-farbe = c_colc311.
endif.
modify gt_itab from gf_itab.
endloop.
Hope i could help You
BR
Michael
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hallo Klaus,
Use a field CHAR(04) and following example-code:
..gf_cntrl...
farbe(04) type c,
´´´´
gc_colc211 LIKE gf_cntrl-farbe VALUE 'C211',
gc_colc311 LIKE gf_cntrl-farbe VALUE 'C311',
The code is a logical addition of color attributes i guess.
Hope i could help You
BR
Michael
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have no idea how to do this, but did you try using the color constants that you would use in the WRITE statement?
eg. WRITE x COLOR col_total.
Scott
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.