on 03-31-2008 6:37 PM
Hi
I'm using an ALV output (SALV_WD_TABLE)
How can I get the selected lines if multiple line selection is enabled?
ON_LEAD_SELECT just return one line!
Thanks
Thomas
GET_SELECTED_ELEMENTS is correct, but if several lines are selected, you have to take care about the selection colors or you use a different selection method like 08
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
yes, I noticed
but that can't be the solution. If I would be an end-user of this WD development, I will not care about deselecting and selecting the 1st line again to the get correct color.
If I select several lines, I don't want to take care about the colors
so the solution for that is the different selection method 08
implemetned in wddoinit:
DATA: lr_comp_usage TYPE REF TO if_wd_component_usage,
lr_if_controller TYPE REF TO iwci_salv_wd_table,
lr_model TYPE REF TO cl_salv_wd_config_table,
lr_settings TYPE REF TO if_salv_wd_table_settings.
lr_comp_usage = wd_this->wd_cpuse_usage_alv( ).
IF lr_comp_usage->has_active_component( ) IS INITIAL.
lr_comp_usage->create_component( ).
ENDIF.
lr_if_controller = wd_this->wd_cpifc_usage_alv( ).
lr_model = lr_if_controller->get_model( ).
lr_settings ?= lr_model.
lr_settings->set_selection_mode( '08' ).
So problem is solved now.
Thanks for you help Gajendra.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I just saw that there's a difference in selecting the rows
the seleced ones are in light orange color, the missing one is the dark orange
That's the one I selected before I pushed the Cntl on the keyboard to mark the others
I guess there is something wrong the the selection method
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That won't work, what's wrong?
a test case from the scratch:
1. in the new component the used component SALV_WD_TABLE with use USAGE_ALV was entered
2. in the new view the context node vbak ( 0...n) was created and some VBAK fields selected
and incl. supply function
METHOD suppy_vbak .
DATA: lt_vbak TYPE TABLE OF vbak.
SELECT * up to 10 rows FROM vbak INTO TABLE lt_vbak.
node->bind_table(
new_items = lt_vbak
set_initial_elements = abap_true ).
ENDMETHOD.
4. view container UI element and a button called display created on view
5. view embedded in window and USAGE_ALV / SALV_WD_TABLE / TABLE embedded in the
view container ui element
6. component usage USAGE_ALV: DATA was linked to component controller's VBAK
so what's the coding for the button on the view now: maybe this one:
METHOD onactiondisplay .
DATA: lr_node TYPE REF TO if_wd_context_node,
lt_selected TYPE wdr_context_element_set.
lr_node = wd_context->get_child_node( name = 'VBAK' ).
lt_selected = lr_node->get_selected_elements( ).
ENDMETHOD.
this will run of error because the child VBAK is not on the view, so I linked context VBAK of the component controller to the view.
Now it runs without error, but the table lt_selected is one less than seleced
eg 5 selected, only 4 in the lt_selected or only 1 selected -> table is empty
Any ideas?
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Try using the method GET_SELECTED_ELEMENTS method for your node(IF_WD_CONTEXT_NODE).
Thank You,
Gajendra.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
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.