In the present example an SAP material number should be entered in an input field in Nintex Forms and all possible return values for this material number should be listed in a dropdown box. When the desired material is selected in the dropdown box the material long text is supposed to be displayed in another field.
Step 1: Define the text fields
In our Nintex Form we require three fields with descriptions:
- The first field named Material Number is of type Single Line Textbox. It is the input field for entering the SAP material number.
- The second field named Suggested Materials is of type Choice. All possible matches for the given material number should be displayed and be selectable here in a dropdown list.
- The third field named Material is of type Single Line Textbox. The material long text for the selected material should be displayed here.
After that open the settings for the Choice field.
Since this should be only a display field you can also define under Appearance, that the field is only visible but not enabled.
In the JS code, function tEcs.executeXql is called to read the material number and the material long text from SAP table MAKT.
Step 3: Run the Nintex Form
Run the form and enter a material number. The return values are read from SAP table MAKT and displayed in the dropdown list (Suggested Materials).
When you select a material, the material long text should be displayed in the Material field.