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 pass control by ENTER KEY

Former Member
0 Kudos

Hi,

By default SAP is using TAB button to move from one field to another field in Screen. Can i make it when i press Enter?

Regards,

Lijo Joseph

1 ACCEPTED SOLUTION

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Yes, you can, you will have to code for it though. You have to remember where the cursor was and determine where it should go next. Use SET CURSOR and GET CURSOR.

In your PBO,

SET CURSOR FIELD CURSORFIELD.

In your PAI, do something like this.

CASE SY-UCOMM.

WHEN 'ENTER'.

  • Scroll thru fields when user hits enter

GET CURSOR FIELD CURSORFIELD.

CASE CURSORFIELD.

WHEN 'P_FLD1'.

CURSORFIELD = 'P_FLD2'.

WHEN 'P_FLD2'.

CURSORFIELD = 'P_FLD3'.

WHEN 'P_FLD3'.

CURSORFIELD = 'P_FLD4'.

WHEN 'P_FLD4'.

CURSORFIELD = 'P_FLD5'.

WHEN 'P_FLD5'.

CURSORFIELD = 'P_FLD1'.

ENDCASE.

ENDCASE.

Good luck,

Rich Heilman

1 REPLY 1

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Yes, you can, you will have to code for it though. You have to remember where the cursor was and determine where it should go next. Use SET CURSOR and GET CURSOR.

In your PBO,

SET CURSOR FIELD CURSORFIELD.

In your PAI, do something like this.

CASE SY-UCOMM.

WHEN 'ENTER'.

  • Scroll thru fields when user hits enter

GET CURSOR FIELD CURSORFIELD.

CASE CURSORFIELD.

WHEN 'P_FLD1'.

CURSORFIELD = 'P_FLD2'.

WHEN 'P_FLD2'.

CURSORFIELD = 'P_FLD3'.

WHEN 'P_FLD3'.

CURSORFIELD = 'P_FLD4'.

WHEN 'P_FLD4'.

CURSORFIELD = 'P_FLD5'.

WHEN 'P_FLD5'.

CURSORFIELD = 'P_FLD1'.

ENDCASE.

ENDCASE.

Good luck,

Rich Heilman