‎2007 Jun 19 5:46 AM
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
‎2007 Jun 19 5:58 AM
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
‎2007 Jun 19 5:51 AM
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
‎2007 Jun 19 5:56 AM
I have given name As sel, but not selected. pl. help where where I have to make changes in Programe for the same.
vikas
‎2007 Jun 19 6:02 AM
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
‎2007 Jun 19 5:58 AM
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
‎2007 Jun 19 6:11 AM
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
‎2007 Jun 19 6:24 AM
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 .
‎2007 Jun 19 6:26 AM
‎2007 Jun 19 6:58 AM
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
‎2007 Jun 19 8:09 AM
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
‎2007 Jun 19 7:02 AM
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
‎2007 Jun 19 8:21 AM
Pl. send me sample programe which can be helpful to understand double click command.
thanks
Vikas
‎2007 Jun 19 8:27 AM