on 05-16-2011 3:04 PM
Hello All,
I have requirment where in, I need to add columns to a Table
and this coloumns should appear on some condition bases.
Please let me know how to handle the visibility of column on certain condition.
Regards,
Neelima
Solved
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Are you talking about normal table or ALV
if it is ALV then you have to write some code in the init method to hide the column based on some condition
like the following code will delete the column status form ALV based on the condition.
data lo_cmp_usage type ref to if_wd_component_usage.
lo_cmp_usage = wd_this->wd_cpuse_alv( ).
if lo_cmp_usage->has_active_component( ) is initial.
lo_cmp_usage->create_component( ).
endif.
DATA lo_INTERFACECONTROLLER TYPE REF TO IWCI_SALV_WD_TABLE .
lo_INTERFACECONTROLLER = wd_this->wd_cpifc_alv( ).
DATA lo_value TYPE ref to cl_salv_wd_config_table.
lo_value = lo_interfacecontroller->get_model(
).
if "condition"
lo_value->IF_SALV_WD_COLUMN_SETTINGS~DELETE_COLUMN( 'STATUS' ).
endif.
and if it is normal table.
you can easily control it by defining an attribute of type wdUI_visibility and bind it to visiblity property of the column
and then based on the condition set the value of the attirbute.
Thanks
sarbjeet singh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Neelima,
You could write below mentioned code in WDDOMODIFY method of the view and here you can check your condition if condition is true then you can use '01' to make column invisible or '02' to make it visible.
IF condition .
Data lr_table_column TYPE REF TO CL_WD_TABLE_COLUMN.
lr_table_column ?= VIEW->GET_ELEMENT( 'ID_OF_TABLE_COLUMN' ).
CALL METHOD lr_table_column->SET_VISIBLE
EXPORTING
VALUE = '01' " use '01' to make column invisible and '02' to make it visible
.
ENDIF.
Regards,
Vishesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Neelima,
You could add a new table column using CL_WD_TABLE_COLUMN class and NEW_TABLE_COLUMN method.
I would suggest you that if you know at design time maximum how many columns do you need, you could define all at design time and make them invisible by default and when required at runtime, change the attribute value which is bind to the visibilty of the column.
it would help in performance.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Neelima,
You would need an attribute of type wdy_boolean and bind it to the visible proprty of the particular table column.
and then change the value of that column based on your condition.
Regards
Anurag Chopra
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.