Functional Description
Purpose
Insert a row into the Sales Header Ledger Table (F42019)   A pointer to a data structure may be used 
to access the information to be inserted into the table.  If this pointer is not passed in then this 
function will retrieve the Sales Header record from the table to retrieve the information from.
Setup Notes and Prerequisites
 Prior to calling this function, you must verify that no records exist in the Sales Order detail 
table for the Order Number.
 Optionally retrieve a pointer to the Sales Header Record
Special Logic
None.
Technical Specification
2.2Related Tables 
Table Table Description
F4201Sales Order Header
F42109Sales Order Ledger
 
2.3Related Business Functions
Source NameFunction Name
 
2.4Processing 
1.If the pointer to the Sales Order Header (F4201) is not sent and the three keys (document 
number, type and company ) are also blank exit the program without further action.
2.If the pointer to the Sales Order Header (F4201) record is not sent, fetch the record from the 
Header table (F4201) with the key of Document Number(DOCO), Document Type(DCTO) and Key Company (KCOO)
If the record is not found or there is an error when fetching return error code '0002' in the ErrorId 
if Suppress Error Messages is not a '1'
3.Load all fields in the Sales Header Ledger (F42019) table  from the fields in the Sales Header 
(F4201) table
-Move the following information into the Sales Header Ledger (F4201) table columns just before update
 Calling Applicationinto PID 
   ProgramIdinto PID
 UserID into USER
 WorkstationIDinto JOBN
 CurrentDateinto UPMJ
 CurrentTimeinto TDAY
4.After all Sales Header Ledger (F4201) fields are loaded insert the record into the table.
^
D4200570 - WriteSalesHeaderLedger
Special Input Expected
GENLNGPointerToF4201DSIf a pointer to the F4201 is not passed in you must pass in the 
document number, type and company
PROGCalling ApplicationDeleted 2/24/97
USERUserID
JOBNWorkstationID
DATE01CurrentDate
TDAY  Current Time
DOCODocument Number
DCTODocuemnt Type
KCOOKey Company
EV01SuppressErrorMessage
PIDProgram Id
Special Output Returned
DTAIErrorID
^
| Parameter Name | Data Item | Data Type | Req/Opt | I/O/Both | 
|---|---|---|---|---|
| idPointertoF4201DS | GENLNG | ID | NONE | NONE | 
  | ||||
| szUserId | USER | char | NONE | NONE | 
The code that identifies a user profile.  | ||||
| szWorkstationId | JOBN | char | NONE | NONE | 
The code that identifies the work station ID that executed a particular job.  | ||||
| jdCurrentDate | DATE01 | JDEDATE | NONE | NONE | 
  | ||||
| mnTimeOfDay | TDAY | MATH_NUMERIC | NONE | NONE | 
The computer clock in hours:minutes:seconds.  | ||||
| mnDocumentNumber | DOCO | MATH_NUMERIC | NONE | NONE | 
A number that identifies an original document. This document can be a voucher, a sales order, an invoice, unapplied cash, a journal entry, 
  | ||||
| szOrderType | DCTO | char | NONE | NONE | 
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 
  | ||||
| szKeyCompany | KCOO | char | NONE | NONE | 
A number that, along with order number and order type, uniquely identifies an order document (such as a purchase order, a contract, a 
  | ||||
| szErrorMessage | DTAI | char | NONE | NONE | 
  | ||||
| cSuppressErrorMessage | EV01 | char | NONE | NONE | 
  | ||||
| cErrorCode | ERRC | char | NONE | NONE | 
This error code indicates if any errors occurred during the creation of the Trip Document Detail (F4914) records by the Delivery Document 
  | ||||
| szProgramId | PID | char | NONE | NONE | 
The number that identifies the batch or interactive program (batch or interactive object). For example, the number of the Sales Order Entry 
  | ||||
| szComputerID | CTID | char | OPT | NONE | 
| None | 
| F4201 Sales Order Header File | ||||
| F42019 Sales Order Header History File |