06-20-2017 3:18 PM
How to set a column name a color like green usign alv factory.
i have this code:
"Classe para Criação do ALV.
CALL METHOD cl_salv_table=>factory
IMPORTING
r_salv_table = r_table
CHANGING
t_table = it_tab.
"ALV TOOLBAR
DATA lo_sel TYPE REF TO cl_salv_selections.
lo_sel = r_table->get_selections( ).
lo_sel->set_selection_mode( if_salv_c_selection_mode=>row_column ).
"Toolbar icones
r_functions = r_table->get_functions( ).
r_functions->set_all( abap_true ).
DATA lo_columns TYPE REF TO cl_salv_columns_table.
lo_columns = r_table->get_columns( ).
" ALV LINE COLOUR
DATA: gr_display TYPE REF TO cl_salv_display_settings.
gr_display = r_table->get_display_settings( ).
gr_display->set_striped_pattern( cl_salv_display_settings=>true ).
* TRY.
*
* lo_col_tab ?= lo_cols_tab->get_column( 'BUTXT' ).
* ls_color-col = col_total.
* lo_col_tab->set_color( ls_color ).
* CATCH cx_salv_not_found.
* ENDTRY.
"HEADER
DATA: gr_display2 TYPE REF TO cl_salv_display_settings.
gr_display = r_table->get_display_settings( ).
gr_display->set_list_header( text-003 ).
r_functions = r_table->get_functions( ).
r_functions->set_all( abap_true ).
r_table->display( ).
Thank you
06-21-2017 7:13 AM
In your code, you have used
ls_color-col = col_total.
Did you search the web?
Fields of LVC_S_COLO are COL, INT, INV, with these possible values:
color code (from 0 to 7)
0 = background color
1 = blue
2 = gray
3 = yellow
4 = blue/gray
5 = green
6 = red
7 = orange
intensified (0=off, 1=on)
inverse display (0=off, 1=on)S
So, please try yourself.