CheckECOApprovalCodes

Check ECO Approval Codes

Major Business Rule

Object Name: B3000790

Parent DLL: CMFGBASE

Location: Client/Server

Language: C

1.Functional Description
This business function will check all records with the same Document Number (DOCO) in the Order 
Approval Audit Table (F4818) to determine if all approvals are complete.  If all approvals are complete, 

the group number of the last approval group will be returned.


1.1Purpose
Depending on the value returned in the Order Approval Complete field, this business function will 
either call another Business Function or terminate the sub-routine.


1.2Setup Notes and Prerequisites
There might be one or more records with the same Document Number (DOCO) in table F4818.  A pointer 
should be set at the first record for a Document Number and all records with the same Document Number 

should be read until one of the following conditions is met:

• either a record is found with Approval Code (APFL) not equal to 'A': set Grouping Number (GRPG) to 
'0000'

• or all records read have an Approval Code (APFL) equal to 'A': return the highest Grouping Number 
(GRPG) read

(Approval Code 'A' is hard-coded in the system)

2.Technical Specifications

2.4Processing 

Document Number, Group Number, Sequence Number is the primary key to Table F4818.
• Initialize the flag EV01
• Set the pointer at the first record with a Document Number (DOCO) matching the Document Number 
passed from the update program 

• If record found, set Record Found to '1' else set Record Found to '0'
• Read all records with the same Document Number until one of the following conditions is satisfied:
• either a record is read with an Approval Status not equal to 'A': set Order Approval Complete 
to '0' and Grouping Number to '0000'

• or all records are read and all have an Approval Status equal to 'A': set Order Approval 
Complete to '1' and return the highest value read for Grouping Number (GRPG
) field

^

Data Structure

D3000790 - Check ECO Approval Codes

Parameter NameData ItemData TypeReq/OptI/O/Both
mnECOOrderNumberDOCOMATH_NUMERICNONENONE

A number that identifies an original document. This document can be a voucher, a sales order, an invoice, unapplied cash, a journal entry, 
and so on.

cOrderApprovalCompleteEV01charNONENONE

An option that specifies the type of processing for an event.

mnGroupingNumberGRPGMATH_NUMERICNONENONE

A number used to combine similar records.

cRecordFoundEV01charNONENONE

An option that specifies the type of processing for an event.

Related Functions

None

Related Tables

F4818 Order Approval Audit