Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Double click event in module pool

Former Member
0 Likes
1,392

hi,

In modul pool iam using table control , when the user double click on a line in the table control it should call another screen.

here i want to capture the data which the user selects in table control.

based on that value i can display its item details .

Edited by: Alvaro Tejada Galindo on Feb 14, 2008 12:36 PM

hi,

In modul pool iam using table control , when the user double click on a line in the table control it should call another screen.

here i want to capture the data which the user selects in table control.

based on that value i can display its item details .

Edited by: Alvaro Tejada Galindo on Feb 14, 2008 12:36 PM

1 REPLY 1
Read only

Former Member
0 Likes
623

Hiii..

I'm attaching a sample code with this..

In your PF-STATUS enable F2 giving an okcode.

( You can find it in PF-STATUS -> Function keys -> Recommeneded function keys)



&---------------------------------------------------------------------
*& Include MZ_DBLCLICK_TCTOP Module pool SAPMZ_DBLCLICK_TC
*&
&---------------------------------------------------------------------

PROGRAM sapmz_dblclick_tc.
TABLES:scarr.
CONTROLS: tc1 TYPE TABLEVIEW USING SCREEN '9000'.

DATA: it_scarr TYPE TABLE OF scarr,
wa_scarr LIKE LINE OF it_scarr,
wa_scarr1 LIKE LINE OF it_scarr,
ok_code TYPE sy-ucomm,
wa_cols LIKE LINE OF tc1-cols.

DATA: ws_field(30),
ws_line TYPE i.

&---------------------------------------------------------------------
*& Module status_9000 OUTPUT
&---------------------------------------------------------------------

text 
----------------------------------------------------------------------
MODULE status_9000 OUTPUT.
" Here I've set Ok_code As 'DBLCLICK' for F2 functionKey
SET PF-STATUS '9000'.
SELECT * FROM scarr INTO CORRESPONDING FIELDS OF TABLE it_scarr.
ENDMODULE. " status_9000 OUTPUT
&---------------------------------------------------------------------
*& Module USER_COMMAND_9000 INPUT
&---------------------------------------------------------------------

text 
----------------------------------------------------------------------
MODULE user_command_9000 INPUT.
CASE ok_code.
WHEN 'DBLCLICK'.
GET CURSOR FIELD ws_field LINE ws_line.
IF ws_field EQ 'WA_SCARR-CARRID'.
READ TABLE it_scarr INDEX ws_line INTO wa_scarr1.
CALL SCREEN 9001.
ENDIF.
ENDCASE.
ENDMODULE. " USER_COMMAND_9000 INPUT

Hope it helps..

If so Notify us..

Regards,