Structure of decision table calls
Structure of decision table calls
Calling a different decision table is always initiated with the characters "p$" followed by the name of the DT and a pair of parentheses that contain potential arguments. Although most decision tables do not have any arguments, the parentheses must still be written (see also: Structure of function calls).
However, the full DT name does not always need to be specified, as group and compound are automatically replaced with the respective current values by the system. This means that if a DT from the same compound is called, only the plain DT name should be specified, so that the DT call does not need to be modified when the compound is renamed or copied. The "normal" Standard-DT-Call (as also used by the Input Assistant) has the format:
p$<DT>()
Example:
p$Price()
The full syntax is:
[Para =]p$[[<Group>:]<Compound>:]<DT>([<ParameterList>])
The brackets indicate the components which can be omitted from the call if they are not required by the DT.
Examples:
GPrice = Price + p$VAT(Price)
p$TDV:ETTEXT:ETTEXT()
Status = p$TDV:SMPAPI:L_Table( ’Addresses’ , ’TM_Address’ , ’Address_s’ , ’Num_Addresses’)
Another special case is the creation of loops, which are required for processing fields or lists, for example.
Tip:
A decision table can also be called "indirectly", for example when the DT name results from an item number or the compound name results from a parts group (see also the function f$DT).