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: 

how to set focus focus on field

Former Member
0 Kudos

Hello, I do something like that:

1. enter some data on screen

2. call another screen

3. back to first screen

the problem is.. after the 3. step SAP set default focus (cursor) on first field on screen. I need to set cursor (by calling some code) on field that I choose. How to do it? Please help.

6 REPLIES 6

Former Member
0 Kudos

Hi

SET CURSOR { { FIELD field [LINE line] [[DISPLAY] OFFSET off] }

| { col lin } }.

is the code to set focus on a field in the screen

Message was edited by:

Vasudha L

Former Member
0 Kudos

Hi,

We SET CURSOR or GET CURSOR to place the cursor on the desire field.Is this wat you were looking out for?

Thanks,

pavithra

0 Kudos

Before I post this problem to this forum I've checked SET CURSOR command... It doesn't work. SAP still place CURSOR on first field on screen. Any other ideas?

former_member208517
Participant

The command SET CURSOR should work.

But please be noted that when you use it, you should mark the field name with ''.

for example:

you have a field named MARA-ZZPROCESS on the screen, you should use as below to place the focus on it in the PBO module of the main screen.

   SET CURSOR FIELD 'MARA-ZZPROCESS'

former_member946717
Contributor

Hi Marcin,

There are different ways to do this:

1.If this field on the selection screen is a standard field, it may have a parameter id. You can  use SET PARAMETER/GET PARAMETER and get the field.

2. Else, you can use IMPORT/EXPORT statements.

IMPORT <selection field value> from <selection field value> to MEMORY ID 'MEM'.

EXPORT <selection field value> to <selection field value> from MEMORY ID 'MEM'

Let me know if you need any more information. Hope this helps!

raymond_giuseppi
Active Contributor
0 Kudos

As already written, use SET CURSOR, but code this IN PBO and with actual field name (uppercase) as it appears in LOOP AT SCREEN.

Regards,

Raymond