on 06-18-2009 12:20 AM
Hi Friends,
I'm facing a problem. I'm trying to select a rown in ALV but doesnot allow me to that. It is default to first row (lead selection) but not able to select any other row.
Here is my code inside wddoinit. Thanks in advance I hope someone will help me.
DATA: lr_ref_cmp_usage TYPE REF TO if_wd_component_usage,
lr_ref_if_controller TYPE REF TO iwci_salv_wd_table,
lr_config_model TYPE REF TO cl_salv_wd_config_table,
lr_field_settings TYPE REF TO if_salv_wd_field_settings,
lr_field TYPE REF TO cl_salv_wd_field.
DATA lo_cmp_usage TYPE REF TO if_wd_component_usage.
lo_cmp_usage = wd_this->wd_cpuse_zalv( ).
IF lo_cmp_usage->has_active_component( ) IS INITIAL.
lo_cmp_usage->create_component( ).
ENDIF.
* Get config model
DATA: l_ref_interfacecontroller TYPE REF TO iwci_salv_wd_table .
l_ref_interfacecontroller = wd_this->wd_cpifc_zalv( ).
DATA: l_value TYPE REF TO cl_salv_wd_config_table.
l_value = l_ref_interfacecontroller->get_model( ).
CALL METHOD l_value->if_salv_wd_table_settings~set_row_selectable
EXPORTING
value = ABAP_TRUE
.
DATA: lr_table_settings TYPE REF TO if_salv_wd_table_settings,
lv_text TYPE string.
lr_table_settings ?= l_value.
* lr_table_settings->set_fixed_table_layout( abap_true ).
* lr_table_settings->set_visible_row_count( -1 ).
lr_table_settings->set_footer_visible( 0 ).
lr_table_settings->set_design( '00' ).
* Sort data records default
Laeeq Siddique
Hi,
I think, apart from enabling selection in ALV, you have to write code to select the particular context element in the table binded to ALV. You can try below in INIT method code and this might work.
data: node type REF TO if_wd_context_node.
Node = wd_Context->get_Child_Node( Name = 'NODE_NAME' ).
* call this method to set the lead selection index
node->SET_LEAD_SELECTION_INDEX( n ) " n is the index of the row you want to select
Regards,
Manne.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I made a mistake by selecting first row in WDDOMODIFY method so it was just not letting me select any other row.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Iif you wish to select multiple rows in ALV then you need to change selection property of context node to 0..N or 1..N.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
9 | |
9 | |
6 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.