CheckBlanketOrderTypeUDC

Update Purchase Blanket Order

Minor Business Rule

Object Name: B4300360

Parent DLL: CDIST

Location: Client/Server

Language: C

Data Structure

D4300360 - Update Purchase Blanket Order

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

szBlanketOrderTypeDCTOcharNONENONE

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

szBlanketOrderCompanyKCOOcharNONENONE

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.

szBlanketOrderSuffixSFXOcharNONENONE

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.

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

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

Special Input Expected
0 - do not suppress 

1 - suppress  messagesab 


^

cProcessingModeMODEcharNONENONE

Special Input Expected
1 : Release  

2 : Close  

3 :  Cancelab 

^

mnPOQuantityInTransactionUOMUORGMATH_NUMERICNONENONE

The quantity of units affected by this transaction.

szPOTransactionUnitOfMeasureUOMcharNONENONE

A user defined code (00/UM) that indicates the quantity in which to express an inventory item, for example, CS (case) or BX (box).

mnPOQuantityInPrimaryUOMPQORMATH_NUMERICNONENONE

The quantity ordered by the customer expressed in the primary stocking unit of measure.

mnPOExtendedAmountDomesticAEXPMATH_NUMERICNONENONE

The number of units multiplied by the unit price.

mnPOExtendedAmountForeignFEAMATH_NUMERICNONENONE

The product of the foreign price times the number of units.

jdPORequestedDateDRQJJDEDATENONENONE

The date that an item is scheduled to arrive or that an action is scheduled for completion.

cCurrencyProcessingFlagCRYRcharNONENONE

A code that specifies whether to use multi-currency accounting, and the method of multi-currency accounting to use: Codes are:    N Do not 
use multi-currency accounting. Use if you enter transactions in only one currency for all companies. The multi-currency fields will not appear 
on forms. The system supplies a value of N if you do not enter a value.    Y Activate multi-currency accounting and use multipliers to convert 
currency. The system multiplies the foreign amount by the exchange rate to calculate the domestic amount.    Z Activate multi-currency 
accounting and use divisors to convert currency. The system divides the foreign amount by the exchange rate to calculate the domestic amount.

szUserIDUSERcharNONENONE

The code that identifies a user profile.

szComputerIDCTIDcharNONENONE

szCallingApplicationNamePGMcharNONENONE

The name of an executable program.

jdGLDateDGLJDEDATEOPTNONE

A date that identifies the financial period to which the transaction is to be posted.  The company constants specify the date range for each 
financial period. You can have as many as 14 periods. Generally, period 14 is used for audit adjustments. The system validates this field for 
PBCO (posted before cutoff), PYEB (prior year ending balance), PACO (post after cutoff), and WACO (post way after cutoff) messages.

mnJobnumber_JOBSJOBSMATH_NUMERICOPTNONE

The job number (work station ID) which executed the particular job.

mnTransactionID_TCIDTCIDMATH_NUMERICOPTNONE

mnProcessID_PEIDPEIDMATH_NUMERICOPTNONE

A code that identifies the Inter-Process Communication ID.

Related Functions

B0000032 RetrieveCurrencyConvFlag
B4000260 Line Type - Activity Rules
B4000520 Get Item UoM Conversion Factor
B4000750 Get Item Branch Grade Potency
B4300110 Get Purchase Order Detail
B9800100 Get Audit Information
X0005 Get User Defined Codes
X00COM Update Commitment Ledger
X43199 Insert Purchase Ledger
XF41021 Update F41021 Locations

Related Tables

F40203 Order Activity Rules
F4102 Item Branch File
F41021 Item Location File
F4311 Purchase Order Detail File
F43199 P.O. Detail Ledger File - Flexible Version
UpdatePurchaseBlanketOrder

UpdatePurchaseBlanketOrder

Update Purchase Blanket Order

Major Business Rule

Object Name: B4300360

Parent DLL: CDIST

Location: Client/Server

Language: C

Functional Description

Purpose

This business function will update a purchase blanket order for all generated Purchase Orders, 

