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

Setting cursor in table control

vinotha_m
Participant
0 Likes
1,566

HI,

The statement,

SET CURSOR FIELD 'SCR_100' LINE scr_100-current_line.

does not.

How can i set cursor on table line.

11 REPLIES 11
Read only

Former Member
0 Likes
1,217

try ...

set cursor field <b>scr_100-field1</b> line scr_100-current_line.

where scr_100 is your table control name and field1 is the column where u want to set the cursor in the row specified by scr_100-current_line

u r just missing the column of the table where u want to set the cursor

rgds,

PJ

Message was edited by: Priyank Jain

Read only

0 Likes
1,217

Thank you Priyanka for replying

but the field is an internal table field and when i give field name as it_ekpo-matnr it does not work, though it does not give any syntax errors.

But scr_100-it_ekpo-matnr gives an error

The data object "SCR_100" does not have a component called

"IT_EKPO-MATNR".

Message was edited by: Vinotha M

Read only

christian_wohlfahrt
Active Contributor
0 Likes
1,217

Hi, it's more like

SET CURSOR FIELD 'MY_STRUC-MATNR' LINE 5.

Regards,

Christian

Read only

0 Likes
1,217

Hey Christian,

this also does not work.

Read only

Former Member
0 Likes
1,217

Hi,

u should write the statement in the PBO of the screen.

At PBO you can set the cursor on a specific field of a specific row of a table control.

SET CURSOR FIELD <f> LINE <lin> [OFFSET <off>].

Thanks,

Ruthra

Read only

0 Likes
1,217

Hey Ruthra,

But i tot this was only for tabstrip controls,

Anyway this too doesnt work..

Can u elaborate pleeez.

Read only

0 Likes
1,217

Hi!

Looks like you have a problem in finding the correct name. Just make a 'GET CURSOR' in PAI, then you can see in debugging how SAP expects the naming.

Regards,

Christian

Read only

0 Likes
1,217

get the screen name of that field not the internal table field name through which you are looping at.

code is:

set cursor field 'name of the field' line table_control_name-current_line.

this works....

Read only

0 Likes
1,217

HEy ,

Thanks Christian,

That was my problem.

Read only

0 Likes
1,217

Hi Christian,

i am working with the table control.

i have two push buttons as page up and page down, corresponding code is been written as well, and those are working well and making the table control to scroll up and down.

nut when i press page up and page-down from the keyboard the vertical scroll bar doesn't moves.

To make page down and page up to work i have to select some particular record on the table control.

i.e. if i set the cursor at every top_line of the table control the page down and page up from the keyboard will start working.

but i have a doubt how to work on it.

as you helped in solving the problem of set cursor.

so i thought of asking your help on this issue.

i will be thankful to you, if you guide me.

thanks,

ekta

Read only

0 Likes
1,217

hi

the issue is been resolved.

index_t = tab_ctrl1-top_line.

index_d = tab_ctrl1-top_line + n.

set cursor field 'WA_MATERIAL_DATA-MATNR' line N OFFSET INDEX_T.

thanks

ekta