on 03-04-2009 8:04 AM
Hi,
I need to get the index of a specific line in a table. Selection mode is set to none. The first column contains a menu with two menuActionItems. When I choose an actionitem my event handler is called with parameter WDEVENT TYPE CL_WD_CUSTOM_EVENT. As I understand you have to use this parameter to get the index from the table line.
I have tryed with the following code in my event handler method:
DATA:
node_lines TYPE REF TO if_wd_context_node,
elem_lines TYPE REF TO if_wd_context_element,
l_index TYPE i.
elem_lines = wdevent->get_context_element( name = 'LINES' ).
l_index = elem_lines->get_index( ).
This does not work. The elem_lines is initial after I try to get it.
Hope that someone can guide me in the right direction.
Thanks,
Morten
Hi Morten,
Try this
data: lr_element type ref to if_wd_context_element,
lv_index type i.
lr_element = wdevent->get_context_element( name = 'CONTEXT_ELEMENT' ). " use CONTEXT_ELEMENT instead of LINES
lv_index = lr_element->get_index( ).
I hope it helps.
Regards
Arjun
Edited by: Arjun on Mar 4, 2009 1:38 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
data: index type i,
msg type string.
index = wd_event->get_context_element->get_index->get_index( ).
msg = index.
l_message_manager->report_success( msg ).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi ;
this will work
DATA: mod_cell TYPE salv_wd_t_table_mod_cell,
wa_mod_cell TYPE LINE OF salv_wd_t_table_mod_cell,
msg TYPE string.
mod_cell = r_param->t_modified_cells.
wd_comp_controller->set_material_dtl( ).
LOOP AT mod_cell INTO wa_mod_cell.
msg = wa_mod_cell-index .
msg = mod_cell-index .
l_message_manager->report_success( msg ).
Or else try this.
wd_event is return parameter
data: index type i.
index = wd_event->get_context_elementget_index->get_index( ).
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 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.