WriteSalesHistoryOrLedger

Write Sales History Or Ledger

Major Business Rule

Object Name: B4200260

Parent DLL: CDIST

Location: Client/Server

Language: C

Functional Description

Purpose

This business function inserts a row into either the Sales History Table (F42119) or the Sales Ledger 
Table (F42199) based on the mode being passed - '1' insert the record to F42119 and '2' insert the 

record to F42199.


The input parameters for this function are

GENLNG   - Pointer To F4211 DS

PROG     - Calling Application

USER     -  User ID

JOBN     - Workstation ID

DATE     - Current Date

TIME     - Current Time

EV01     - Processing Mod


Setup Notes and Prerequisites

• Prior to calling this function, you must call GetF4211DetailInformation (B4200210.C) to retrieve the 
long pointer to F4211.


Special Logic

None.


Technical Specification


2.1Data Structure

Name Data Dictionary Item
idPtrToF4211DSGENLNG  
szUserID       USER

szWorkstationIDJOBN

cProcessingMode    EV01

jdCurrentDate      DATE01

mnCurrentTime      TDAY

szCallingApp  PID 

cF42119Written     EV02



2.2Related Tables 

Table Table Description
F4211Sales Order Detail

F42119Sales Order History

F42199Sales Order Ledger



2.3Related Business Functions

Source NameFunction Name


2.4Processing 

-If the pointer to the F4211 record is not sent, exit program without further action.
-Genlng is not equal to NULL.  If yes then exit.

-F42119/F42199 Table request successful.  If not, exit program without further action.

-Request for all columns of the table.


-Move the following information into the F42119/F42199 table columns just before update 

 Calling Applicationinto PID

 UserIDinto USER

 WorkstationIDinto JOBN

 CurrentDateinto UPMJ

 CurrentTimeinto TDAY


-Copy input structure into the F42119/F42199 data structure and insert the record.

-If inserting a F42119 record and the insert was successful return '1' in EV02 

   else   return a '0' in EV02




Data Structure

D4200260 - Write Sales History Or Ledger

Special Input Expected
GENLNGPointerToF4211DS

PROGCalling Application

USERUserID

JOBNWorkstationID

DATE01CurrentDate

TDAY  Current Time

EV01Processing ModeIf '1' - insert record to F42119. If '2', insert record to 

F42199. If blank, defaults to '2'.



Special Output Returned

EV02F42119WrittenY/N'1' = record successfully 

      written to F42119;

'0' = record not written 

to F42119


^

Parameter NameData ItemData TypeReq/OptI/O/Both
idPtrToF4211DSGENLNGIDNONENONE

General purpose ID variable.

szUserIDUSERcharNONENONE

The code that identifies a user profile.

szWorkstationIDJOBNcharNONENONE

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

cProcessingModeEV01charNONENONE

Special Input Expected
EV01ab Processing Mode


Significant Data Values

If '1' - insert record to F42119.

If '2', insert record to F42199.

If blank, defaults to  '2'.ab 



^

jdCurrentDateDATE01JDEDATENONENONE

Event point for JDE Date.

mnCurrentTimeTDAYMATH_NUMERICNONENONE

The computer clock in hours:minutes:seconds.

szCallingAppPIDcharNONENONE

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.

cF42119WrittenEV02charNONENONE

Special Output Returned
EV02ab F42119WrittenY/N


Significant Data Values

'1' = record successfully written to F42119

'0' = record not written to  F42119ab 


^

szComputerIDCTIDcharOPTNONE

idHRequestSHLGENLNGIDOPTNONE

General purpose ID variable.

Related Functions

None

Related Tables

F4211 Sales Order Detail File
F42119 Sales Order History File
F42199 S.O. Detail Ledger File