on 10-17-2011 1:48 PM
Hi ,
I have a customer requirement in which for an alv table he should be able to select any set of rows like 3, 6,7,12 --- and should be able to delete those rows. I'm able to select all or a continuous row selection like either 3,4,5,6,7 but not able to select a discontinuous set like 4,5,7,12., so please suggest a solution to this
i've searched the forum and found the solution for a normal table but not alv table
Thanks in advance.
In ABAP module pool we are having a provision in table control where we can enable multiple row selection. Is there any option in webdynpro which does the same functionality .please consider
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You will instantiate the ALV right, we get this model object - cl_salv_wd_config_table.
This is the main class to work with ALV.
It has the interface IF_SALV_WD_TABLE_SETTINGS~SET_SELECTION_MODE where you have pass '04'.
Automatically you can the selectALl button at the left side top corner of ALV table when displayed.
AUTO TYPE WDY_UIE_LIBRARY_ENUM_TYPE VALUE '00', " TableSelectionMode.auto
SINGLE TYPE WDY_UIE_LIBRARY_ENUM_TYPE VALUE '02', " TableSelectionMode.single
MULTI TYPE WDY_UIE_LIBRARY_ENUM_TYPE VALUE '04', " TableSelectionMode.multi
NONE TYPE WDY_UIE_LIBRARY_ENUM_TYPE VALUE '06', " TableSelectionMode.none
SINGLE_NO_LEAD TYPE WDY_UIE_LIBRARY_ENUM_TYPE VALUE '07', " TableSelectionMode.singleNoLead
MULTI_NO_LEAD TYPE WDY_UIE_LIBRARY_ENUM_TYPE VALUE '08', " TableSelectionMode.multiNoLead
Then using CTRL key you can select the multiple rows.
Please check this.
Hi,
Go through the sample code below
Data: context_node type ref to if_wd_context_node.
Data: it_scarr type STANDARD TABLE OF if_view1=>element_CARRIERS,
wa_scarr like line of it_scarr.
data: ld_element type ref to if_wd_context_element,
it_selrows type WDR_CONTEXT_ELEMENT_SET,
wa_selrows like line of it_rows.
context_node = wd_context->get_child_node( name = 'CARRIERS').
it_selrows = context_node->GET_SELECTED_ELEMENTS( ).
LOOP AT it_selrows INTO wa_selrows.
CALL METHOD wa_rows->get_static_attributes
IMPORTING
static_attributes = wa_scarr.
APPEND wa_scarr TO it_scarr.
CLEAR wa_scarr.
ENDLOOP.
* All selected rows will now be contained in it_scarr
Regards,
Sahai.S
Hi lekha ji,
I Wrote the following code in WDDOINIT
method WDDOINIT .
DATA :alv_prop TYPE REF TO CL_SALV_WD_CONFIG_TABLE,
MULTI TYPE WDY_UIE_LIBRARY_ENUM_TYPE VALUE '04'.
alv_prop->IF_SALV_WD_TABLE_SETTINGS~SET_SELECTION_MODE( MULTI ) .
endmethod.
*I GOT THE FOLLOWING ERROR.* Please help
The following error text was processed in the system EIS : Access via 'NULL' object reference not possible.
The error occurred on the application server erpsolman_EIS_02 and in the work process 0 .
The termination type was: RABAX_STATE
The ABAP call stack was:
Method: WDDOINIT of program /1BCWDY/BGANP67GS5M05L0V5PY0==CP
Method: IF_WDR_VIEW_DELEGATE~WD_DO_INIT of program /1BCWDY/BGANP67GS5M05L0V5PY0==CP
Method: DO_INIT of program CL_WDR_DELEGATING_VIEW========CP
Method: INIT_CONTROLLER of program CL_WDR_CONTROLLER=============CP
Method: INIT_CONTROLLER of program CL_WDR_VIEW===================CP
Method: INIT of program CL_WDR_CONTROLLER=============CP
Method: GET_VIEW of program CL_WDR_VIEW_MANAGER===========CP
Method: BIND_ROOT of program CL_WDR_VIEW_MANAGER===========CP
Method: INIT of program CL_WDR_VIEW_MANAGER===========CP
Method: INIT_CONTROLLER of program CL_WDR_INTERFACE_VIEW=========CP
Go to st22 Tcode and check for source code for the exat error. It says NULL referecne....
method WDDOINIT .
DATA :alv_prop TYPE REF TO CL_SALV_WD_CONFIG_TABLE,
MULTI TYPE WDY_UIE_LIBRARY_ENUM_TYPE VALUE '04'.
alv_prop->IF_SALV_WD_TABLE_SETTINGS~SET_SELECTION_MODE( MULTI ) .
endmethod.
May be this variable 'alv_prop' refers to nothing.....
You need not declare anything here, just pass the value.
alv_prop->IF_SALV_WD_TABLE_SETTINGS~SET_SELECTION_MODE( '04' ) .
I guess you missed out instantiation of ALV.
In DOINIT, go to wizard, Select the radio button INSTANTIATE component usage(somehting like this) give the select the ALV you have created...and it will generate code for you
Then again go to same wizard, select component usage give the class name as iwci_salv_wd_table and get_model that returns cl_salv_wd_config_table.
Please refer to WD Wikis on the same for the steps.
the code looks somthing like this from code wizard
DATA lo_cmp_usage TYPE REF TO if_wd_component_usage.
DATA lo_interfacecontroller TYPE REF TO iwci_salv_wd_table .
DATA lo_model type ref to cl_salv_wd_config_table.
lo_cmp_usage = wd_this->wd_cpuse_alv_emp( ).
IF lo_cmp_usage->has_active_component( ) IS INITIAL.
lo_cmp_usage->create_component( ).
ENDIF.
lo_interfacecontroller = wd_this->wd_cpifc_alv_emp( ).
lo_model = lo_interfacecontroller->get_model( ).
if lo_model is not initial.
lo_model->IF_SALV_WD_TABLE_SETTINGS~SET_SELECTION_MODE( '04' ) .
endif.
Hope this helps.
Hi,
Refer below code,
DATA: l_ref_cmp_usage TYPE REF TO if_wd_component_usage,
l_ref_interfacecontroller TYPE REF TO iwci_salv_wd_table ,
l_value TYPE REF TO cl_salv_wd_config_table,
lr_table_settings TYPE REF TO if_salv_wd_table_settings.
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.
l_ref_interfacecontroller = wd_this->wd_cpifc_alv( ).
l_value = l_ref_interfacecontroller->get_model( ).
lr_table_settings ?= l_value.
" Setting the ALV selection to multiple selection with no lead selection
lr_table_settings->set_selection_mode( value =
cl_wd_table=>e_selection_mode-multi_no_lead ). "This can be as below. Here it is MULTI_NO_LEAD.
Possible values,
AUTO TYPE WDY_UIE_LIBRARY_ENUM_TYPE VALUE '00', " TableSelectionMode.auto
SINGLE TYPE WDY_UIE_LIBRARY_ENUM_TYPE VALUE '02', " TableSelectionMode.single
MULTI TYPE WDY_UIE_LIBRARY_ENUM_TYPE VALUE '04', " TableSelectionMode.multi
NONE TYPE WDY_UIE_LIBRARY_ENUM_TYPE VALUE '06', " TableSelectionMode.none
SINGLE_NO_LEAD TYPE WDY_UIE_LIBRARY_ENUM_TYPE VALUE '07', " TableSelectionMode.singleNoLead
MULTI_NO_LEAD TYPE WDY_UIE_LIBRARY_ENUM_TYPE VALUE '08', " TableSelectionMode.multiNoLead
Thanks,
Chandra
The customer requirement is to select the rows with out using ctrl key .he should be able to select the rows by clicking on selection buttons.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Even though the buttons are there for selection but how a user can select only a particular row/s without ctrl Key...
Either when a user clicks on some button you should provide some input for user for selection, as per the user enters either the row nos/serial numbers, then you can set them as selected. But check with client wether user will provide the serial/row numbers that needs to be selected...one more things is you can give a check Box against each lineitem so that user will check only the records for selection, based on which you can do further processing.
With out ctrl key you cannot do mutilple selection unless you provide some other option inaddition to specified above.
Regards,
Lekha.
Hi,
you need to use Control key and then select any rows in any order.
Thanks,
Chandra
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.