Create a Local variable
Local variables are the variables which are not related to any table, or database. These are created locally for a particular program to display certain calculated values which are not fetched from the database. It can also be used to receive and store certain values for further calculations within the program, rather than saving the values directly in the database.
To create a local variable follow the following steps
- Select the program for which the local variable needs to be added. Here the program selected is ‘c/custmord.p’.
- Add a text box widget on the program by drag and drop method
Type the widget name in the Widget-name field, (here the name v-budget1 is entered) and check the Local variable (You can also set/update the widget properties later from the Widgets tab as well) and click ok.
Go to the Widgets tab, select the type for the local variable from the Data-type Here, the data type Integer is selected.
- Select a widgettype from the field Widgettypes, the widget type selected here is Fill-In.
- Uncheck the fields Enabled new, Enabled update
- In section Widget Label Properties, uncheck Def label and Left align label
- In section Widget Field/Lookup Properties , uncheck Def Lookup
- In section General Properties, check Local var field, and uncheck Hide
- You can provide the height and width of the widget from Position Properties, default standard value will be taken if not provided. You can change the width and height of the widget directly by resizing them in the graphical mode (Screen Editor) later.
The above steps are shown in the figure below:

- Once above steps are completed, click on the save button.
- In the screen editor, you can find that the new local variable has been created in the customer maintenance program, as shown in the figure below:

- The local variable field can be adjusted to be placed at any location in the screen by dragging and dropping the field. When the program is opened through My_Menu > Customer the local variable added is visible in the screen which has been placed to a more proper position as shown in the above figure.