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

set cursor position on select lines in table control

Former Member
0 Likes
1,051

I have data in table control and when the user selects a row, modified data and clicks on sav ebutton, the cursor should be set back to the selected line.

here the cursor defaults to the first row of the table.

Plz let me know how i can set cursor to the first selected row...

I have data in table control and when the user selects a row, modified data and clicks on sav ebutton, the cursor should be set back to the selected line.

here the cursor defaults to the first row of the table.

Plz let me know how i can set cursor to the first selected row...

2 REPLIES 2
Read only

Former Member
0 Likes
580

You can write simple if condition,

where you are writing cursor position ? then write the code :

if sy-ucomm ne 'SAVE'.

here mentioned default set cursor position

endif.

Read only

Former Member
0 Likes
580

HI,

TOP_LINE -->Also set by the SAPgui through the vertical scroll bar slider.

CURRENT_LINE---> Read only, set by the system ( TOP_LINE + SY-STEPL - 1 )

LEFT_COL -


>Also set by the SAPgui through the horizontal scroll bar slider.

COLS-INDEX --->Also set by the SAPgui after moving columns.

COLS-SELECTED --->Also set by the SAPgui after column selection.

tese all are the fields of structure TABLEVIEW, using these fields we can palce the cursor position.

<u><b>U Follow this code ...</b></u>

CONTROLS ctrl TYPE TABLEVIEW USING SCREEN scr.

PROCESS BEFORE OUTPUT.
LOOP AT itab WITH CONTROL ctrl CURSOR ctrl-CURRENT_LINE.
ENDLOOP.

PROCESS AFTER INPUT.
LOOP AT itab WITH CONTROL ctrl.
  MODULE ctrl_pai.
ENDLOOP.

regards,

Ashokreddy.