Pre-field userexit to create a dynamic field menu for lookup tables. The general feature of this function is to show a user a readable representation of id values. A lookup table (LUT) normally has the following structure:
00005 10 Assembly The item is an assembly
00001 20 Part The item is a part
00004 30 Product The item is a product
-
EDB_ID Unique internal key for the LUT entry.
-
EDB_SEQUENCE Order the LUT entries are displayed.
-
EDB_SHORT_TEXT Multi-lingual(!) attribute with values shown to the user.
-
EDB_DESCRIPTION Multi-lingual(!) attribute with values shown to the user.
As a result of this function a menu will be attached to the field where this pre-field userexit is defined. Depending on the
/OnlyOnce flag, it checks if the menu already exists in the local memory and cleared if appropriate. The menu will have as many selections as records in the LUT widget (maybe additionally the 'Clear' entry). The text of the selections is created by using the desired columns of the widget. The first defined column will be written to the current field.The userexit of each selection is
xlut_set_men_sel and the parameter is the same as for this function.
- Parameters:
-
| usxContext | The userexit context. |
| param | Parameter to control the behavior of this userexit. Syntax like:
/Id=LUT-Id-Column /Target=<Field> [/WidgetBuffer=<Key>] /Menu=<Name> [/MenuSize=<Size>] [/Columns="<Column>[,<Column>]*"]
{ { /Entity=LUT-Entity [/QueryMask=<Mask>] [/Order="[+|-] <Order-Column>[,[+|-]<Column>]*"]
[/Query="<Column> <Value>|\@<TableField>[,<Column> <Value>|\@<TableField>]*"] }
|
{ /Widget=<Widget-Id>} }
[/Clear] [/UpdateConstraints] [/OnlyOnce] [/NoCheck] |
With possible arguments
| Id | id | Defines the primary key of the LUT. |
Either /Target, or /WidgetBuffer is used, or both.
| Target | fieldname | Defines the target field the LUT id is filled in (field of the current mask). |
| WidgetBuffer | key | Writes the value with the key in the widget buffer. |
| Menu | name | Defines the name for the field menu |
| MenuSize | height | Defines the maximum size of the menu (default = 10). A scrollbar will be attached if more selections are added to the menu. |
| Columns | column list | Defines which columns of the LUT widget shall be copied to the menu. If omitted all columns of the LUT widget are used to create the menu entries. |
Either /Entity, or /Widget is used to define a LUT widget to copy the menu entries.
| Entity | entity name | Defines the LUT entity to be used. |
| QueryMask | mask name | Defines a mask to be opened for LUT entries. The default list of the LUT entity is used if /QueryMask is not given. The widget has to contain the primary key of the LUT. |
| Order | sort order | Optionally, defines which columns shall be used to sort the records in ascending (+, default) or descending (-) order. |
| Query | query condition | Optionally, defines the query entries to be applied to the widget. With <TableField> the value will be read from the field of the current mask. Attention: When query field is of type string or date, use DTV syntax with ''. |
| Widget | widget id | Defines a widget with LUT entries, this may e.g. be created using LogiView. This function uses the entries in the widget to fill the menu with selections. The widget has to contain the primary key of the LUT. |
| Clear | | /Clear adds a selection to the menu to clear the target field. |
| UpdateConstraints | | /UpdateConstraints updates all fields that are under constraint of the target field. |
| OnlyOnce | | /OnlyOnce creates the field menu only the first time when this pre-field userexit is called. It will always be attached to the field. |
| NoCheck | | Disables the cch_chk_men call to check if the entered data is a valid menu entry. |
- Example:
- Call of pre-field userexit like:
/Menu=EDB-LUT-MEN
/Entity=EDB-LUT
/Columns="EDB_SHORT_TEXT,EDB_DESCRIPTION"
/Order="+EDB_SEQUENCE"
/Query="EDB_ID >=200,EDB_SEQUENCE <=40,EDB_NAME !'TEST %'"
/Clear
/UpdateConstraints
/OnlyOnce
/OptimizeWidth)
- Returns:
-
- See also:
- xlut_set_men_pof