02-28-2007 8:29 AM
Hi,
In my program I am using one table control...in that if i give F4 it has to show one subscreen based on theline where I gave F4 in the table control.
If I have 15 line items to be displayed in the table control,Initially the table control will display number of line items Say for example 10 line items...if i give scroll down it will display rest of the line items....In this case if i give F4 it is giving the cursor value as 3 instead of 13...
i need the exact cursor position in table control...if i give F4 in 14 th line itemsit has to give 14 not 4...
02-28-2007 8:30 AM
05-09-2007 7:40 AM
05-09-2007 7:49 AM
I did like this...
L_f4line is a variable...
character_values -- atbel control
get cursor
field lv_cursor_field
Line lv_cursor_line
value RCTMS-MWERT.
L_f4line = character_values-current_line + ( lv_cursor_line - 1 ).
lv_cursor_line = l_f4line.
05-09-2007 12:30 PM
Hi,
This method seem to work even when we scroll.
Here " test " is the tableview control.
**********CODE*****************
CLEAR cursorline. "Cursor line
CLEAR curline. "Current top line of the window
CLEAR wa_z2604. "Work area to get the exact record where cursor is placed
curline = test-current_line.
GET CURSOR LINE cursorline.
IF curline NE 1.
IF cursorline NE 1.
cursorline = cursorline - 1.
curline = curline + cursorline.
ENDIF.
ELSE.
curline = cursorline.
ENDIF.
READ TABLE it_z2604 INTO wa_z2604 INDEX curline.
************END********************
Thank you.
Message was edited by:
Shafiq
05-09-2007 7:46 AM
05-10-2007 5:24 AM
have you chechked TABCTL-CURRENT_LINE value i think it may give you the correct result..
regards
shiba dutta
Message was edited by:
SHIBA DUTTA
04-15-2008 11:16 AM
Hi,
Check for the top line of table control and cursor position. Given below the sample code.
It works for me.
CLEAR wrk_lines1.
GET CURSOR LINE wrk_lines1.
*To get the correct row position in Table control.
wrk_lines1 = wrk_lines1 + tctrl_it_elcitm1-top_line - 1.
Regards,
frank.