UpdatePONextStatus

Update PO Next Status

Major Business Rule

Object Name: B4300330

Parent DLL: CDIST

Location: Client/Server

Language: C

Functional Description

Purpose

The purpose of this function is to update the Purchase Order Detail with a new next status. The last 
status  gets updated with the existing next status and the existing next status gets updated with the 

New Next Status from the Bus. Fn data structure.  

The Order Activity Rules are checked for the new Las Status code to determine whether the Purchase 

Order Ledger needs to be updated. If yes, then a record is written to the PO Ledger.


Technical Specification


2.4Processing 



If LineNumber (LNID) is not blank/zero then


Select record from the F4311 table using the key DCTO, DOCO, KCOO, SFXO and LNID

If LineNumber (LNID) is blank then


Select records from the F4311 table using the key DCTO, DOCO, KCOO, SFXO.

 DO


Fetch the columns with the matching key as used in the record selection. Columns needed are  
PDLTTR,  PDNXTR and PDLNTY from the table F4311.


If next column does not exist then end business function processing.


Using the parameters DCTO, PDLNTY, PDNXTR retrieve the values from the Order Activity rules 

table using the business function VerifyActivityRulesStatusCode.  Suppress Error Message on the 

call of this business function. 

 If an error code is returned  (ERRC = 1) then 

Move ErrorMessageID 0425 to the data structure for this business function .
If the SuppressErrorMessages is NOT '1' then

Set ON the Error Message.

The business function VerifyActivityRulesStatusCode sends back five allowed next status code 

values.  Check that the NewNextStatus is equal to either the NextStatus which is returned from 

VerifyActivityRulesStatusCode or to one of the five allowed values.

 If not then set the error message 0243 (conditional on SuppressErrorMessage) and end business 

function processing.


If no errors found then

Move the existing Next Status (F4311/PDNXTR) to the last status of the PO (F4311/PDLTTR). 
 

Move the NewNextStatus to F4311/PDNXTR.

Call Business Function GetAuditInfo to get basic information to use in the Insert.

Move UserID to F4311/PDUSER.

Move current time to F4311/PDTDAY.

Move current date to F4311/PDUDMJ.

Move CallingApplication to F4311/PDPDPID.

Update the row in the PO detail file (F4311).

If WRTH from the business function VerifyActivityRulesStatusCode is equal to 'Y' then
Call Business Function GetPurchaseORderDetail  to retrieve a pointer in memory to the PO 
detail line.


Call Business Function InsertPurchaseLedger to add a record to the Purchase History 

ledger.

Clear the memory used by calling FreePtrToDataStructure.





Data Structure

D4300330 - Update PO Next Status

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

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.

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.

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.

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.

szNewNextStatusNXTRcharNONENONE

A user defined code (system 40/type AT) indicating the next step in the order flow of the line type.

cSuppressErrorMessagesEV01charNONENONE

Special Input Expected
1-Error Messages will not be  set.ab 


^

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.

szCallingApplicationPGMcharNONENONE

The name of an executable program.

Related Functions

B4000260 Line Type - Activity Rules
B4300110 Get Purchase Order Detail
B9800100 Get Audit Information
X43199 Insert Purchase Ledger

Related Tables

F4311 Purchase Order Detail File
F43199 P.O. Detail Ledger File - Flexible Version