on 04-08-2011 1:16 PM
hi,
i have to colour the cells in table ui element with diiferent colour according to the condition...
kindly suggest the same . any help will be appreciated.
thanks and regards,
sahai.s
Hi Sahai,
Check the below link :-
[coloring table conditionaly|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/707fb792-c181-2d10-61bd-ce15d58b5cf1]
reply ain case of any issue.
Thanks & Regards,
Monishankar C
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sahai,
Please check below sample code..
DATA lo_nd_segment1 TYPE REF TO if_wd_context_node.
DATA lo_el_segment1 TYPE REF TO if_wd_context_element.
DATA ls_segment1 TYPE wd_this->Element_segment1.
data lt_segment1 type wd_this->elements_segment1.
DATA lv_segment TYPE wd_this->Element_segment1-segment.
data lr_column type ref to cl_wd_table_column.
navigate from <CONTEXT> to <SEGMENT1> via lead selection
lo_nd_segment1 = wd_context->get_child_node( name = wd_this->wdctx_segment1 ).
get element via lead selection
lo_el_segment1 = lo_nd_segment1->get_element( ).
lo_el_segment1 = WDEVENT->GET_CONTEXT_ELEMENT( 'CONTEXT_ELEMENT' ).
get all declared attributes
lo_el_segment1->get_static_attributes(
IMPORTING
static_attributes = ls_segment1 ).
DATA : lv_dropdown type string .
data desnval type WDUI_TABLE_CELL_DESIGN.
lv_dropdown = ls_segment1-segment. // this is drop down, based on drop down value i am setting color.
if lv_dropdown = 1.
desnval = cl_wd_table_column=>e_cell_design-badvalue_medium.
endif.
if lv_dropdown = 2.
desnval = cl_wd_table_column=>e_cell_design-criticalvalue_medium.
endif.
if lv_dropdown = 3.
desnval = cl_wd_table_column=>e_cell_design-key_medium.
endif.
if lv_dropdown = 4.
desnval = cl_wd_table_column=>e_cell_design-goodvalue_medium.
endif.
lo_el_segment1->set_Attribute(
name = 'CELL_DESIGN'
VALUE = desnval ).
Cheers,
Kris.
Edited by: kissnas on Apr 9, 2011 6:53 AM
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.