‎2008 Feb 05 4:41 PM
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.
‎2008 Feb 05 5:53 PM
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
‎2008 Feb 05 5:09 PM
get cursor
field cursorfield
line cursorline
value cursorvalue.
Use cursorvalue instead of cursorline.
this is working for me.
‎2008 Feb 05 5:53 PM
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
‎2008 Feb 05 6:03 PM
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