Application Development 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: 

How to get the Cursor line in table control?

Former Member
0 Kudos

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

7 REPLIES 7

Former Member
0 Kudos

Im using GET CURSOR

0 Kudos

Hi sumi,

I am having the same problem. Got any solution?

0 Kudos

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.

0 Kudos

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

hymavathi_oruganti
Active Contributor
0 Kudos

u can use

data lin type i.

GET CURSOR LINE lin. in PBO

Former Member
0 Kudos

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

Former Member

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.