Defining the parameter file

The lines in the parameter file cannot exceed 1024 characters (including comments). The PSMI interface interprets the parameter file line by line. The interpretation of a line depends on the first character in the line (leading blanks are stripped). Empty lines are skipped and lines starting with an exclamation mark "!" are also skipped.

STATEMENT

The parameter file consists of several statements. A statement defines one or more commands that are sent to the M3 BE. Each statement can be executed from M3 SWB.

A statement definition starts by declaring the name of the statement in square brackets:

[<Statement name>]

@TITLE

During the execution of a statement, you can display a text in M3 SWB description. This ext is written by using a title definition line:

@TITLE=<Text describing statement>

@PROGRAMNAME

Each command defined in a statement connects to a program on the M3 BE. The program name is specified by using a program name definition line:

@PROGRAMNAME=<Program name>

@FUNCTIONNAME

There are several programs on the M3 BE and every program contains several functions. The function name is specified by a function name definition line:

@FUNCTIONNAME=<Function name>

@TYPE

There are functions used for retrieving, sending, deleting and updating data on the M3 BE. The type of a function is specified using a function type definition line:

@TYPE=<Function type>

These function types are available:
  • SEL

    Selects multiple records

  • GET

    Selects a single record

  • ADD

    Adds a record

  • DEL

    Deletes a record

@ARG

A command sent to the M3 BE may be accompanied with data. The layout of this data is described by the argument lines. An argument line defines the value of a field in the command string sent to M3 BE. A fixed value can be used or an M3 SWB field can be used directly or modified by one or more functions. An argument line consists of seven elements separated by semicolons. The syntax of the argument line is:

@ARG=<Infor M3 BE field name>; <Fixed value> ; < Argument condition/functions> ; <Infor M3 SWB field name> ; <From position:To position> ; <Comment>

M3 BE field name or offset. This element specifies the position of an M3 BE field in the command string sent to the M3 BE. An M3 BE field can be specified by using a symbolic name or a numeric offset and length. The symbolic name contains both offset and length information.
Element Description
M3 BE field This element is used to specify the position of an M3 BE field in the command string that is sent to the M3 BE. A symbolic name that contains offset and length information is used to specify this element.
Fixed value This element can be specified by using these fixed values:
  • GETCONO for company number
  • GETFACI for facility
  • GATWAHO for warehouse
  • GETPLAR for planning area
  • GETDIVI for division
  • GETWHGR for warehouse group
  • GETHORIZON for horizon
  • GETPOLICY for planning policy
  • GETCALCSTART for calendar start
  • BETCALEND for calendar end
  • GETUSERID for user ID
  • GETHORIZONDATE for horizon date
Argument condition/functions This element is used to specify if an argument condition or one or more functions are used.
Note: If fixed values are used in the argument line, leave this field blank.
M3 SWB field name This element is used to specify the M3 SWB field name. A symbolic name that contains data type, offset, and length information is used to specify this element.

If you specified a fixed value in the fixed value element, leave this field blank.

From position: To position If the M3 SWB field is a character field, use this element to specify the beginning and end position within the field.
Note: If this element is blank, the whole M3 SWB field is used.
Comment This element is used to specify any comments related to the argument.

@RARG

Some commands sent to the M3 BE return a response. This response can contain data that are to be transferred to M3 SWB. The return argument line is used to define into what M3 SWB field the data from the M3 BE is placed and from where it should be taken in the returned string. A return argument line consists of seven elements separated by semicolons. The syntax of a return argument line is:

@RARG = <Infor M3 BE field name> ; <Fixed value> ; <Argument condition/functions> ; <Infor M3 SWB field name> ; < From position:To position > ; <Comment>
Element Description
M3 BE field name or offset This element specifies the position of an M3 BE field in the string received from the M3 BE. An M3 BE field is specified by using a symbolic name or a numeric offset and length.
Fixed value This element states a fixed value. If a fixed value is used then no M3 BE field should be defined (the previous two elements are left blank.
Argument condition/functions This element states if an argument condition or one or more functions are used.
M3 SWB field name This element states the M3 SWB field name. The M3 SWB field name is specified by using symbolic names.
From position:To position If the M3 SWB field is a character field, you can address only a part of the field by specifying a from and a to position within the field. If this element is left blank the whole field is used. The from and the to position is separated by a colon.
Comment This element is used to specify any comments related to the argument.

@LINKED

A statement defines one or more commands that are sent to the M3 BE. A command definition consists of a program name, a function name and type, several argument lines and several return argument lines. The commands can be linked together within a statement by the @LINKED line. After the first command definition in the statement, write @LINKED on a line and define the next command.

The linked commands in a statement are executed sequentially.

@SKIP

This is used when you want to skip execution of a particular command.

@CRITERION

A criterion defines a logical expression that evaluates to true or false. The criteria are used in argument conditions and in command conditions. A criterion definition must be placed before it is referenced. The logical expression is composed of a value, an operator and a variable. The syntax of the criterion definition is:

@CRITERION(<#Criterion number>,<Value>,<Operator>,<Variable>,< From position:To position >)

Criterion number

The criterion number is the id of the criterion. This is used when referring to the criterion in argument conditions or command conditions. The criterion number must be unique within a statement. Criteria placed before the first statement name definition can be referenced by all statements. Other criteria can only be referenced within the statement where it is defined.
Element Description
Value This element contains the value that is compared with the value of the variable element.
Operator This element is the operator that is used when comparing the value element with the variable element. The available operators are: less than (<), less than or equal to (<=), greater than(>), greater than or equal to (>=), equal to (=) and not equal to (!=).
Variable The variable can be a symbolic M3 SWB field, an environment variable or ini file variable. When an environment variable is used the name of the environment variable is proceeded by "ENV:". When an ini variable is used the name is proceeded by "INI:".
From position:to position If an M3 SWB field of type character is used as the variable it is possible to address only a part of the field by specifying a from and a to position within the field. If this element is left blank the whole text field is used. The from and the to position is separated by a colon.

@CONDITION

A statement can also be composed by several commands by using the @CONDITION line. A @CONDITION line defines a command condition. A command condition defines a logical expression that has to be true if the command following the @CONDITION line is to be executed. The syntax of the @CONDITION line is:

@CONDITION(<logical expression>)

The logical expression is composed of criteria defined with the @CRITERION lines and the logical operators AND, OR and parentheses ( ). The criteria are referred to by the criterion number that is specified in the @CRITERION function.

A @CONDITION line that is written without using parentheses is called a default condition. If no previous condition is met, then the command that belongs to the default condition is executed. If these two conditions are met, then the command that belongs to the default condition is executed:
  • Several default conditions are included in the statement.
  • No condition between this default condition and the previous default condition is met.

If a default condition is placed as the first condition, then the corresponding command is always executed.

The first @CONDITION statement has to be placed just after the @CRITERION definitions. The following @CONDITION statements are placed as a separator between the commands that are to be separated with conditions. It is possible to link commands within a condition.