Skip to Content
author's profile photo Former Member
Former Member

Move cursor through fields in screen with ENTER like TAB

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    Posted on Oct 20, 2006 at 02:11 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 20, 2006 at 02:10 PM

    Hi,

    Try like this

    set cursor field 'V_SPART'.

    leave to screen sy-dynnr.

    here for you v_spart should be ur screen field.

    Madhavi

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 20, 2006 at 02:14 PM

    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
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.