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

Table control -- Current line

Former Member
0 Likes
4,698

Hi All,

I am trying to read the current line number that is being edited in the Table control using the statement GET CURSOR LINE. However, when I scroll down to the first line of the next page of the TC, I am getting the line number as '1' instead of '15'.

Is there any way to overcome this issue?

Thanks,

Raj.

1 ACCEPTED SOLUTION
Read only

Former Member
2,131

Hi,

Try this code to the get the current line

DATA: v_sel_line LIKE sy-loopc,

v_tabix LIKE sy-tabix.

GET CURSOR LINE v_sel_line.

v_tabix = tc-top_line + ( v_sel_line - 1 ).

      • tc will be your table control name.

      • v_tabix will have the current line.

      • Then use READ TABLE with V_TABIX to get the current

      • row value.

Thanks

Naren

3 REPLIES 3
Read only

former_member191735
Active Contributor
0 Likes
2,131

get cursor

field cursorfield

line cursorline

value cursorvalue.

Use cursorvalue instead of cursorline.

this is working for me.

Read only

Former Member
2,132

Hi,

Try this code to the get the current line

DATA: v_sel_line LIKE sy-loopc,

v_tabix LIKE sy-tabix.

GET CURSOR LINE v_sel_line.

v_tabix = tc-top_line + ( v_sel_line - 1 ).

      • tc will be your table control name.

      • v_tabix will have the current line.

      • Then use READ TABLE with V_TABIX to get the current

      • row value.

Thanks

Naren

Read only

Former Member
0 Likes
2,131

What if the user edits a number of lines? Or edits one line and goes down a few lines? It's best to look at the entire table.

Rob