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: 

Setting Cursor in desired line in table conrol

Former Member
0 Kudos

Hi All,

I am presently working on a table control where I had to insert a new line in the table control. It had used SAp wizard for this and it is working fine.

here the insertion is happening but the cursor is not coming to the new line instead going to the top line in the display.

I am using 'SET CURSOR ' for setting the cursor position.

Can u pls help in this regard.

Thanks and Regards,

Chaitanya swaroop maka

3 REPLIES 3

Former Member
0 Kudos

Hi

U need to create or insert the code in a module of PBO and using the option LINE and FIELD to define the record and the field where the cursor has to be placed:

SET CURSOR FIELD <FIELD> LINE <LINE>.

The <LINE> can have value from 1 to N, where N is the max number of lines can be displayed in the table control. U can know this information using the system variable SY-LOOPC.

Max

Former Member
0 Kudos

In the PBO create a module.

first describe your internal table using the below syntax.

Describe table itab lines v_lines.

iv_lines = v_lines + 1.

set cursor field < field name>

line v_lines.

where TC- is the definition of your table control

hope this helps.

Regards,

Ravi

Former Member
0 Kudos

Hi,

try this one.

after inserting the new line in table control.

w_line = tc-currentline + 1.

set cursor field <fieldname> line w_line.

regards

padma