Functional Description
Purpose
This business function calculates the algebraic expression in an alphanumeric string and returns a
mathnumeric value, otherwise return error message ID.
Setup Notes and Prerequisites
The Input string format:
May or may not contain blank(s)
May interpret to a character string value or to numeric value.
All arithmetic function characters must be in upper case,
Is very important to consider that exist 4 different types of variables, these variables are always
defined with a special character in the first position of the variable. The special characters are into
the file F4009 and these can be changed, alphabetic, numeric, and mathematical function (for
example, A,1,(,+,-,*,/) values are not valid in this field. The second character of the variable must be in
the range A to Z or 0-9.
When you are using variables type Unit of Measure and Currency Code, always you must put a specific
mathematical operator, example:
Unit of Measure %EA = " / 1.1111", the Division sign must precede each variable of Unit of
Measure defined , if you enter this expression "+ %EA" , the result will be wrong because the
interpretation will be " + / 1.1111".
Currency Code !USD = " * 1.1111", the Multiplication sign must precede each variable of Currency
Code defined , if you enter this expression "+ !USD" , the result will be wrong because the
interpretation will be " + * 1.1111".
Special Logic
A.Operators:
The following operators are prioritized as:
2)'/'Division
3)'*'Multiplication
4)'-'Minus
5)'+'Addition
6)'('Left parentheses
Technical Specification
Related Tables
Table Table Description
F4075Price Variable Table
Related Business Functions
Source NameFunction Name
X0005GetUDC
B0000033GetExchRate
B1100001IsColInCurrencyCodeTable
B0000500AlgebraicExpressionCalculate
B400520GetItemUoMConversionFactor
B0000500AlgebraicExpressionCalculate
Processing
Retrieve CPCP02, CPCP03, CPCP04, and CPCP05 from F4009.
List A
CPCP02Symbol to identify Variable table
CPCP03Symbol to identify Unit of Measure
CPCP04Symbol to identify Currency
CPCP05Symbol to identify Database Fields
List B
CPCP02Symbol to identify Variable table
CPCP03Symbol to identify Unit of Measure
CPCP04Symbol to identify Currency
CPCP05Symbol to identify Database Fields
')'Right parentheses
'/'Division
'*'Multiplication
'-'Minus
'+'Addition
'('Left parentheses
' 'Blank character
Compare each character in the string one at a time against the four symbols retrieved from F4009
(List A).
If you encounter any character between A-Z and a-z or any special characters that is not proceeded by
one of the four symbols, then issue the error code.
There should not be any character or string other than function names that defined in section 1.2.
If there is any invalid character or string, skip all steps below and return Error Code.
Take the first character of the input string and validate
Detach the special character of the variable and take rest of the variable until find character blank
or mathematical function, defined section 1.3
If DS CP02 was found into the string
If the variable = blanks
If unsuccessful fetch
If DS UOM is not equal to F4075-UOM
DS MCU->MCU
F4075-UOM->UOM
DS UOM->UOM
"1"->QTY
DS IVI->IVI
DS ITM->ITM
DS TFLA->TFLA
Work Field<-CONV
F4075-UPRC= F4075-UPRC / Work Filed (Conversion Factor)
Use field CRCD from F4075 for calculate conversion factor if CRCDs are different
If F4075-CRCD is not equal to DS CRCD
F4075-CRCD->CRCD
DS CRCD->CRDC
DS AN8->AN8
DS DTEJ->EFT
Work field<-CRR
F4075-UPRC=F4075-UPRC * Work Field (Currency conversion factor )
Change the variable string for the field F4075-UPRC into the formula
else
If DS CP03 was found
"00"->SY
"UM"->RT
Variable name ->KY
"2"->AS
Keep the fields SDITM,SDMCU to be used in the business function B400520
Retrieve record from the file F4101 with the key SDITM and keep the field IMTFLA to be
used in the business function B400520
Retrieve record from the file F40205 with the key DS LNID and keep the field LFIVI to
be used in the business function B400520
Retrieve UOM conversion factor with the Business Function B400520
SDMCU->MCU
DS UOM->UOM
Variable Name->UOM
"1"->QTY
LFIVI->IVI
SDITM->ITM
IMTFLA->TFLA
Work Field<-CONV
change the variable string for the value of the work field returned
edit this field, the Division sign must precede the numeric value, example:
If the return value was 99.9999 you must put this character "/"before the field , and
the result is "/ 99.9999".
edit this filed, the Division sign must precede this value, example: " / 1"
If DS CP04 was found
EV01<-bhvrerrid
DS Variable->CRCD
If EV01 is not blank
DS CRCD->CRCD
Variable name->CRDC
DS AN8->AN8
DS DTEJ->EFT
Work field<-CRR
change the variable string for the value of the work field returned
edit this field, the Multiplication sign must precede the numeric value,
example:
If the return value was 99.9999 you must put this character "*"before the
field , and the result is "* 99.9999".
1"
If DS CP05 was found
change the variable string for the value of the name of variable, example:
F4211, field SDUPRC has value 999.9999
change SDUPRC for 999.9999 into the formula
If the
D4500130 - F4076 Calculate Algebraic Expression
Special Input Expected
Parameters for B4500130 business function:
Data Item Data Structure DescriptionI/ORequiredNotes
EV01 Mode Call I Y Call = '1', called
only for testing
process Call = '2',
called for return
result numeric
FML Calculation Formula I Y 160 upper-case-
character input
string.
DTEJ Pricing Date I Y Required only if Mode
= 2, use for Pricing
Date.
CRYR Currency Conversion I Y A code that specifies
whether to use multi-
currency accounting,
must be Y or Z when is
active
CRCD Currency Code I Y Use if multi-currency
is active, all amounts
will be converted to
this common currency
code.
UOM Unit of Measure I Y Use for convert all
amounts to this common
unit of measure.
KCOO Order Number Document Company I Y Sales Order Required
only if Mode = 2
GENLNG Pointer to Order Detail (F4211)I N Required only if Mode
= 2
TFLA Standard UOM Conversion I Y Required only if Mode
= 2, use in UOM
conversion item
specific UOM
conversion, from
F4101.
EV02 Suppress Error Messages I N 1 = Suppress,
0 = Not suppress
Special Output Returned
Parameters for B4500130 business function:
Data Item Data Structure DescriptionI/ORequiredNotes
MATH01Numeric Return Value O N Math Numeric Result
EV01 Error Code O 1 = Error found,
0 = Error not found
DTAI Error Message ID O N
^
Parameter Name | Data Item | Data Type | Req/Opt | I/O/Both |
---|---|---|---|---|
cCallingMode | MODE | char | NONE | NONE |
The processing mode used in Purchase Order Consolidator to signify when specific orders are being processed. | ||||
szCalculationFormula | FML | char | NONE | NONE |
An algebraic expression the system uses to calculate the adjustment to which the formula is attached.
When you define formulas, use
| ||||
mnNumericReturnValue | MATH01 | MATH_NUMERIC | NONE | NONE |
- - - Good Performance Low Value. | ||||
jdPricingDate | DTEJ | JDEDATE | NONE | NONE |
The Julian Date | ||||
szCurrencyCode | CRCD | char | NONE | NONE |
A code that identifies the currency of a transaction. | ||||
szUom | UOM | char | NONE | NONE |
A user defined code (00/UM) that indicates the quantity in which to express an inventory item, for example, CS (case) or BX (box). | ||||
idF4211Pointer | GENLNG | ID | NONE | NONE |
| ||||
szStandardUOMConv | TFLA | char | NONE | NONE |
| ||||
cErrorCode | EV01 | char | NONE | NONE |
| ||||
cSuppressErrorMsg | EV02 | char | NONE | NONE |
| ||||
szErrorMsgId | DTAI | char | NONE | NONE |
A code that identifies and defines a unit of information. It is an alphanumeric code up to 8 characters long that does not allow blanks or
| ||||
szUnitOfMeasureVariable | UOM4 | char | NONE | NONE |
A user defined code (00/UM) that indicates the unit of measure in which you usually price the item. |
B0000033 Get Exchange Rate | ||||
B0000500 Algebraic Expression Calculate | ||||
B1100001 Is Column In Currency Code Table | ||||
B4000260 Line Type - Activity Rules | ||||
B4000520 Get Item UoM Conversion Factor | ||||
B4500040 F4075GetPriceVariableTableRow | ||||
X0005 Get User Defined Codes |
F4075 Price Variable Table | ||||
F4211 Sales Order Detail File |