on 05-06-2010 10:05 AM
Hi,
I have 15 fields in my WD ALV output. All i need is to display only certain columns on some action (by hitting button1) and to display other set of columns on other action (by hitting button2). Please let me know how should i approach in this?
Rgds
Sudhanshu
Hello
In ALV, YOU BIND THE TABLE, SO all what you binding will be displayed.
In the Action, Get the context, Check which all attributes you want to display, Bind them to context table.
It will show only those.
Best regards,
Rohit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Via the ALV Model API classes you can access all the current columns and then hide any of them you wish. Here is some sample code:
DATA: l_ref_cmp_usage TYPE REF TO if_wd_component_usage.
l_ref_cmp_usage = wd_this->wd_cpuse_alv( ).
IF l_ref_cmp_usage->has_active_component( ) IS INITIAL.
l_ref_cmp_usage->create_component( ).
ENDIF.
DATA l_salv_wd_table TYPE REF TO iwci_salv_wd_table.
l_salv_wd_table = wd_this->wd_cpifc_alv( ).
DATA l_table TYPE REF TO cl_salv_wd_config_table.
l_table = l_salv_wd_table->get_model( ).
DATA l_column TYPE REF TO cl_salv_wd_column.
l_column = l_table->if_salv_wd_column_settings~get_column( 'CLIENT' ).
l_column->set_visible( cl_wd_uielement=>e_visible-none ).
There is also a GET_COLUMNS method that will return an internal table of all columns and their objects that you can loop through.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.