WriteSalesHeaderLedger

WriteSalesHeaderLedger

Major Business Rule

Object Name: B4200570

Parent DLL: CDIST

Location: Client/Server

Language: C


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.




^

Data Structure

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 NameData ItemData TypeReq/OptI/O/Both
idPointertoF4201DSGENLNGIDNONENONE


Special Input Expected

GENLNGab PointerToF4201DS


Significant Data Values

If a pointer to the F4201 is not passed in you must pass in the document number, type and  companyab 

^

szUserIdUSERcharNONENONE

The code that identifies a user profile.

szWorkstationIdJOBNcharNONENONE

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

jdCurrentDateDATE01JDEDATENONENONE


Special Input Expected

DATE01ab CurrentDate

^

mnTimeOfDayTDAYMATH_NUMERICNONENONE

The computer clock in hours:minutes:seconds.

mnDocumentNumberDOCOMATH_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.

szErrorMessageDTAIcharNONENONE


Special Output Returned

DTAIab  ab ErrorID

^

cSuppressErrorMessageEV01charNONENONE


Special Input Expected

EV01ab  ab SuppressErrorMessage

^

cErrorCodeERRCcharNONENONE

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).

szProgramIdPIDcharNONENONE

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.

szComputerIDCTIDcharOPTNONE

Related Functions

None

Related Tables

F4201 Sales Order Header File
F42019 Sales Order Header History File