on 09-29-2010 7:23 AM
Hi Everyone,
I have the below requirement. I have a ALV where there are 2 fields of type TIMS. When the value is not available its showing as 00:00:00. But the problem is when I export the same to excel I am getting that as 12:00:00 AM.
So I was asked to hide the element when there is no value for that fields.
I used the below code for the same.
IF time is initial.
table_column = table_model->if_salv_wd_column_settings~get_column( id = 'OUTIME' ).
text_view_ref = table_column->get_cell_editor( ).
text_view ?= text_view_ref.
CALL METHOD text_view->set_visible
EXPORTING
value = cl_wd_uielement=>e_visible-none.
endif.
The above code is changing the property for all the rows. I want to change only the rows where it is initial. I tried to use get_cell_variant method and struck with it. Can anyone help me with it?
>The above code is changing the property for all the rows.
Yes that is exactly what it is intended to do. You are setitng a property of the cell editor that is used for the entire column. You would need to create a cell variant. The main cell editor would be vislble and the cell variant would not be visible. Then add another attribute to you context so that you can use this attribute to control which cell variant is used at the element level.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Below is the piece of code that I am using with reference to the material [http://help.sap.com/saphelp_nw70/helpdata/en/b6/b7bc68306049bd8500362ce52b6def/frameset.htm|http://help.sap.com/saphelp_nw70/helpdata/en/b6/b7bc68306049bd8500362ce52b6def/frameset.htm]
DATA: table_column TYPE REF TO cl_salv_wd_column,
table_model TYPE REF TO cl_salv_wd_config_table,
lr_input1 TYPE REF TO cl_salv_wd_uie_input_field,
table_column = table_model->if_salv_wd_column_settings~get_column( id = 'OUTIME' ).
CREATE OBJECT lr_input1
EXPORTING
value_fieldname = 'OUTIME'.
table_column->set_cell_editor( lr_input1 ).
Whats the BUTTON_VIS field in the material above? how do I use that in my code?
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
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.