cancel
Showing results for 
Search instead for 
Did you mean: 

how to read the selected row value of a table node

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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.

Answers (1)

Answers (1)

Former Member
0 Kudos

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.

Former Member
0 Kudos

hi lekha

as per as req always the single selection will be there.

Former Member
0 Kudos

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

Former Member
0 Kudos

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 ).