Using setcursor with GuiXT fields

To set the cursor into a GuiXT field, you must use the field name - using the coordinates is not currently supported. In the following example, we will create three inputfields on the main Easy Access screen and place the cursor into the third field.
  1. Launch SAP and navigate to the Easy Access screen:
  2. Open the 'SAPLSMTR_NAVIGATION.E0100.sjs' script file, and enter the following code. Create the file if it does not already exist.
              inputfield([0,1], "TEST1", [0,10], {"name":"z_test1", "size":10});
              inputfield([1,1], "TEST2", [1,10], {"name":"z_test2", "size":10});
              inputfield([2,1], "TEST3", [2,10], {"name":"z_test3", "size":10});
              setcursor("F[TEST3]");
            
  3. Save the changes and refresh the SAP screen. It will now display as shown below:


The cursor will be placed in the third field as shown above. To change the cursor position, change the field name in the setcursor command.