Userexits at Menus

Userexits at menus can be used to trigger program functions at a menu item.

All menu userexits are on_select-userexits, for the internal event detecting routine of DataView (general event loop) passes only one trigger; the on_select-trigger. DataView will execute the program function if the user selects and confirms the item. After executing the function, program control is returned to the general event loop and the opened menu is removed from the screen.

When calling userexits at menu items make sure that you only trigger functions that make sense at the menu. It is especially important to differentiate between object-independent (pull-down menus) and object-dependent menus (widget menus, field selection menus). For example, it does not make any sense to put the standard userexit dal_iwf_edt_lis, which prepares data within a mask for editing, at the item of an object-independent pull-down menu. This userexit had better be used in a widget menu, i.e. an object-dependent menu, which is defined directly at the mask to be edited.

In addition to the userexit name you can pass a parameter string at the on_select-trigger of a menu item. The userexit name is defined at the menu and the parameter string at the menu - item assignment. This allows you to initiate different functions when using an item in several menus, provided you interpret the passed parameters in the userexit differently.