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 position the cursor in selected screen field insted of defualt field

Former Member
0 Kudos

Hi All,

Can you pls let me know , how to position the cursor in selected selection-screen filed. My requirement is i have 3 selection-screen fields, By default cursor is positioned on field screen field, but i want the cursor to be positioned at 3rd screen field to enter input, i want to do this coz i am filling first 2 screen fields with default values, so i need to position the cursor at 3 rd screen filed. let me know if it is possible to achieve this.

Thanks in advance.

Regards

Vishal

1 ACCEPTED SOLUTION

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

In the PBO, you need to use the SET CURSOR statment.

SET CURSOR field 'YOUR_FIELD_NAME'.

REgards,

Rich Heilman

11 REPLIES 11

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

In the PBO, you need to use the SET CURSOR statment.

SET CURSOR field 'YOUR_FIELD_NAME'.

REgards,

Rich Heilman

0 Kudos

thanks rich,

can u pls let me know the event name where i can put this command set cursor.thanks.

regards

vishal

0 Kudos

Are you doing a report program or a module pool program. If a report program, you can put this in the AT SELECTION-SCREEN OUTPUT event.

Regards,

Rich Heilman

0 Kudos

Please see the sample program.



report zrich_0001.


parameters:

            p_field1 type c default 'A',
            p_field2 type c default 'B',
            p_field3 type c.


at selection-screen output.

  set cursor field 'P_FIELD3'.

Regards,

Rich Heilman

0 Kudos

Do it at the INITIALIZATION event if it's a program otherwiser if it's a module pool program then set it in PBO.

Cheers

Nishanth

0 Kudos

You can do it at INITIALIZATION also, but it will only set it the first time the screen is throw. It will not re-position it if you put your cursor on another fields and hit enter .

Regards,

Rich Heilman

Former Member
0 Kudos

Hi Rich/Nishanth,

Its working fine with parameters but its not working in case of select-options.

pls check my code.

select-options :

s_bukrs for REGUH-ZBUKR default 'US10',

s_laufd for REGUH-LAUFD default sy-datum,

S_LAUFI FOR REGUH-LAUFI .

at selection-screen output.

set cursor field 'S_LAUFI'.

any thoughts on this, thanks.

regards

vishal

0 Kudos

Set ur cursor on 'S_LAUFI-LOW' instead of 'S_LAUFI' and it will work fine.,

0 Kudos

You will need to point it to the LOW field.



report zrich_0001.

tables: reguh.

select-options :
s_bukrs for REGUH-ZBUKR default 'US10',
s_laufd for REGUH-LAUFD default sy-datum,
S_LAUFI FOR REGUH-LAUFI .

at selection-screen output.
<b>set cursor field 'S_LAUFI-LOW'.</b>

Welcome to SDN! PLease be sure to award points for helpful answer and mark you post as solved when solved completely. Thanks.

Regards,

Rich Heilman

0 Kudos

For select options you have to specify LOW also along with the name. So it will be S_LAUFI-LOW in your case.

Former Member
0 Kudos

i tried with Initialization event also but its not working for select-options.