UpdateOrderTotalInF4201

Update Order Total In F4201

Major Business Rule

Object Name: B4200250

Parent DLL: CDIST

Location: Client/Server

Language: C

Functional Description

Purpose

This business function is used to adjust the Order Gross Amount (OTOT) on the sales order header 
(F4201). It retrieves the sales order header record by DOCO, DCTO and KCOO.  It adds the current amount(s) 

 to the fetched  OTOT and subtracts the previous amount(s) from OTOT and updates the table F4201 with 

the calculated OTOT. The foreign amounts are used only if the foreign currency flag is turned on. If 

USER sent is blant or null, this business function calls the 'Get Audit Info' business function to 

retrieve the proper values for USER, JOBN, UPMJ and TDAY which are used to update the F4201 record. If 

USER is not balnk or null, then the passed values of JOBN, UPMJ and TDAY are used for the update of 

Database.


The input parameters for this function are DOCO, DCTO, KCOO, MATH06 (Current Extended Amount - 

Domestic), MATH07 (Current Extended Amount - Foreign), MATH08 (Previous Extended Amount - Domestic), MATH09 

(Previous Extended Amount - Foreign), CRYR (Currency conversion on = N if not on), PID, USER, JOBN, 

UPMJ and TDAY.

There are no ouput parameters for this function as it does the update of the table and doesn't pass 

anything back to the calling function.


Setup Notes and Prerequisites

• This function is called only if the extended amount changed (AEXP) and the order is not a future 
commit.

• Work fields are passed with previous and current extended amounts.

Special Logic

Foreign amounts should be updated only if Foreign Currency is turned on.



Technical Specification

2.2Related Tables 
Table Table Description
F4201Sales Order Header



2.3Related Business Functions

Source NameFunction Name



2.4Processing 

Retrieve the sales order header record by DOCO,DCTO,KCOO.
Subtract MATH08 (Previous domestic extended amount) from OTOT (Domestic Order Total)

Add  MATH06 (Current domestic extended amount) to OTOT (Domestic Order Total)

Subtract MATH09 (Previous foreign extended amount) to FAP (Foreign Order Total) if foreign currency 

is on.(CRYR not equal N).

Add MATH07 (Current foreign extended amount) to FAP (Foreign Order Total) if foreign currency is 

on.(CRYR not equal N).

Update sales order header


Added 7/11/95 - If USER sent is blank or null, call Get Audit Info to retrieve the proper values for 

User, Job, Date Updated, and Time of Day.  Use this information to update to the database record 

(F4201).  If the value in USER is not blank or null, then load the proper user, job, date updated, and time 

of day value into the record before updating it.




^

Data Structure

D4200250 - Update Order Total In F4201

Special Input Expected
DOCODocumentOrderInvoiceE

DCTOOrderType

KCOOCompanyKeyOrderNo

MATH06MathNumeric06Current Extended Amount  - Domestic

MATH07MathNumeric07Current Extended Amount - Foreign

MATH08MathNumeric08Previous Extended Amount - Domestic

MATH09MathNumeric09Previous Extended Amount - Foreign

CRYRCurrency On Y/N/Z Currency Conversion On = N if not on

PIDProgramRequired parameter.

USERUserOptional

JOBNJobOptional

UPMJDate UpdatedOptional

TDAYTime of DayOptional


^

Parameter NameData ItemData TypeReq/OptI/O/Both
mnDocOrderInvoiceEDOCOMATH_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.

szOrderTypeDCTOcharNONENONE

A user defined code (00/DT) that identifies the type of document. This code also indicates the origin of the transaction. J.D. Edwards has 
reserved document type codes for vouchers, invoices, receipts, and time sheets, which create automatic offset entries during the post 
program. (These entries are not self-balancing when you originally enter them.) The following document types are defined by J.D. Edwards and 
should not be changed: P Accounts Payable documents   R Accounts Receivable documents   T Payroll documents   I Inventory documents  
O Purchase Order Processing documents   J General Accounting/Joint Interest Billing documents   S Sales Order Processing documents

szKeyCompanyKCOOcharNONENONE

A number that, along with order number and order type, uniquely identifies an order document (such as a purchase order, a contract, a 
sales order, and so on). If you use the Next Numbers by Company/Fiscal Year facility, the Automatic Next Numbers program (X0010) uses the 
order company to retrieve the correct next number for that company. If two or more order documents have the same order number and order 
type, the order company lets you locate the desired document. If you use the regular Next Numbers facility, the order company is not used to 
assign a next number. In this case, you probably would not use the order company to locate the document.

mnDomesticCrntExtndedAmntMATH06MATH_NUMERICNONENONE

Special Input Expected
Current Extended Amount  - Domestic

^

mnForeignCrntExtndedAmntMATH07MATH_NUMERICNONENONE

Special Input Expected
Current Extended Amount - Foreign

^

mnDomesticPrevExtndedAmntMATH08MATH_NUMERICNONENONE

Special Input Expected
Previous Extended Amount - Domestic

^

mnForeignPrevExtndedAmntMATH09MATH_NUMERICNONENONE

Special Input Expected
Previous Extended Amount - Foreign

^

cCurrencyOnYNZCRYRcharNONENONE

A code that specifies whether to use multi-currency accounting, and the method of multi-currency accounting to use: Codes are:    N Do not 
use multi-currency accounting. Use if you enter transactions in only one currency for all companies. The multi-currency fields will not appear 
on forms. The system supplies a value of N if you do not enter a value.    Y Activate multi-currency accounting and use multipliers to convert 
currency. The system multiplies the foreign amount by the exchange rate to calculate the domestic amount.    Z Activate multi-currency 
accounting and use divisors to convert currency. The system divides the foreign amount by the exchange rate to calculate the domestic amount.

szProgramPIDcharNONENONE

The number that identifies the batch or interactive program (batch or interactive object). For example, the number of the Sales Order Entry 
interactive program is P4210, and the number of the Print Invoices batch process report is R42565. The program ID is a variable length value. 
It is assigned according to a structured syntax in the form TSSXXX, where: T The first character of the number is alphabetic and identifies the 
type, such as P for Program, R for Report, and so on. For example, the value P in the number P4210 indicates that the object is a 
program. SS The second and third characters of the number are numeric and identify the system code. For example, the value 42 in the number P4210 
indicates that this program belongs to system 42, which is the Sales Order Processing system. XXX The remaining characters of the numer are 
numeric and identify a unique program or report. For example, the value 10 in the number P4210 indicates that this is the Sales Order Entry 
program.

szUserUSERcharNONENONE

The code that identifies a user profile.

szJobJOBNcharNONENONE

The code that identifies the work station ID that executed a particular job.

jdDateUpdatedUPMJJDEDATENONENONE

The date that specifies the last update to the file record.

mnTimeOfDayTDAYMATH_NUMERICNONENONE

The computer clock in hours:minutes:seconds.

mnJobnumberAJOBSMATH_NUMERICOPTNONE

The job number (work station ID) which executed the particular job.

szComputerIDCTIDcharOPTNONE

Related Functions

B9800100 Get Audit Information

Related Tables

F4201 Sales Order Header File