Using set with variables enables you to do many operations. In the following example, we will demonstrate some of these features by means of a function. We will first set the value of the Order Type field into a variable, which is then transferred to a custom field we will create on the ensuing SAPMV.4001 screen.
-
Go to the VA01 inisial screen.
-
In the 'SAPMV45A.E0101.sjs' script file, enter the following code to create a toolbar pushbutton. Create the file if it does not exist.
pushbutton([TOOLBAR], "Set", {"process":z_process});
-
Now create the function that will be called by the pushbutton. An example is shown below:
The offset option specifies how far from the box margin the new pushbuttons will be located.
function z_process() {
set("V[z_order]", "&F[Order Type]");
onscreen 'SAPMV45A.4001'
inputfield([1,40], "Order", [1,56], {"size":10});
set("F[Order]", "&V[z_order]");
}
-
Enter the value 'RO' in the new inputfield and press the enter key.
The order type value from the GuiXT inputfield is passed to the VA01 Overview screen as shown below: