You can enhance our InputScript from Tutorial 1 in various ways, using additional user interface elements. |
As a first example, let's offer two pushbuttons instead of one, allowing the user to display the material list for two different plants. Since we want to work with the same InputScript, we define a parameter PLANT. The first pushbutton then starts the InputScript for Plant "1000" (London), and the second one for plant "3000" (Stockholm). In the InputScript, the notation "&U[PLANT]" refers to the parameter value.
GuiXT
Comparing the script
with the version in Tutorial 1 you see that it is
further simplified. The first function code "/NSA38"
is already defined in the pushbutton definition, so
that we get rid of the first "Screen" command
in the script. This saves one Screen-Enter cycle when the
script is executed. |
Instead of defining several pushbuttons, you can also work with radiobuttons and a single pushbutton. In the following example, we start transaction VA01 (order entry) for different order types.
Here we did not use parameter passing; instead we worked with the global variable V[VA01_Ordertype]. If you prefer to start transaction VA01 in alternative mode using the command "/OVA01" instead of "/NVA01", this is no longer possible, since each SAP session has its own set of InputScript variables. You then have to pass the order type as parameter: GuiXT
|
Input fields can be defined in the same way as radiobuttons. Each input field (command "Inputfield") refers to exactly one GuiXT variable: the value of the variable is shown in the input field, and the value that a user entered in the field updates the variable value. In the following example, the user can display the availability of a material in three plants. We use an SAP BAPI to calculate the quantity.
The material number can be entered directly or via SAP matchcode.
The three quantities are displayed.
For wrong material numbers, we display an error message. GuiXT
GuiXT
|