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.
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