MAC-PAC Homecontact ussupport login 
Documentation > MAC-PAC Technical Library > Distribution > Electronic Data Interchange > Programs > EDI Sales Order Generation - Purpose

EDI Sales Order Generation - Purpose

ED140E

The EDI Sales Order Generation program (ED140E) receives sales order transactions (ANSI #850) previously translated by an external EDI translation package.  The key fields received through the EDI interface are:  Customer PO Number, Customer Number, Customer PO Type, Company/Warehouse, Direct Distribution Information, Line Number, Part Number, Quantity Ordered, Unit of Measure, Requested Ship Date, and Review/Expiration Date.  This program also receives any information for user-defined fields and passes them through the system without validation.

The program validates these transactions and:

·      If valid, adds the record to the Sales Order Header, Detail, and Comment files.  It then deletes the transactions from the appropriate transaction files (ED140AP1-4).

·      If invalid, writes an error message to the EDI Sales Order Error file (ED140AP5).  It sets the error status field to E and retains the transaction on the appropriate Sales Order Header, Detail, and Comment files.

This program can run in asynchronous mode as well as in batch mode. 

·      In asynchronous mode, the program starts processing as soon as it finds a record in the Sales Order Header Transaction file (ED140AP1).

·      If the program is called in batch mode, it reads through the Sales Order Creation Request file (OP310AP) and processes the requested records of the sales order transaction files.

The fields of the Order Header Transaction file are validated.  If the order is a multi-site order, the multi-site records on ED140AP6 are validated next.  ED143E is called to perform the validation.  Defaults are  then retrieved from the Customer Master file (ARCUSTL1) and all formatted fields are validated.  All header comments for this record are retrieved from the Sales Order Header Comment Transaction file (ED140AP3) and are validated.  All detail transactions for this header are retrieved from the Sales Order Detail Transaction file (ED140AP2) and are read sequentially.  The fields from the transaction file are validated.  If all fields are valid, defaults for all sales order detail fields are retrieved from the Part Master, Warehouse Balance, and Sales Order Header files.  A validation check is performed on key fields.

The sales order line ship type is defaulted to 'W' (warehouse ship).  If the Customer PO Type on the Sales Order Header Transaction file is equal to 'D' (direct ship), the sales order being created is a direct distribution sales order.  In this case, the direct distribution fields from the Sales Order Transaction file have to be formatted and the Direct Distribution Flag is set to 'Y' (yes).  For those orders, the line ship type will not be checked by the Sales Order Availability Checking program (AVLCHK).

The sales order planning flag (SLPLFG) on the order is set to no if the line will be sourced from a distribution warehouse.  If the line will be sourced from a distribution balance within a manufacturing warehouse, the flag is set based on the option defined for the manufacturing warehouse on the Plant/Warehouse Description file.  All detail comments for the detail lines are retrieved from the Sales Order Detail Transaction file (ED140AP4) and are validated.

If all detail fields are valid, pricing, costing, gross margin, tax, value-added tax (if relevant), and weight and volume calculations are performed.  For more information on these calculations, consult the Common Processing Routines section of this manual.  If this is the first valid detail line for the header, the next available sales order number is obtained from the Reference file.

An order is rejected if the header or one or more of the detail or comment lines or one of the multi-site records are in error.  However, if any of the header, detail, comment, or multi-site fields on the sales order being created are invalid, the validation for all other transaction fields and transaction records are still performed, except in the case of configured orders.  This is due to the commitment control processing with sales order header, line, and options files.  If an error is encountered in a configured order, all of the transactions are rolled back and only the first configured line in error will be written to the error file.  No other configured lines for that order will be processed through the configuration program (EC210E).  For every invalid field, an record is written to the EDI Sales Order Error file (ED140AP5) with an associated error message.

If header, detail lines, header comments, and detail comments are valid, the multi-site records on ED140AP6, if any, are converted into regular sales order records on the transaction files.  ED145E is called for this function.  Then the header record is written to the Sales Order Header file (OP100M1).  The header comments, detail lines, discount details, and detail comments are then written to the appropriate files (OP100M2, OP100M3 and OP100M6).

If there were multi-order records for the sales order just processed, the regular sales order transaction records created from the multi-site sales order are processed next.  They go through the same processing as any sales order transaction record.

The Automatic Sales Order Release program (OP630E) is called in order to check availability for the sales order lines that were created and to determine the ship type of each detail line (AVLCHK is called from OP630E).  Possible values are W (ship from warehouse) or D (ship direct) for non-direct distribution orders. 

A report (ED140A) is generated for all sales orders created by this program.  The report shows key fields from the sales order header, detail, and comment lines.  Error messages related to the programs OP630E and AVLCHK are printed for every detail line.  A summary is printed indicating the number of lines processed, the number of sales orders created, and the number of transactions rejected.

ED140E Program Menu