03-13-2007 9:14 AM
Hi all!
I have 2 internal tables g_t_mbew and g_t_sloc.
g_t_mbew is appended trough loop into output table itab_custdata of ALV list.
after display of the first ALV i would like to trigger DOUBLE CLICK event on that ALV. DOUBLE_CLICK should trigger an output of another screen.
My question is as follows: how can i loop at internal table g_t_sloc and search only records that correspond to the DOUBLE_CLICKED row, my search criteria should be MATNR field.
with:
READ TABLE g_t_sloc INTO wa_sl INDEX e_row-index.
i only get one record, how can i retrieve all the record that have same MATNR in g_t_mbew and g_t_sloc????
thanx!
03-13-2007 9:22 AM
FORM USER_COMMAND USING P_UCOMM TYPE SY-UCOMM
P_SELFLD TYPE SLIS_SELFIELD.
CASE P_UCOMM.
WHEN '&IC1'. "Double click
READ TABLE itab_custdata INDEX P_SELFLD-TABINDEX.
v_matnr = itab_custdata-marnr.
loop at g_t_mbew where matnr eq v_matnr.
*here you will get all the records
endloop.
loop at g_t_sloc where matnr eq v_matnr.
*here you will get all the records
endloop.
ENDCASE.
ENDFORM.
03-13-2007 9:19 AM
Hi,
You <b>hide</b> the double click field(MATNR) in the internal table g_t_mbew of first list.
Fetch the corresponding data from MARC/MARD into internal table g_t_sloc.
First basic list pass the internal table g_t_mbew and for use command event for Interactive list of ALV call the internal table g_t_sloc.
Regards,
Anji
Message was edited by:
Anji Reddy Vangala
03-13-2007 9:21 AM
Use the method get_selected_cells. This will tell you the details you require.
03-13-2007 9:22 AM
FORM USER_COMMAND USING P_UCOMM TYPE SY-UCOMM
P_SELFLD TYPE SLIS_SELFIELD.
CASE P_UCOMM.
WHEN '&IC1'. "Double click
READ TABLE itab_custdata INDEX P_SELFLD-TABINDEX.
v_matnr = itab_custdata-marnr.
loop at g_t_mbew where matnr eq v_matnr.
*here you will get all the records
endloop.
loop at g_t_sloc where matnr eq v_matnr.
*here you will get all the records
endloop.
ENDCASE.
ENDFORM.
03-13-2007 9:38 AM
Hi
Below is the reply to each of your questions:
1. How to trigger Double-click?
A. In the PBO of screen, set PF-STATUS. In the PF-STATUS, activate the Function code 'PICK' (F2). Thats all. Now when u double click, the ok_code field will contain the value 'PICK'.
2. How to identify the double clicked record? In the PAI of the screen, write this code.
DATA t_rowids TYPE lvc_t_roid OCCURS 0.
&----
*& Module USER_COMMAND_0100 INPUT
&----
PAI for Screen 100
----
MODULE USER_COMMAND_0100 INPUT.
REFRESH t_rowids.
CALL METHOD obj_alv_grid->get_selected_rows
IMPORTING
et_row_no = t_rowids.
<b>Here t_rowids will contain the row number which is double clicked.</b>
READ TABLE t_rowids INDEX 1.
READ TABLE itab INDEX t_rowids-row_id.
<b> Now itab work area contains the Double clicked record. ITAB is the Internal table displayed in the first screen.</b>
3. how can i loop at internal table g_t_sloc and search only records that correspond to the DOUBLE_CLICKED row, my search criteria should be MATNR field?
LOOP AT g_t_sloc INTO wa_sl WHERE matnr EQ itab-matnr.
Do your processing here.
ENDLOOP.
Same way for g_t_mbew.
Please dnt forget to award points if this was helpful.