on 09-30-2012 4:03 PM
Hi All,
I have a webdynpro ALV application which has a select all functionality. The button works fine as long as filtering isn't done.
If i do select all after a filter operation, It doesnt consider the filtered records instead it takes the whole record(before filter).
Please let me know what are the options:
Below is a snippet of code
CALL METHOD lo_value->if_salv_wd_table_settings~get_first_visible_row
RECEIVING
value = l_first.
CALL METHOD lo_value->if_salv_wd_table_settings~get_visible_row_count
RECEIVING
value = l_total.
* Get the event ID
event = r_param->id.
IF event = 'SELECT'."select all button event
lv_to = l_first + l_total - 1.
lt_elements = lo_node->get_elements( from = l_first
to = lv_to ).
LOOP AT lt_elements INTO lo_element.
lo_element->get_attribute( EXPORTING name = 'CHECKBOX_SEL'
IMPORTING value = lv_selected ).
IF lv_selected = space.
lo_element->set_attribute(
EXPORTING
name = `CHECKBOX_SEL`
value = 'X' ).
ENDIF.
CLEAR lo_element.
ENDLOOP.
I got lucky and figured out how to achieve my own requirement.
Scenario: filter condition and select all should select all the filtered values
Steps i have taken:
1) The "Select All" Method which is triggered by Event
2)In the method , i got the filter values
Code snippet:
lt_field_ref = cl_salv_wd_model_table_util=>if_salv_wd_table_util_fields~get_filtered_fields(
l_value ).
LOOP AT lt_field_ref INTO ls_field_ref.
lt_filter_rule = ls_field_ref-r_field->if_salv_wd_filter~get_filter_rules( ).
CHECK LINES( lt_filter_rule ) GT 0.
LOOP AT lt_filter_rule INTO ls_filter_rule.
ls_selopt-low = ls_filter_rule-r_filter_rule->get_low_value( ).
ls_selopt-high = ls_filter_rule-r_filter_rule->get_high_value( ).
ls_selopt-option = ls_filter_rule-r_filter_rule->get_operator( ).
ENDLOOP.
ENDLOOP.
ENDIF.
Please click on this link to get more details:http://scn.sap.com/thread/1638506
3) I traversed all the record and checked the fields values and compared it with the filter values.
4) If all the field where filter is used matches of a record , then that record checkbox will be selected, similarly for deselect all also.
Thanks Anyway
Cheers,
Tashi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hope you can achieve it manually by maintaining 2 nodes..
first copy all values in 1st node, then in 2nd node keep your filter values.. bind the table with 2nd node...
upon filter action read the values in 1st node and then bind it to 2nd node.. then in table u will have only filter value, when no filter copy all the values in node1 to node2
Regards
Srinivas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Experts,
I am really struggling to accomplish the above mentioned requirement. i am not able to identify the records(elements) which are filtered so that i can select when "Select All" is pressed.
The closes thing i got was by following a solution provide by J Are:
http://scn.sap.com/thread/1638506
But even with the filter field and value , it is quite complicated to achieve the requirement.
Is there any way get_element ( giving filter field and values ) and get only the filter records ?
Please help
Regards,
Tashi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
76 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.