The system automatically places the initial focus on an appropriate widget (generally input fields) within a Tab Page/Search Page/Grid.
By default, focus is placed on the first enabled field that has a data class defined. (Fields with no Field Name / Table Name defined within Meta Data have no data class.)
If there are no fields within the tab page that satisfy this criterion, the system looks recursively into all the contained frames (list grids, for example).
If no field is found then no element receives focus.
You can override the default behavior at each level via the provision of a focusWidgetOverride() function within the user exit file; this returns either the Name of the Field to receive the focus or null.
If null is returned, the system ignores all fields within this document and continues to search in lower-level documents.
For example:
From within a Tab Page (if you want focus to go on to a sub document):
function focusWidgetOverride() {
return null;
}
From within a List Grid:
function focusWidgetOverride() {
return "TD_TYPE_DRLKY:0$TBL_NAME";
}
From within a Search Page:
function focusWidgetOverride() {
return "LAST_NAME";
}