Length/Type: INT, 3
Modifiable: YESThis system field provides form navigation functions. @NEXT_ITEM can be used in two ways:
1. Read its value to determine where the cursor is on the screen.
2. A new value can be stored to move the cursor to a specified field upon return from a field's trigger routine.
A value can be assigned to this system field in the “performed” trigger routine for a data field. When a value is assigned to this system field, the cursor will move to the corresponding field item. The Screen Management Facility (SMF) examines and acts upon @NEXT_ITEM upon return from a data trigger or a final trigger, but not upon return from a HELP trigger.
@NEXT_ITEM is set to a number that corresponds to the form FIELD (to position the cursor). Form fields are processed in the same order that they appear in the LAYOUT, not in the order that they appear on the screen.
SMF sets @NEXT_ITEM to the number of the current field just before a performed trigger is executed. When setting @NEXT_ITEM, a value must be supplied that is different from the current value and that is in the proper range. Otherwise, @NEXT_ITEM is ignored and no error indication is given.
This system field cannot be used to reprocess the same form field. The way to reprocess the same field is to set @FILL_ACTION to "REDO".
Check @NEXT_ITEM within the performed trigger. @NEXT_ITEM returns the sequence number of the field where the cursor is positioned. @NEXT_ITEM is like the system field @MENU_CHOICE in this respect, except that @NEXT_ITEM can be used with forms or menus.
This could be used for forms that contain columnar information with the same set of fields appearing on several consecutive screen lines. The same performed trigger could be executed for a field no matter what line it is on. Within the performed trigger, @NEXT_ITEM could be checked to find out where the cursor is.
SEE ALSO: FILL statement/command (earlier in this section).