Hello experts !
I want to move the cursor between fields in a custom screen just like kay TAB do.
I have used command:
MOVE CURSOR TO FIELD mara-spart... but it doesnt work, Cursor remains in th first field..,
any help?
Thank you and regards,
Ibrahim Andres
Hi, the trick here is that you need to know where the cursor is and what is the next logical field which will need to be handled manually. So use the GET CURSOR statement and SET CURSOR statement.
In the PAI, use the GET CURSOR statement when the user presses ENTER, then in the PBO, you can SET CURSOR, but you will need to do some logic. For example, say you have 3 fields, P_FLD1, P_FLD2, P_FLD3. The logic is that when the user is on P_FLD1, the next cursor position should be on P_FLD2, and so on. So in your PBO, you will need to do like so. Here CURSORFIELD is the variable holding the field name that the cursor is currently on.
data: cursorfield(30) type c. data: new_cursorfield(30) type c. case cursorfield. when 'P_FLD1'. new_cursorfield = 'P_FLD2'. when 'P_FLD2'. new_cursorfield = 'P_FLD3'. when 'P_FLD3'. new_cursorfield = 'P_FLD1'. endcase. set cursor field new_cursorfield.
Regards,
Rich Heilman
The problem will be that when you move the cursor using the TAB key, the process is handled by the user's PC (Windows). If you want to have the same functionality with the ENTER key, you can do it, but the process will have to go back to the screen where it will run more slowly.
Rob
Add a comment