F0911ValidateTolerance

F0911 Validate Tolerance

Minor Business Rule

Object Name: N1300660

Parent DLL: CMFG

Location: Client/Server

Language: NER

Functional Description
Purpose

This business function retrieves the GL Units of the last journal entry and compares it to the input 

tolerance percentage. If the tolerance is exceeded, the Error Message ID will contain an error id of 

"4005".


Setup Notes and Prerequisites


Special Logic




Technical Specification

0001 VA evt_mnTolerancePct_MATH01 = [BF mnTolerancePct_MATH01]/100

0002 BF cErrorCode_ERRC = "0"

0003 BF szErrorMessageID_DTAI = " "

0004 //

0005 //

0006 //

0007 F0012 Get AAI Account Number

        BF szAAI_ItemNumber_ASII -> szItemNumber

        BF szCompany_CO -> szCompany

        UNDEFINED X  szGlOffset

        VA evt_szAccountId_AID <- szAccountId

        UNDEFINED X  szBusinessUnit

        UNDEFINED X  szObject

        UNDEFINED X  szSubsidiary

        UNDEFINED X  szCompanyAccount

        UNDEFINED X  szAccountLong

        UNDEFINED X  cAccountmodegl

        UNDEFINED X  szCurrencyCode

        UNDEFINED X  cErrorControl

        UNDEFINED X  cRetWarningFlag

        UNDEFINED X  cValidateCRCD

        UNDEFINED X  szTaxExplanationCode

0008 //

0009 //

0010 //

0011 VA evt_szSerialTagNumber_ASID = lpad([BF mnAssetItemNumber_NUMB],0, 8)

0012 VA evt_szLedgerType_LT = "AA"

0013 VA evt_mnUnits_U = "0"

0014 VA evt_mnLargestDocNum_DOC = "0"

0015 VA evt_mnLargestJELine_JELN = "0"

0016 VA evt_mnTemp_MATH01 = "0"

0017 //

0018 //

0019 //

0020 F0911.Close

0021 F0911.Select

        VA evt_szAccountId_AID =  TK Account ID

        VA evt_szLedgerType_LT =  TK Ledger Type

        VA evt_szSerialTagNumber_ASID =  TK Serial Number

0022 F0911.Fetch Next

        VA evt_mnCurrentDocNum_DOC <- TK Document (Voucher, Invoice, etc.)

        VA evt_mnCurrentJELine_JELN <- TK Journal Entry Line Number

        VA evt_mnCurrentUnits_U <- TK Units

0023 If SV File_IO_Status is equal to CO SUCCESS

0024    If VA evt_mnCurrentDocNum_DOC is greater than VA evt_mnLargestDocNum_DOC

0025       VA evt_mnLargestDocNum_DOC = VA evt_mnCurrentDocNum_DOC

0026       VA evt_mnLargestJELine_JELN = VA evt_mnCurrentJELine_JELN

0027       VA evt_mnUnits_U = VA evt_mnCurrentUnits_U

0028    Else

0029       If VA evt_mnCurrentDocNum_DOC is equal to VA evt_mnLargestDocNum_DOC

0030          If VA evt_mnCurrentJELine_JELN is greater than VA evt_mnLargestJELine_JELN

0031             VA evt_mnLargestJELine_JELN = VA evt_mnCurrentJELine_JELN

0032             VA evt_mnUnits_U = VA evt_mnCurrentUnits_U

0033          End If

0034       End If

0035    End If

0036    //

0037    While SV File_IO_Status is equal to CO SUCCESS

0038       F0911.Fetch Next

              VA evt_mnCurrentDocNum_DOC <- TK Document (Voucher, Invoice, etc.)

              VA evt_mnCurrentJELine_JELN <- TK Journal Entry Line Number

              VA evt_mnCurrentUnits_U <- TK Units

0039       If SV File_IO_Status is equal to CO SUCCESS

0040          If VA evt_mnCurrentDocNum_DOC is greater than VA evt_mnLargestDocNum_DOC

0041             VA evt_mnLargestDocNum_DOC = VA evt_mnCurrentDocNum_DOC

0042             VA evt_mnLargestJELine_JELN = VA evt_mnCurrentJELine_JELN

0043             VA evt_mnUnits_U = VA evt_mnCurrentUnits_U

0044          Else

0045             If VA evt_mnCurrentDocNum_DOC is equal to VA evt_mnLargestDocNum_DOC

0046                If VA evt_mnCurrentJELine_JELN is greater than VA evt_mnLargestJELine_JELN

0047                   VA evt_mnLargestJELine_JELN = VA evt_mnCurrentJELine_JELN

0048                   VA evt_mnUnits_U = VA evt_mnCurrentUnits_U

0049                End If

0050             End If

0051          End If

0052       End If

0053    End While

0054    //

0055    If VA evt_mnUnits_U is not equal to 

0056       VA evt_mnUnits_U = 0-[VA evt_mnUnits_U]

0057       VA evt_mnTemp_MATH01 = [BF mnNetChange_MATH01]-[VA evt_mnUnits_U]

0058       VA evt_mnTemp_MATH01 = [VA evt_mnTemp_MATH01]/[VA evt_mnUnits_U]

0059       If VA evt_mnTemp_MATH01 is less than 

0060          VA evt_mnTemp_MATH01 = abs([VA evt_mnTemp_MATH01])

0061       End If

0062       If VA evt_mnTemp_MATH01 is greater than VA evt_mnTolerancePct_MATH01

           And VA evt_mnTolerancePct_MATH01 is not equal to 

0063          BF cErrorCode_ERRC = "2"

0064          BF szErrorMessageID_DTAI = "4005"

0065       End If

0066    End If

0067 End If



Data Structure

D1300660 - F0911 Validate Tolerance

Parameter NameData ItemData TypeReq/OptI/O/Both
mnTolerancePct_MATH01MATH01MATH_NUMERICOPTNONE

- - - Good Performance Low Value. 

szAAI_ItemNumber_ASIIASIIcharOPTNONE

An identification code that represents an asset. You enter the identification code in one of the following formats: 1 Asset number (a 
computer-assigned, 8-digit, numeric control number)   2 Unit number (a 12-character alphanumeric field)   3 Serial number (a 25-character alphanumeric 
field) Every asset has an asset number. You can use unit number and serial number to further identify assets. If this is a data entry field, the first 
character you enter indicates whether you are entering the primary (default) format that is defined for your system, or one of the other two 
formats. A special character (such as / or *) in the first position of this field indicates which asset number format you are using. You assign special 
characters to asset number formats on the fixed assets system constants form.

mnNetChange_MATH01MATH01MATH_NUMERICOPTNONE

- - - Good Performance Low Value. 

mnAssetItemNumber_NUMBNUMBMATH_NUMERICOPTNONE

An 8-digit number that uniquely identifies an asset.

szCompany_COCOcharOPTNONE

A code that identifies a specific organization, fund, or other reporting entity. The company code must already exist in the Company 
Constants table (F0010) and must identify a reporting entity that has a complete balance sheet. At this level, you can have intercompany 
transactions. Note: You can use company 00000 for default values such as dates and automatic accounting instructions. You cannot use company 00000 
for transaction entries.

szErrorMessageID_DTAIDTAIcharOPTNONE

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 
special characters such as %, &, or +. You create new data items using system codes 55-59. You cannot change the alias.

cErrorCode_ERRCERRCcharOPTNONE

This error code indicates if any errors occurred during the creation of the Trip Document Detail (F4914) records by the Delivery Document 
Set Server program (XT4914).

Related Functions

None

Related Tables

None