Blanket Order updates and cancellations and Purchase Order cancellations.



The following tables are updated with blanket order information

• Purchase Order DetailF4311Update Blanket Order record.
• Purchase Order Detail LedgerF43199Write If Order Activity Rules Ledger flag is "Y".
• Item/LocationF41021Update Quantity on Other PO or Quantity on PO in primary units.
• Item/BranchF4102Update Vendor Number.
• GL BalancesF0902PA/PU ledger for Non-Stock items
• 

Step 1 : F4311 update.

The F4311 file (PO Detail file) is updated for the BLANKET ORDER.  The Purchase Order 

generated from a blanket order is NOT updated in this business function.


Each time a Blanket Order line is released, closed or canceled, its Purchase Order Detail 

record has to be updated for the specified Document Number, Document Type and Line Number.


In Release or Close mode, this Blanket Order update corresponds to the Quantities and/or 

Amounts retreived from the Purchase Order 'to be generated' created in work file F4311Z.


In Cancel mode, this Blanket Order update does not correspond to the Purchase Order 'to be 

generated' created in work file F4311Z.


Step 2 : F43199 insert.

If the ledger flag is "Y" in Order Activity Rules for the specified Order Type and Line Type, write a 

record.


Step 3 : F41021 update.

If the Blanket Order Line has a Line Type associated with an Inventory Interface = "Y", in Release, 

Close and Cancel mode, the Item/Location F41021 is updated  for Quantity on Other PO or Quantity on 

Purchase Order expressed in primary units, and User Specific Informations.


Step 4 : F4102  update.

If the Blanket Order Line has a Line Type associated with an Inventory Interface = "Y", in Release 

and  Close mode (not Cancel mode), the Item/Branch F4102 is updated  for Vendor Number and User Specific 

Informations.


Step 5 :  F0902 update

If the blanket order detail line is for non-stock items then this is relieved from the Purchase 

Commitment ledger (PA/PU) held in the GL Balances table (F0902).  


Technical Specification


2.4Processing 


GetUDC

szDataDictionaryItemN/A

szSystemCode<- 40szRecordTypeCode<- BTszUserDefinedCode<- 

BlanketOrderTypemnKeyFieldLength<- 2

szLanguagePreferenceN/AszDescription001N/AszDescription002

N/AszSpecialHandlingCodeN/AcUdcOwnershipFlagN/AcHardCodedYnN/AcSuppressErrorMessage<- 

'1'szErrorMessageId-> INT_ErrorMessageIDcUDCOne

