12-23-2014 11:25 AM
Dear,
Recently I develop a program display with multiple ALV: when I select one data of one ALV(like the image ) I want to know the data is in which output table (three table) and in which line. how can I get this ?
Thanks for your sincerely asnwer.
The diaplay code:
CREATE OBJECT container
EXPORTING
container_name = g_container.
CREATE OBJECT grid1
EXPORTING
i_parent = container_1.
CALL METHOD grid1->set_table_for_first_display
CHANGING
IT_FIELDCATALOG = GT_FIELDLOG
it_outtab = <DYN_T_SAME>.
CREATE OBJECT container
EXPORTING
container_name = g_container.
CREATE OBJECT grid3
EXPORTING
i_parent = container_5.
CALL METHOD grid3->set_table_for_first_display
CHANGING
IT_FIELDCATALOG = GT_FIELDLOG
it_outtab = <DYN_TAB1>.
CREATE OBJECT container
EXPORTING
container_name = g_container.
CREATE OBJECT grid4
EXPORTING
i_parent = container_6.
CALL METHOD grid4->set_table_for_first_display
CHANGING
IT_FIELDCATALOG = GT_FIELDLOG
it_outtab = <DYN_TAB2>.
12-23-2014 11:31 AM
12-23-2014 11:32 AM
Hi Zongjie,
Each ALV object(grid1, grid2, grid3) have their own get_selected_row method. Just call this method to get.
If all the their object return values, means you selected at least one row for each ALV.
regards,
Archer
12-25-2014 6:57 AM
Hi dengyong,
Thanks for your answer. it helps, but when I call the method, it didn't get the data.
First display, then select the row, this method run when I click one button after I select the row.
CALL METHOD grid3->GET_SELECTED_ROWS
IMPORTING
ET_INDEX_ROWS = GT_ROW_TAB1
ET_ROW_NO = GT_NO_TAB1.
12-23-2014 11:37 AM
Hi Zhang,
You can get the line selected by using the get_selected_rows.
Assuming you have the Gr_grid1 ,Gr_grid2, Gr_grid3 objects for 3 alvs when you select the line in first alv then you can read the data by using the corresponding object i.e
GR_GRID1->Get_selected_rows.
if sy-subrc eq 0.
**Perform your action here similarly for remaining two alv's
endif.
Go through this link
Regards,
Pavan
12-23-2014 4:24 PM