on 10-28-2009 6:52 AM
hi
i have a node of table type, displaying few records & with each record a NEXT button is there.
now i want to read the values of the selected row of the table & want to process next with NEXT button.
pls tell me how to read the values of the selected row only.
reds.
data : lo_nd type ref to if_wd_context_node,
lo_nd1 type ref to if_wd_context_node,
lt_temp type wdr_context_element_set,
wa_temp type ref to if_wd_context_element,
ls_node1 type sflight,
lt_node1 type STANDARD TABLE OF sflight.
lo_nd = wd_context->get_child_node('CN_MAIN').
CALL METHOD lo_nd->get_selected_elements
RECEIVING
set = lt_temp.
loop at lt_temp INTO wa_temp.
CALL METHOD wa_temp->get_static_attributes
IMPORTING
static_attributes = ls_node1.
APPEND ls_node1 TO lt_node1.
CLEAR ls_node1.
ENDLOOP.
'CN_MAIN' is the node whose selected values are to be picked and stored in internal table lt_node1.
-
Other option by Thomas :
DATA lo_nd_cn_main TYPE REF TO if_wd_context_node.
DATA lt_temp TYPE wdr_context_element_set.
FIELD-SYMBOLS <wa_temp> LIKE LINE OF lt_temp.
DATA lt_node1 TYPE wd_this->elements_cn_main.
FIELD-SYMBOLS <ls_node1> LIKE LINE OF lt_node1.
lo_nd_cn_main = wd_context->get_child_node( name = wd_this->wdctx_cn_main ).
lt_temp = lo_nd_cn_main->get_selected_elements( ).
LOOP AT lt_temp ASSIGNING <wa_temp>.
APPEND INITIAL LINE TO lt_node1 ASSIGNING <ls_node1>.
<wa_temp>->get_static_attributes( IMPORTING STATIC_ATTRIBUTES = <ls_node1> ).
ENDLOOP.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Is this single/Multiple row selection.
Single -
In NEXT button handler -
GET_SELECTED_ELEMENTS of if_wd_context_node.
loop at this element set.
ls_element->get_static_attributes of if_wd_context_element.
endloop
Regards,
Lekha.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Then get_lead_selection of if_wd_context_node that retunrs the elment.
lr_element = lr_node->get_lead_selection( ).
if lr_element is not initial.
lr_elment->get_statitc_attrbutes
exporting
statitc_attributes = ls_table.
endif.
Use the code wizard...
You willget the above code...
In this statemnt make the change -
lr_elment = lr_node->get_elment ( ) as....
lr_element = lr_node->get_lead_selection.
Regards,
Lekha.
Edited by: Lekha on Oct 28, 2009 12:31 PM
If only one row is allowed to be selected then you can directly read th node using code wizard( control + F7) and code will be generalted :
DATA lo_nd_dynammic TYPE REF TO if_wd_context_node.
DATA lo_el_dynammic TYPE REF TO if_wd_context_element.
DATA ls_dynammic TYPE wd_this->element_dynammic.
navigate from <CONTEXT> to <DYNAMMIC> via lead selection
lo_nd_dynammic = wd_context->get_child_node( name = wd_this->wdctx_dynammic ).
get element via lead selection
lo_el_dynammic = lo_nd_dynammic->get_element( ).
get all declared attributes
lo_el_dynammic->get_static_attributes(
IMPORTING
static_attributes = ls_dynammic ).
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
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.