Skip to Content
author's profile photo Former Member
Former Member

table controls for 2 tables in 1 screen

Hi, I have search in many different places for the usage of table controls and found many helpful information but still need some more help on the following:

I have 2 tables displaying in one screen, table a and table b. They display similar data, e.g. names of people, but of different departments.

What I want to do is call another transaction if I double click on any name in any one of the two tables.

The problem that I have is that I do not know how to specify which table should be used when double-clicking. Here is part of my code:

MODULE tc_b_command INPUT.

ok_code = sy-ucomm.

PERFORM user_ok_tc USING 'TC_B'

'T_B_LIST'

' '

CHANGING ok_code.

IF sy-ucomm = 'DBLCLICK'.

GET CURSOR LINE h_selline.

h_selectix = TC_B-top_line + h_selline - 1.

READ TABLE t_detail_kvi_lijst INDEX h_selectix.

h_name = t_detail_kvi_lijst-matnr.

SET PARAMETER ID 'MAT' FIELD h_name.

ENDIF.

ENDMODULE.

MODULE tc_A_user_command INPUT.

ok_code = sy-ucomm.

PERFORM user_ok_tc USING 'TC_A'

'T_A_LIST'

' '

CHANGING ok_code.

IF sy-ucomm = 'DBLCLICK'.

GET CURSOR LINE h_selline.

h_selectix = TC_A-top_line + h_selline - 1.

READ TABLE t_detailstuklijst INDEX h_selectix.

h_matnr = t_detailstuklijst-matnr.

SET PARAMETER ID 'MAT' FIELD h_matnr.

ENDIF.

ENDMODULE.

MODULE user_command_9560 INPUT.

GET PARAMETER ID 'MAT' FIELD h_matnr.

CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.

ENDMODULE. " USER_COMMAND_9560 INPUT

When I get to the CALL TRANSACTION part, it does not use the correct parameter. Please give me some tips and tell me where I should change my program. Thanx.

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Jun 18, 2004 at 03:35 AM

    Hi Deon,

    I believe your problem is you are not able to identify which table control has triggered the double click from the program.

    If this is the problem then you can make use of

    GET CURSOR FIELD wf_fieldname.

    Then based on the field name you will be able to decide which field/table control has triggered the PAI double click.

    Hope this helps.

    Pavan

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.