F4826UpdateBasedOnWOActivityRule

F4826 Update Based on WO Activity Rules

Major Business Rule

Object Name: X4826

Parent DLL: CMFG

Location: Client/Server

Language: C

Functional Description

Purpose

The purpose of F4826 Update Based on WO Activity Rules is to update work order information based on 

the Work Order Activity Rules.  This includes updating the work order status in the Status History file 

(F1307), updating the maintenance status for the PM associated with the work order, updating the 

status for the piece of equipment on the work order in the Status History file (F1307), and updating the 

Subledger inactive field.


Setup Notes and Prerequisites


Special Logic




Technical Specification


Read  F4801 by Work Order Number  (DOCO).

Read  F4826 for the WO Type (DCTO), Order Type (DOCO), and Status (SRST).

• Write the WO Status History using the Business Function (B1300030),
• Update the Equipment Status History using the Business Function (B1300020), if EQST is not equal to 
'**'.  Pass in the children flag to optionally Update Equipment Status for children.


• Read second record in the F1307 
• If status in the current F1307 record is less than Input status

• - Update the Subledger Inactive on the WO Header (F4801).

• - Update the Maintenance Status for the Preventive Maintenance associated with the WO status.
If status complete (98,99), then write a complete date.
Write a new PM schedule (status 01) if the cycle is finished and the schedule is NOT a multiple 

cycle.


Processing Details


FetchKeyed (Chain) to F4801 by Work Order Number, WADOCO = Input DOCO.


FetchKeyed (Chain) to F4826 by GEDCTO = Input DCTO, GETYPS = Input TYPS, and GESRST = Input SRST.


Write the WO Status History using the Business Function (B1300030).

Input DOCO'e0 DOCO
Input SRST'e0 SRST

Input EFTB'e0 EFTB

Input BEGT'e0 BEGT

'2''e0 TREC

'1''e0 Suppress Error Msg

Input ProgramID'e0 PID

'1''e0 Suppress Status Fetch

If Input EQST <> "**"

Update the Equipment Status History using the Business Function (B1300020).

WANUMB from F4801'e0 NUMB

Input EQST'e0 EQST

Input EFTB'e0 EFTB

Input BEGT'e0 BEGT

Input Children Flag'e0 Update Children

'1''e0 TREC

Input PID'e0 PID

'1''e0 Suppress Status Fetch

End If


// Update Subledger Inactive Code


If F4826 SBLI != F4801 SBLI then

Update F4801 for input DOCO:  WASBLI = F4826 SBLI

End If



// Update Maintenance Status


If F4826 MSTS != blank

Select F1207 records using FWWONA = Input DOCO

While Fetch successful

If FWMSTS != 99

Variable Date = blank

If F4826 MSTS = 98 or 99
If Input Date = blank

Variable Date = B9800100 Date

Else

Variable Date = Input Date

End if

End if

Update F1207: FWMSTS = F4826 MSTS

FWCPLD = Variable Date

FWCPLF = Calculate Completed Hours (FUTURE)

FWCPLH = Calculate Completed Fuel (FUTURE)

FWCPLM = Calculate Completed Miles (FUTURE)

FWUSER = B9800100 User

FWUPMJ = B9800100 Date

FWPID = EX4826

FWJOBN = B9800100 Workstation

FWUPMT = B9800100 Time


// Write new Maintenance Schedule


If F4826 MSTS = 98 or 99
Call B1300070 to retrieve Next Unique ID

Call N1300090 to calculate schedule date passing:F1207 TDT

F1207 FRIN

F1207 SRVD

F1207 LCPD

Write F1207: FWMSTS = 01

FWLCPD = F1207 CPLD

FWTDT = N1300090 PNST

FWUKID = B1300070 UKID

FWCPLD = blank

FWCPLF = blank

FWCPLH = blank

FWCPLM = blank

FWORGF = blank

FWORGM = blank

FWORGH = blank

FWANP = blank

FWWONA = 0

FWMPC = 0

FWPNST = 0

FWUSER = B9800100 User

FWUPMJ = B9800100 Date

FWPID = EX4826

FWJOBN = B9800100 Workstation

FWUPMT = B9800100 Time


End if

End if

End while

End if





Data Structure

DX4826 - F4826 Update Based on WO Activity Rules

Parameter NameData ItemData TypeReq/OptI/O/Both
mnWorkOrderNumberDOCOMATH_NUMERICNONEINPUT

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.

szWorkOrderTypeDCTOcharNONEINPUT

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

cTypeWOTYPScharNONEINPUT

A user defined code (00/TY) that indicates the classification of a work order or engineering change order. You can use work order type as a 
selection criterion for work order approvals.

szWorkOrderStatusSRSTcharNONEINPUT

A user defined code (00/SS) that describes the status of a work order, rate schedule, or engineering change order. Any status change from 
90 through 99  triggers the system to automatically update the completion date.

jdEffectiveDateEFTBJDEDATENONEINPUT

The date that an address, item, transaction, or table record becomes active.  The meaning of this field differs, depending on the program.  
For example, the effective date could represent the following:    o When a change of address becomes effective.   o When a lease becomes 
effective.   o When a price becomes effective.   o When the currency exchange rate becomes effective.   o When a tax rate becomes effective. 

mnBeginningTimeBEGTMATH_NUMERICNONEINPUT

The time at which the status of a piece of equipment or a work order changes. Use the HH:MM format (for example, 12:35).

szEquipmentStatusEQSTcharNONEINPUT

A user defined code (12/ES) that identifies the equipment or disposal status of an asset, such as available, down, or disposed.

cUpdateChildrenFlagEV01charNONEINPUT

1 = Update Children Status
^

cSubledgerInactiveSBLIcharNONEBOTH

An option that indicates whether a specific subledger is inactive. Examples of inactive subledgers are jobs that are closed, employees 
who have been terminated, or assets that have been disposed. Turn on this option to indicate that a subledger is inactive. If a subledger 
becomes active again, turn off this option. If you want to use subledger information in the tables for reports, but you want to prevent transactions 
from posting to the record in the Account Balances table (F0902), turn on this option. Valid values are: Off Subledger active On Subledger inactive

cErrorCodeEV02charNONEINPUT

0=No Error
1=Error Occurred

^

szProgramIDPIDcharNONEINPUT

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.

mnAssetItemNumberNUMBMATH_NUMERICOPTINPUT

An 8-digit number that uniquely identifies an asset.

szNameRemarkRMKcharOPTINPUT

A generic field that you use for a remark, description, name, or address.

jdDateCompletionSTRXJDEDATEOPTBOTH

The date that the work order or engineering change order is completed or canceled.

cCalledByPMAssociations_EV01EV01charOPTNONE

If this flag is set to a '1', when the work order status is being updated as a result of PM Associations. This will then 
bypass the creation of a new status 01 PM. This should only be set by PM Associations. 

Related Functions

B1300020 F1307 Update Asset Status
B1300030 F1307 Update Work Order Status
B3000450 Get MFG Constants Data
B4000260 Line Type - Activity Rules
B9800100 Get Audit Information
N3103110 F41021 Work Order Commitments

Related Tables

F3111 Work Order Parts List
F40205 Line Type Control Constants File
F4102 Item Branch File
F41021 Item Location File
F4801 Work Order Master File
F4826 W.O. Status Action Table