cancel
Showing results for 
Search instead for 
Did you mean: 

How to create alv table for results on selecting multiple rows in the table

Former Member
0 Kudos

Hi Colleagues,

;

My requirement is as follows:

There are two tables. First table contains the employee id's. second table contains the employee details for the selected entries from the first table in the form of alv.

Could you please let me know if we select multiple entries in the first table how to display the corresponding entries of all multiple entries in the second table.

Thank you and Best Regards,

MJR

Accepted Solutions (1)

Accepted Solutions (1)

former_member213957
Participant
0 Kudos

Hi JR,

steps:

1. create a method in view with standard alv event  "on_lead_select"

2. In that method read the node of alv table1 and call the method node1->get_static_attributes, it gives selected entries of table 1 and like all employe id's.

3.similary read the node of alv table2 and write the select query for employee details in where     condition pass the table1 employe id's.

  eg; select *  from employee_data into table  lt_employe_data

                                                             for all entries lt_employee_id's

                                                             where employee_id = lt_employee_ids-employee_id.

                                                        

4. bind the node2 of alv table2 , node2->bind_table( lt_employee_data ).

regards,

Kishorekumar

Answers (2)

Answers (2)

Former Member
0 Kudos

steps to do it

1. get node referance.

2. use below code

 

DATA : IT_ELEMENTS TYPE WDR_CONTEXT_ELEMENT_SET.
DATA : LS_ELEMENTS LIKE LINE OF IT_ELEMENTS.


* get elemenst

IT_ELEMENTS = node_referance->GET_SELECTED_ELEMENTS( ).

  IF IT_ELEMENTS IS NOT INITIAL.
    LOOP AT IT_ELEMENTS INTO LS_ELEMENTS.
* insert code for getting datta and  bind these records with other table node     

    ENDLOOP.
  ENDIF.

if helpful reward points

former_member184578
Active Contributor
0 Kudos

Hi,

Check this article: http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/7020c76f-c40e-2e10-a795-d88e67740...

For multiple records you can use get_selected_elements method.

Hope this helps u.,

Regards,

Kiran