2008 Feb 25 7:33 AM
Hi,
Anybody can tell me how to call transaction by double clicking on any row in table control.
Ex. table control contain material no and material description . by double clicking on material number how can i call material master.( MM03 )
2008 Feb 25 7:50 AM
hi,
In the screen layout, for table control attributes, goto display tab and select 'RESPONDS TO DOUBLE CLICK'.
sample code..
&----
*& 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
also check this link...the above prog i got from this link,
Regards,
Arunsri
Hi,
Anybody can tell me how to call transaction by double clicking on any row in table control.
Ex. table control contain material no and material description . by double clicking on material number how can i call material master.( MM03 )
2008 Feb 25 7:49 AM
Hi Hetal,
U can check what sy-ucomm value is populated when
u double click on the table entry.I think its 'NEW',Then u can get the contents of the selected line into wa.lets take the example of ur requirement of material master.
U will have to define a parameter say
MATERIAL(18) type char.
MATERIAL = wa-matnr.
then set parameter id say 'MAT' with MATERIAL
and call transaction mm03 with parameter id 'MAT'.
I think this will solve ur problem.
Reward points if helpful.
Cheers,
Deepthee Kasal
2008 Feb 25 9:08 AM
2008 Feb 25 7:50 AM
hi,
In the screen layout, for table control attributes, goto display tab and select 'RESPONDS TO DOUBLE CLICK'.
sample code..
&----
*& 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
also check this link...the above prog i got from this link,
Regards,
Arunsri
2008 Feb 25 9:10 AM
Hi Arunsri,
Thanks a lot. My probelm was sloved with the help of your replied answer...
Regards,
Hetal
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |