ReleaseHeldOrder

Release Held Order

Major Business Rule

Object Name: B4300250

Parent DLL: CDIST

Location: Client/Server

Language: C

Functional Description

Purpose

This function will update the corresponding Order Header (F4301/F4201), Order Detail (F4311), PA/PU 

Commitment Ledger and Hold (4209) records when an order/ Line is released.

Parameters:    HCOD    Hold Code,  MCU  Business Unit,  DOCO  Order Number,

                           DCTO    Order Type, LNID  Line Number ,   SFXO   Order Suffix,

                           RDC  Release Code, EV01 Release Type, DTAI ErrorMessageID,

                           EV01 SupressErrorMessage


Technical Specification



Edits:


If Release Code is blank

Error Flag  = "Y"

Exit business function

End


If Release Type = 1 (Purchase Order line level - Budget)


Retrieve the Hold Order (F4209, key = HCOD, DOCO, DCTO, KCOO, SFXO, MCU) record for the 

order/line passed to the business function.

If no record found

Error Flag  = "Y"

Exit business function

End


Retrieve the PO Detail (F4311, key = DOCO, DCTO, KCOO, SFXO, LNID) record for the line passed 

to the business function

If no record found

Error Flag  = "Y"

Exit business function

End


Retrieve PO Header (F4301, key = DOCO, DCTO, KCOO, SFXO) record for the order passed to the 

business function

If no record found

Error Flag  = "Y"

Exit business function

End


Update the Hold (F4209) record:

HORDC= Release Code

HORDB= User ID

HORDT= System Time

HORDJ= System Date


If PDUCHG and PDACHG = 0

Exit business function.

End


If PDUCHG or PDACHG <> 0, 

If PDUORG or PDAEXP = 0

ACTION = "A" (for PA/PU Ledger Update)

Else

ACTION = "C"

End

End


PDUORG = PDUORG + PDUCHG

PDAEXP = PDAEXP + PDACHG

PDFEA = PDFEA + PDFCHG




Recalculate taxes:

OLDPDFTN1 = PDFTN1

Call X00TAX, return PDFTN1

(*** NOTE *** X00TAX is not yet available)


Determine net change,

UNET = PDUCHG

ANET = PDACHG

TNET = PDFTN1(new) - OLDPDFTN1


Update Order Detail Records (F4311)

PDUCHG = 0

PDACHG = 0

PDFCHG = 0

PDUSER = User Id

PDPID = "P43070"

PDJOBN = System Value

PDUPMJ = System Date

PDTDAY = System Time


If  PDDCTO is in UDC 40/CT

Update PA/PU Ledger using X00COM using:

UNET for QTY

ANET for AMT

TNET for TAX

ACTION

All other parameters are "PD" fields

End (*** NOTE *** X00COM is not yet available)


Update PO Header (F4301) record:

PHUSER = User Id

PHPID = "P43070"

PHJOBN = System Value

PHUPMJ = System Date

PHTDAY = System Time

Retrieve next Hold (F4209, key = HCOD, DOCO, DCTO, KCOO, SFXO, MCU, HORDC="  ") 

record for this line

If no record found

PHHOLD = "  "

Else

PHHOLD = HOHCOD

End

End



If Release Type = 2 (Purchase Order - header level)


Retrieve the Hold Order (F4209, key = HCOD, DOCO, DCTO, KCOO, SFXO, MCU) record for the 

order/line passed to the business function

If no record found

Error Flag  = "Y"

Exit business function

End


Retrieve the PO Header (F4301, key = DOCO, DCTO, KCOO, SFXO) record for the order passed to 

the business function.

If no record found

Error Flag  = "Y"

Exit business function

End


Update the Hold (F4209) record:

HORDC= Release Code

HORDB= User ID

HORDT= System Time

HORDJ= System Date


Update PO Header (F4301) record:

PHUSER = User Id

PHPID = "P43070"

PHJOBN = System Value

PHUPMJ = System Date

PHTDAY = System Time

Retrieve next Hold (F4209, key = HCOD, DOCO, DCTO, KCOO, SFXO, MCU,HORDC="  ") record 

for this order

If no record found

PHHOLD = "  "

Else

PHHOLD = HOHCOD

End

End



If Release Type = 3 (Sales Order - header level)


Retrieve the Hold Order (F4209, key = HCOD, DOCO, DCTO, KCOO, SFXO, MCU) record for the 

order/line passed to the business function

If no record found

Error Flag  = "Y"

Exit business function

End


Retrieve the SO Header (F4201, key = DOCO, DCTO, KCOO, SFXO) record for the order passed to 

the business function.

If no record found

Error Flag  = "Y"

Exit business function

End


Update the Hold (F4209) record:

HORDC= Release Code

HORDB= User ID

HORDT= System Time

HORDJ= System Date


Retrieve corresponding Work Order (F4801) record

If Work Order record exists

Update Work Order Header (F4801) record:

 WASRST = Work Order Release Code

End


Update SO Header (F4201) record:

SHUSER = User Id

SHPID = "P43070"

SHJOBN = System Value

SHUPMJ = System Date

SHTDAY = System Time

Retrieve next Hold (F4209, key = HCOD, DOCO, DCTO, KCOO, SFXO, MCU,HORDC="  ") record 

for this order

If no record found

SHHOLD = "  "

Else

SHHOLD = HOHCOD

End


Warehousing Interface ???

End





Returns:


Set Error Flag (ERR) to "N" if order released successfully.

Set Error Flag (ERR) to "Y" if error occurred during release.


Data Structure

D4300250 - Release Held Order

Parameter NameData ItemData TypeReq/OptI/O/Both
szHoldCodeHCODcharNONENONE

A user defined code (42/HC) that identifies why an order was placed on hold (for example, credit, budget, or margin standards were 
exceeded).

szBusinessUnitMCUcharNONENONE

An alphanumeric code that identifies a separate entity within a business for which you want to track costs. For example, a business unit 
might be a warehouse location, job, project, work center, branch, or plant. You can assign a business unit to a document, entity, or person for 
purposes of responsibility reporting. For example, the system provides reports of open accounts payable and accounts receivable by 
business unit to track equipment by responsible department. Business unit security might prevent you from viewing information about business units 
for which you have no authority.

mnOrderNumberDOCOMATH_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

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

szOrderSuffixSFXOcharNONENONE

In the A/R and A/P systems, a code that corresponds to the pay item. In the Sales Order and Procurement systems, this code identifies 
multiple transactions for an original order. For purchase orders, the code is always 000. For sales orders with multiple partial receipts against an 
order, the first receiver used to record receipt has a suffix of 000, the next has a suffix of 001, the next 002, and so on.

szReleaseCodeRDCcharNONENONE

The code entered through processing options at the time the held order was released.

cReleaseTypeEV01charNONENONE

Special Input Expected
1 - Purchase Order (line level - Budget)

2 - Purchase Order (header level)

3 - Sales Order (header level)



^

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.

cSuppressErrorMessageEV01charNONENONE

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

szOrderCompanyKCOOcharNONENONE

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.

cPublishXPIEventEV01charOPTNONE

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

mnDistributionLineNumberDLNIDMATH_NUMERICOPTNONE

Related Functions

B4000260 Line Type - Activity Rules
B9800100 Get Audit Information
X00COM Update Commitment Ledger
X00TAX Calculate and Edit Tax Amounts

Related Tables

F4201 Sales Order Header File
F4209 Held Orders
F4301 Purchase Order Header
F4311 Purchase Order Detail File
F4801 Work Order Master File