on 07-15-2014 8:40 PM
Hi,
I have a requirement where I need to change the font color for some cells of ALV in Web Dynpro ABAP. I am able to change the font color for whole row or whole column but need to know how to change it based on cells.
My output should be something like the picture attached to this discussion. The coloumns/cells where I need the font colour can change for different rows, based on some internal condition.
Please let me know how to achieve this...... Thank you.
- Divya Posanpally
Hi Divya,
Your requirement can be achieved as below
data lv_color_fld_name type string.
data lo_text_view type ref to cl_salv_wd_uie_text_view.
loop at lt_columns into ls_column.
concatenate 'COLOR' ls_column-id into lv_color_fld_name separated by '_'.
lo_text_view ?= ls_column-r_column->get_cell_editor( ).
if lo_text_view is bound.
lo_text_view->SET_SEMANTIC_COLOR_FIELDNAME( value = lv_color_fld_name ).
endif.
endloop.
loop at lt_data into ls_data.
if ..... "your condition here.
ls_data-color_f1 = cl_wd_text_view=>e_semantic_color-NEGATIVE.
ls_data-color_f2 = cl_wd_text_view=>e_semantic_color-POSITIVE.
elseif...... " another condition
endif.
endloop.
Note: You can optimize the code as per your requirement
Hope this helps you.
Regards,
Rama
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Please check with the following link, check if can help.
Web Dynpro ABAP: Changing the color of a cell in ALV
Regards,
Harsha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.