cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the multiple rows from a table?

former_member210804
Active Participant
0 Kudos

Hi sir,

I want to fetch multiple rows from a table given below....

and pass these 3 records of pernr's  to another table.

Thanks & regards,

Narasimha Rao Putturi.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

HI....Narsimha Rao

Please go through the following link.it may help full to you.

http://scn.sap.com/thread/2047872

Thanks & Regards,

Pavan Maganti.

Answers (5)

Answers (5)

former_member210804
Active Participant
0 Kudos

Thank You all....I got the result

Former Member
0 Kudos

Hi Narasimha Rao,

First u need to get selected elements into to a nternal table..

-->before that u have declare the table which allows for multi record selectable, for that declare table selection property as 0..n.

-->then by using get_selected_elements of if_wd_context_node for getting selected records.

-->then by using bind_table( ) append the selected records to particular table in which u hav to display.

Thanks And Regards .

Lokesh

chengalarayulu
Active Contributor
0 Kudos

Narasimha,

1. Provide the node Selection Cardinality as 1..n (it will enable control + select option).

2. By clicking on row selector of Table with the help of CTRL key of keyboard.

3. After selection, let you have CONTINUE action.

5. in CONTINUE action you just write the below code.

data: lt_elements type WDR_CONTEXT_ELEMENT_SET,

        ls_elements like line of lt_elements.

data: lo_node_1 type ref to if_wd_context_node,

        lo_node_2 type ref to if_wd_context_node.

data: <ls_node_2> type <work area of Node_2>,

        <lt_node_2> type <Line type of Node_2>,

        <ls_node_1> type <work area of Node_1>.

lo_node_1 = <get node reference>.

lt_elements = lo_node_1->get_selected_elements( ).

loop at lt_elements into ls_elements.

     ls_elements->get_static_attributes( static_attributes = ls_node_1 ).

ls_node_2-<field_1> = ls_node_1-<field_1>.

ls_node_2-<field_2> = ls_node_1-<field_2>.

ls_node_2-<field_3> = ls_node_1-<field_3>.

append ls_node_2 to lt_node_2.

clear: ls_node_2, ls_elements.

endloop.

lo_node_2->bind_table( lt_node_2 ).

******************************

Hope you understood.

former_member230486
Contributor
0 Kudos

Hi,

First get the selected rows from table using method GET_SELECTED_ELEMENTS from IF_WD_CONTEXT_NODE.

Former Member
0 Kudos

Hi Narsimha,

Use below logic...

context_node = wd_context->get_child_node( name = 'CARRIERS').

  it_selrows  = context_node->GET_SELECTED_ELEMENTS( ).

LOOP AT it_selrows INTO wa_selrows.

    CALL METHOD wa_rows->get_static_attributes

        IMPORTING

          static_attributes = wa_scarr.

    APPEND wa_scarr TO it_scarr.

    CLEAR  wa_scarr.

  ENDLOOP.

regards,

Venkat