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 Table Control

former_member227596
Participant
0 Likes
1,349

Dear Abapers,

I m working on Table control have data total 10 records. when I double click on the 3 record. it does not select the 3 record instead selects last record. Pl. help how I select the 3rd record.

thanks & regards

Vikas

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,256

Hi,

When you double click do the following..

DATA: v_line TYPE sytabix.

  • Get the line.

GET CURSOR LINE v_line.

  • To get the current index..

V_LINE = xc_table-top_line + v_line - 1.

  • The XC_TABLE is your table control name..

Thanks

Naren

12 REPLIES 12
Read only

former_member196299
Active Contributor
0 Likes
1,256

HI Vikas ,

I think you have not set the selection column for your table control , to do so , go to the attributes screen of the table control and there in the fields you will get an option for ' selection ' write a veriable name there eg SEL and then save n activate it . declare the SEL variable as char 1 in your program and the activate everything .Then you should be able to select anyline of your TC .

Regards,

Ranjita

Read only

0 Likes
1,256

I have given name As sel, but not selected. pl. help where where I have to make changes in Programe for the same.

vikas

Read only

0 Likes
1,256

vikas,

First of all declare the SEL variable in the TOP Include or at the declaration area of your program .

Again go to the attributes screen of your table control , and search for a radio button for Line selection . of it is < none > then change it to <single> or <multiple >.

Revert if you need further help !

Regards,

Ranjita

Read only

Former Member
0 Likes
1,257

Hi,

When you double click do the following..

DATA: v_line TYPE sytabix.

  • Get the line.

GET CURSOR LINE v_line.

  • To get the current index..

V_LINE = xc_table-top_line + v_line - 1.

  • The XC_TABLE is your table control name..

Thanks

Naren

Read only

former_member227596
Participant
0 Likes
1,256

I tried same as u have told. But still collecting Last record.

module table2_change_tc_attr.

*&SPWIZARD: MODULE TABLE2_CHANGE_COL_ATTR.

loop at itab1

with control table2

cursor table2-current_line.

module table2_get_lines.

*&SPWIZARD: MODULE TABLE2_CHANGE_FIELD_ATTR

endloop.

module status_0100.

*

process after input.

*&SPWIZARD: PAI FLOW LOGIC FOR TABLECONTROL 'TABLE2'

loop at itab1.

chain.

field itab1-vnumber.

field itab1-times.

module table2_modify on chain-request.

endchain.

FIELD WTABLE module check_pick.

endloop.

module table2_user_command.

*&SPWIZARD: MODULE TABLE2_CHANGE_TC_ATTR.

*&SPWIZARD: MODULE TABLE2_CHANGE_COL_ATTR.

module user_command_0100.

process on value-request.

field zcustomer module create_dropdown_box.

MODULE check_pick INPUT.

IF SY-UCOMM = 'PICK' .

message s001(009) with 'ttttttttt1111111' itab1-vnumber.

  • SET PARAMETER ID 'MAT' FIELD ITAB1-MATNR.

  • CALL TRANSACTION 'MM03' and SKIP FIRST SCREEN.

ENDIF.

*

ENDMODULE. " check_pick INPUT

Following is the code I have written

vikas

Read only

0 Likes
1,256

hi Vikas ,

I dt think you can use PICK in table controls . Rather , try like this, you use the SEL variable to select the line and then captrue the line value and then display .

use it like this .

in PAI,

loop at tab_con .

check for which row the SEL is set to X and then display that record in your message .

endloop.

i hope this works .

Read only

Former Member
0 Likes
1,256

hi,

Please check my reply

Thanks

Naren

Read only

former_member227596
Participant
0 Likes
1,256

Not under stand. I m puzzled. My Table Control Name is Table2.

I have a field call mark in internal table. assigned in table control.

When I select the row & the double click on any field of row. The it assign 'X" to Mark (Sel). I want to do is when I double click without selecting Mark, It show me current Line Values.

Pl. help.

regards

Vikas

Read only

0 Likes
1,256

hi Vikas ,

I can provide some other hint , i m trying to solve this problem in the mean time u can also do a trial on this .

Sorry , in my previous reply i told we cant use PICK but we can use it and like this : In your PF-STATUS , for function key F2 Set a function code PICK for double clicks.This is how we can pick function code for double click .

Next in your screen field attribute select the check box for " Respond to double clicks ' .

Next in your program code in user-command event ,

when PICK , then get the values in to a wa and then show it in a message .

in PAI

after the loop at table control and endloop stmt write the following code .

Module user-command input .

case ok_code.

when 'PICK'.

message I030(ZRMSG) with g_tab_con_01_wa-carrid g_tab_con_01_wa-connid .

endcase.

endmodule .

I tried this,its working fine

Read only

Former Member
0 Likes
1,256

Hi,

When you double click do the following..

DATA: v_line TYPE sytabix.

  • Get the line.

GET CURSOR LINE v_line.

  • To get the current index..

V_LINE = xc_table-top_line + v_line - 1.

  • The XC_TABLE is your table control name..

Thanks

Naren

Read only

0 Likes
1,256

Pl. send me sample programe which can be helpful to understand double click command.

thanks

Vikas

Read only

0 Likes
1,256

Thanks

it works.

vikas