/* If an error is returned the document type is not defined as a blanket order document type and the 

quantities should not be relieved.

If INT_ErrorMessageID is not equal to BLANK/NULL then

End Processing

GetPurchaseOrder

szOrderNumber<- BlanketOrderNumber

szOrderType<-BlanketOrderType

szOrderCOmpany<-BlanketOrderCompany

mnOrderLineNumber<-BlanketOrderLineNumber

idPointerToF4311DataStructure->DS4311

cReturnFlag<-'1'

cErrorCodeN/A

cCallType<-'1'

szErrorMessageID->

cSuppressErrorMessage<-'1'



If an error was returned by GetPurchaseOrder then

Set Error 0002
End Processing


If DS4311.PDNXTR is equal to '999' 

Set Error 3991
End Processing


/* Test to see whether the Blanket Order is still active or whether it is closed.

If DS4311.PDCNDJ (Cancel Date) is not equal to blank/zero

AND DS4311.PDCNDJ is less than PORequestDate

Set Error 3991
End Processing


/*  If no quantity (or lump sum amount) is left to relieve on the blanket order then do not select 

for update

If DS4311.PDUORG (Original Quantity) is NOT equal to zero

AND DS4311.PDUOPN is equal to zero

OR DS4311.PDUORG is equal to zero (lump sum blanket order)

AND DS4311.PDAOPN is equal to zero

Set Error 3991
End Processing


GetLineTypeConstants

szLineType<-DS4311.PDLNTY

szLineTypeDescN/A

szLineTypeDesc2N/A

cGLInterfaceN/A

cInventoryInterface-> INT_InventoryInterface

cReverseSignN/A

CTextLineN/A

szGLOffsetN/A

cIncludeTax1N/A

cErrorCode->INT_ErrorCode



If INT_ErrorCode is equal to '1' then    /*  Line Type has not been found.

Set error 3991
End Processing


/ * Retrieve the current time and date to update the blanket order with.

GetAuditInfo

szUserNameN/A

jdDate-> INT_SystemDate

mnTime-> INT_SystemTime

szWorkstation_UserIdN/A



PROCESS QUANTITY


/* If the PO being relieved is of the same unit of measure as the blanket order then the quantity 

does not need to be converted to primary unit of measure (saving IO).  Only process for blanket orders 

where the quantity is not equal to 0.  Do not process for lump sum.



If DS4311.PDUORG is NOT equal to 0


If ProcessingMode is equal to '1' or '2'    /* Quantity is being relieved from the blanket 

order


Assign POQuantityInTransationUoM to INT_POQuantity
Assign DS4311.PDUOPN to INT_BlanketQuantity.


If POTransactionUnitOfMeasure is equal to DS4311.PDUOM (Blanket Order Transaction UoM) 
then

Assign '0' to INT_ConversionToPrimaryPerformed

ELSE

If INT_InventoryInterface is equal to 'Y' or 'D' then

GetItemBranchGradePotency
mnItemNumberShort<- DS4311.PDITM /*Blanket Item

cPotencyControl-> INT_PotencyControl

cGradeControlN/A

mnStandardPotency-> INT_StandardPotency

mnFromPotencyN/A

mnThruPotencyN/A

szStandardGradeN/A

szFromGradeN/A

szThruGradeN/A

szBranch<- DS4311.PDMCU

cErrorCode

cSuppressErrorMessage

szErrorMessageID

idF4102Pointer

mnShelfLifeDays

cLotProcessingType


Assign '1' to INT_ConversionToPrimaryPerformed


GetItemUoMConversionFactor

szBranchPlant<- DS4311.PDMCU

szFromUnitOfMeasure<- DS4311.PDUOM

szToUnitOfMeasure<- DS4311.PDUOM1

mnQuantityToConvert<->INT_BlanketQuantity

cInventoryInterfaceFlag<- INT_InventoryInterface

mnConversionFactorFrom_to_To-> 

INT_ConversionTransToPrimary

mnConversionFactorFromToPrimN/A

mnConversionFactorToToPrimarN/A

mnQuantityConvertedToPrimaryN/A

cConvertToSecondary<- '0'

mnQuantityConvertedToSecondary N/A

cConvertToWeight<- '0'

mnQuantityConvertedToWeightN/A

cConvertToVolume<- '0'

mnQuantityConvertedToVolumeN/A

cPotencyMode<- 'S'

szLotNumber<- 

cPotencyControl<- INT_PotencyControl

mnStandardPotency<- INT_StandardPotency

szErrorMessageIDN/A

mnShortItemNumber<- DS4311.PDITM

cUOMByBranchN/A

szUOMToPrimary<- DS4311.PDUOM1

szUOMToSecondaryN/A

szUOMToPurchasingN/A

szUOMToWeightN/A

szUOMToVolumeN/A




/* If quantity ordered is greater than quantity available then clear out the quantity 

available.

If INT_POQuantity is greater than 0

If INT_POQuantity is greater than INT_BlanketQuantity
Assign INT_BlanketQuantity to INT_QuantityToRelieve
Assign 0 to INT_BlanketQuantity

ELSE
INT_BlanketQuantity = INT_BlanketQuantity - INT_POQuantity
Assign INT_POQuantity to INT_QuantityToRelieve


If INT_POQuantity is less than 0
INT_BlanketQuantity = INT_BlanketQuantity - INT_POQuantity (PO Qty added back : 
--=+)

Assign INT_POQuantity to INT_QuantityToRelieve



If INT_ConversionToPrimaryPerformed is equal to '1' then
INT_BlanketQuantity = INT_BlanketQuantity / INT_ConversionTransToPrimary
INT_POQuantity = PO_Quantity / INT_ConversionTransToPrimary

INT_QuantityToRelieve = INT_QuantityToRelieve / INT_ConversionTransToPrimary



DS4311.PDUOPN = INT_BlanketQuantity
DS4311.PDUREC = DS4311.PDUREC + INT_POQuantity



If ProcessingMode  is equal to '2' or '3' then   /* Blanket order is being closed

INT_QuantityToRelieve = INT_QuantityToRelieve - DS4311.PDUOPN
DS4311.PDUOPN = 0   /* force to zero


PROCESS AMOUNT -DOMESTIC


/* If amount available is greater than the amount ordered then clear the amount available.

If POExtendedAmountDomestic is greater than 0



If POExtendedAmountDomestic is greater than DS4311.PDAOPN

Assign DS4311.PDAOPN to INT_AmountToRelieve
Assign 0 to DS4311.PDAOPN

ELSE
DS4311.PDAOPN  = DS4311.PDAOPN - POExtendedAmountDomestic
Assign POExtendedAmountDomestic to INT_AmountToRelieve


If POExtendedAmountDomestic is less than 0

DS4311.PDAOPN  = DS4311.PDAOPN - POExtendedAmountDomestic
Assign POExtendedAmountDomestic to INT_AmountToRelieve


DS4311.PDAREC = DS4311.PDAREC - POExtendedAmountDomestic


If ProcessingMode  is equal to '2' or '3' then   /* Blanket order is being closed

INT_AmountToRelieve = INT_AmountToRelieve - DS4311.PDAOPN
DS4311.PDAOPN = 0   /* force to zero


PROCESS AMOUNT - FOREIGN


/* If this is a foreign currency blanket order then relieve the foreign amount as well.  It is 

assumed that PO amount in foreign is in the currency of the blanket order and not some other currency.



If CurrencyProcessingFlag is NOT equal to 'N'

AND DS4311.PDFEA is not equal to 0


/* If amount available is greater than the amount ordered then clear the amount available.

If POExtendedAmountForeign is greater than 0

If POExtendedAmountForeign is greater than DS4311.PDFAP
Assign 0 to DS4311.PDFAP
ELSE
DS4311.PDFAP  = DS4311.PDFAP - POExtendedAmountForeign

If POExtendedAmountForeign is less than 0
DS4311.PDFAP  = DS4311.PDFAP - POExtendedAmountForeign (--=+)


DS4311.PDFREC = DS4311.PDFREC - POExtendedAmountForeign


If ProcessingMode  is equal to '2' or '3' then   /* Blanket order is being closed

DS4311.PDFAP = 0   /* force to zero



PROCESS UPDATE

Update Purchase Ledger


/*  If the quantity or amount open has reached 0 (blanket is depleted) then get the next status from 

the order activity rules to update the blanket.  If not found then the next status is forced to 999 to 

close the line.



If DS4311.PDUORG is NOT equal to zero AND DS4311.PDUOPN is equal to 0

OR DS4311.PDUORG is equal to zero AND DS4311.PDAOPN is equal to 0 then


VerifyActivityRulesStatusCode
szOrderType<- BlanketOrderType

szLineType<- DS4311.PDLNTY  (Blanket Order Line Number) 

szLineStatusCode<- DS4311.PDNXTR  (Next Status Code)

szNextStatus-> INT_NextStatusCode

szStatusAllowed1N/A

szStatusAllowed2N/A

szStatusAllowed3N/A

szStatusAllowed4N/A

szStatusAllowed5N/A

cSuppressErrorMessage<- '1'

cErrorCode-> 

mnNextNumberN/A

cLedgerRecordYN-> INT_WriteLedgerRecord


If Error is equal to '1' then

Assign  '999' to INT_NextStatusCode
Assign 'N' to INT_WriteLedgerRecord


/*  Assign new next and last status codes to the Blanket Order Detail.
DS4311.PDLTTR = DS4311.PDNXTR

DS4311.PDNXTR = INT_NextStatusCode


If INT_WritePurchaseLedger = 'Y' then

InsertPurchaseLedger
szCallingApplication<- CallingApplicationName

szUserID<- UserID

szWorkstationID<- ComputerID

jdCurrentTime<- INT_CurrentTime

mnCurrentDate<- INT_CurrentDate

idPointerToF43199DS<- DS4311

Data Structure

D4300360 - Update Purchase Blanket Order

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

szBlanketOrderTypeDCTOcharNONENONE

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

szBlanketOrderCompanyKCOOcharNONENONE

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.

szBlanketOrderSuffixSFXOcharNONENONE

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.

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

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

Special Input Expected
0 - do not suppress 

1 - suppress  messagesab 


^

cProcessingModeMODEcharNONENONE

Special Input Expected
1 : Release  

2 : Close  

3 :  Cancelab 

^

mnPOQuantityInTransactionUOMUORGMATH_NUMERICNONENONE

The quantity of units affected by this transaction.

szPOTransactionUnitOfMeasureUOMcharNONENONE

A user defined code (00/UM) that indicates the quantity in which to express an inventory item, for example, CS (case) or BX (box).

mnPOQuantityInPrimaryUOMPQORMATH_NUMERICNONENONE

The quantity ordered by the customer expressed in the primary stocking unit of measure.

mnPOExtendedAmountDomesticAEXPMATH_NUMERICNONENONE

The number of units multiplied by the unit price.

mnPOExtendedAmountForeignFEAMATH_NUMERICNONENONE

The product of the foreign price times the number of units.

jdPORequestedDateDRQJJDEDATENONENONE

The date that an item is scheduled to arrive or that an action is scheduled for completion.

cCurrencyProcessingFlagCRYRcharNONENONE

A code that specifies whether to use multi-currency accounting, and the method of multi-currency accounting to use: Codes are:    N Do not 
use multi-currency accounting. Use if you enter transactions in only one currency for all companies. The multi-currency fields will not appear 
on forms. The system supplies a value of N if you do not enter a value.    Y Activate multi-currency accounting and use multipliers to convert 
currency. The system multiplies the foreign amount by the exchange rate to calculate the domestic amount.    Z Activate multi-currency 
accounting and use divisors to convert currency. The system divides the foreign amount by the exchange rate to calculate the domestic amount.

szUserIDUSERcharNONENONE

The code that identifies a user profile.

szComputerIDCTIDcharNONENONE

szCallingApplicationNamePGMcharNONENONE

The name of an executable program.

jdGLDateDGLJDEDATEOPTNONE

A date that identifies the financial period to which the transaction is to be posted.  The company constants specify the date range for each 
financial period. You can have as many as 14 periods. Generally, period 14 is used for audit adjustments. The system validates this field for 
PBCO (posted before cutoff), PYEB (prior year ending balance), PACO (post after cutoff), and WACO (post way after cutoff) messages.

mnJobnumber_JOBSJOBSMATH_NUMERICOPTNONE

The job number (work station ID) which executed the particular job.

mnTransactionID_TCIDTCIDMATH_NUMERICOPTNONE

mnProcessID_PEIDPEIDMATH_NUMERICOPTNONE

A code that identifies the Inter-Process Communication ID.

Related Functions

B0000032 RetrieveCurrencyConvFlag
B4000260 Line Type - Activity Rules
B4000520 Get Item UoM Conversion Factor
B4000750 Get Item Branch Grade Potency
B4300110 Get Purchase Order Detail
B9800100 Get Audit Information
X0005 Get User Defined Codes
X00COM Update Commitment Ledger
X43199 Insert Purchase Ledger
XF41021 Update F41021 Locations

Related Tables

F40203 Order Activity Rules
F4102 Item Branch File
F41021 Item Location File
F4311 Purchase Order Detail File
F43199 P.O. Detail Ledger File - Flexible Version