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

Need help in module pool

Former Member
0 Likes
596

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 )

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
561

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

4 REPLIES 4
Read only

Former Member
0 Likes
561

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

Read only

0 Likes
561

Hi Deepthee,

Thank you for your helpful reply..

Read only

Former Member
0 Likes
562

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

Read only

0 Likes
561

Hi Arunsri,

Thanks a lot. My probelm was sloved with the help of your replied answer...

Regards,

Hetal