UpdateSOWithRelatedPOInfo

UpdateSOWithRelatedPOInfo

Major Business Rule

Object Name: B4200350

Parent DLL: CDIST

Location: Client/Server

Language: C

Functional Description

Purpose


This function is to retrieve a Sales Order Detail record and update the Related Order fields with the 

Purchase Order Number, Purchase Order Type, Key Company, and Line Number.  It will be called from 

F4311EndDoc to support direct ship and transfer order processing.


Setup Notes and Prerequisites

• This business function is designed to be called from F4311EndDoc.

• The Purchase Order fields are the acutal Purchase Order Number, Doc type, etc.

• After a Transfer or Direct Ship sales order is entered, F4311EditLine will be called to edit the 
purchase order information and a record will be written to the PO Detail work file if there is no error.  

If the PO work file header has not been created it will do so.


• When processing the F4311EndDoc will call UpdateSOWithPOInfo to update the related order fields in 
the F4211 with the Purchase Order info RORN,RCTO, and RKCO.


Special Logic


None.


Technical Specification


2.2Related Tables 

Table Table Description
F4211Sales Order Detail


2.3Related Business Functions

Source NameFunction Name
B9800100GetAuditInfo


2.4Processing 


1.Using the key fields (DOCO, DCTO, KCOO, and LNID) passed to the function update the purchase 

order information to the related order number fields in the sales detail record:


SDRORN  = RORN in parameter;

SDRCTO  = RCTO in parameter;

SDRKCO  = RKCO in parameter;

SDRLLN  = RLLN in parameter;

SDPID   = PID in parameter;

SDUSER  = USER in parameter;

SDJOBN  = JOBN in parameter;

SDUPMJ  = UPMJ in parameter;

SDTDAY  = TDAY in parameter;


2.If a Sales Order record is not found return an error message '0002'.

3.Use standard processing for Suppress Error (EV01) and Error ID (DTAI).


^

Data Structure

D4200350 - UpdateSOWithRelatedPOInfo

Special Input Expected
DOCOSO NumberKey field.  Load with RORN from the PO

DCTOSO TypeKey field.  Load with RCTO from the PO

KCOOSO CompanyKey field.  Load with RKCO from the PO

LNIDSO Line NumberKey field.  Load with RLLN from the PO

RORNPurchase Order NumberLoad with DOCO from the PO

RCTOPurchase Order Doc TypeLoad with  DCTO from the PO

RKCOPurchase Order Key Co.Load with KCOO from the PO

RLLNPurchase Order Line No.Load with LNID from the PO

PIDProgram ID

UPMJToday's DateOptional. If NULL, call GetAuditInfo.

TDAYTime of DayOptional. If NULL, call GetAuditInfo.

USERUser IDOptional. If NULL, call GetAuditInfo.

JOBNWorkStationIDOptional, If NULL, call GetAuditInfo.

EV01Suppress Error Message


Special Output Returned

DTAIError Message ID

ERRCErrorCode1 if Error, 0 if not


^

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

szSOTypeDCTOcharNONENONE

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

szSOCompanyKCOOcharNONENONE

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.

mnSOLineNumberLNIDMATH_NUMERICNONENONE

A number that identifies multiple occurrences, such as line numbers on a purchase order or other document. Generally, the system assigns 
this number,but in some cases you can override it.

szPurchaseOrderNumberRORNcharNONENONE

A number that identifies a secondary purchase order, sales order, or work order that is associated with the original order. This number is for 
informational purposes only.

szPurchaseOrderDocTypeRCTOcharNONENONE

A user defined code (system 00, type DT) that indicates the document type of the secondary or related order. For example, a purchase 
order might be document type OP and might have been created to fill a related work order with document type WO.

szPurchaseOrderKeyCoRKCOcharNONENONE

The key company that is associated with the document number of the related order.

mnPurchaseOrderLineNoRLLNMATH_NUMERICNONENONE

A number of the detail line on the related order for which the current order was created. For example, on a purchase order created to fill 
open sales orders, this is the line number of the sales order on which the item you are ordering appears.

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.

jdTodayDateUPMJJDEDATENONENONE

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

mnTimeofDayTDAYMATH_NUMERICNONENONE

The computer clock in hours:minutes:seconds.

szUserIdUSERcharNONENONE

The code that identifies a user profile.

szWorkstationIdJOBNcharNONENONE

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

cSuppressErrorMessageEV01charNONENONE

An option that specifies the type of processing for an event.

szErrorMessageIDDTAIcharNONENONE

A code that identifies and defines a unit of information. It is an alphanumeric code up to 8 characters long that does not allow blanks or 
special characters such as %, &, or +. You create new data items using system codes 55-59. You cannot change the alias.

cErrorCodeERRCcharNONENONE

Special Output Returned
ERRCab  ErrorCodeab  ab 


Significant Data Values

1 if Error, 0 if not


^

cSalesOrderInteropFlagEV01charOPTNONE

An option that specifies the type of processing for an event.

Related Functions

B9800100 Get Audit Information

Related Tables

F4211 Sales Order Detail File