1.Functional Description
This function is to be replaced with a Master Business Function based on the AS/400 X4201WO program.  
Temporarily, this function will perform an update of the F4801 record by either Requested Date or 
Required Quantity fields or it will create a new Work Order Header record in F4801.  
This function is divided into two segments.  Based on whether the program has been passed in an Order 
Number will determine which section will be called.  
 If an Order Number is passed in, the first segment will update either the WAUORG (Required 
Quantity) field or the WADRQJ (Requested Date) field in the F4801 using the WADOCO (Order Number), 
WAMCU (Branch), WADCTO (Order Type) fields as keys.  Note: If Requested Date is the desired update, 
be sure to set Required Quantity to blank.
 If no Order Number exists, the second segment will be called.  This part creates a WO header 
record in the F4801.  A new Document is retrieved using the system call X0010GetNextNumber.  Start Date 
is calculated by calling B3100290 Calculate Order Lead Time and using the lead time as input to call 
B3100300 ForwardSchedule Dates.  The function then returns Order Number and Start Date to the calling 
function.  
1.1Purpose
The purpose of this business function is to enable answering an order message from P3411 MPS/MRP 
Detail Message Revisions for a manufacturing (Work) order. This function will  create a Work Order header, 
passing the necessary fields.  The created Work Order document number and the Start Date will be 
returned to F3411.
Or this function will update the Requested Date or Required Quantity Fields.
1.2Setup Notes and Prerequisites
None
1.3Special Logic
This function will only populate the Work Order header with the required information for entry plus a 
status code.  It will NOT include passing any other parameters from Processing Options for either a 
version of P48013 or P3411.
2.Technical Specifications
 
1. If Order Number exists:
 A. Open Table F4801 using Update Structure
 1. If successful, set up Select structure using Branch and  Order Type Fields
 a. Fetch record from select structure using Order Number as key 
field.
 b. If fetch successful (Order Number exists in F4801): 
 1. Copy input from Data Structure (lpDS) to F4801 data 
structure
 szProgramID-WAPID
 mnOrderNumber -WADOCO
 jdStartDate-WASTRT
 2. Call GetAuditInfo
 a. Copy output from dsB9800100 to F4801 Input Data 
Structure
 szUserName-WAUSER
 szWorkstation_UserId-WAJOBN
 jdDate-WAUPMJ
 mnTime-WATDAY
 3. If mnRequiredQuantity is not equal to zero
 Copy  Required Quantity to F4801 Input Data Structure
 mnRequiredQuantity -WAUORG
 4. Else, copy Requested Date to F4801 Input Data Structure
 jdRequestedDate -WADRQJ
 5. Update Table F4801 using Input Data Structure
 c. else fetch not successful
 set return code error
 2. Else Open Table not successful
 set return code error
2. else Order Number does not exist - create new record
 A. Open Table F4801 using Update Structure
 1. If successful, 
 a.copy input from Data Structure (lpDS) to F4801 data structure
 mnShortItemNumber -WAITM
 szSupplyBranch - WAMMCU
 mnRequiredQuantity-WATRQT
 jdRequestedDate-WARRQJ
 szOrderType-WADCTO
 szWOStatusCode-WASRST
 szProgramID-WAPID
 b. Call GetAuditInfo: Copy output from dsB9800100 to F4801 
DataStructure
 szUserName-WAUSER
 szWorkstation_UserId-WAJOBN
 jdDate-WAUPMJ
 mnTime-WATDAY
 c. Set workfield docoexists to 1 (# exists)
     While docoexists == 1
 Call System Function X0010GetNextNumber: 
 1. if successful, 
 copy mnNextNumber001 to F4801 Fetch data structure
 fetch on ordernumber
 if fetch not successful 
 set docoexists == 0 to exit loop
 copy output dsX0010 to F4801 data structure
 mnNextNumber001 - WADOCO
 2. else system function X0010 failed
 set return code error
 set docoexists == 0 to exit loop
 d. Calculate Start Date
      Input data from lpDS to B3100290 data structure
 szUOMProduction-szUnitOfMeasure
 szSupplyBranch-szBranch
 mnRequiredQuantity-mnOrderQuantity
 mnShortItemNumber-mnShortItem
      Call B3100290 Calculate Order Lead Time 
      If successful
 Copy output to B3100300 Data Structure
 mnLeadTimeDays-mnNumberOfDays
 Input data from lpDS to B3100300 Data Structure
 jdRequestedDate-jdInputDate
 szSupplyBranch-szBranchPlant
 set cScheduleType = 'B'/* back scheduling */
 Call B3100300 Forward/BackwardScheduleDates
 copy output to F4801 Data Structure
 jdOutputDate-WASTRT
 Write record to F4801. (WAITM, WAMMCU, WAUORG, 
WADRQJ,WADCTO, WAUOM,  WASRST, WADOCO,WASTRT, WAUSER, WAJOBN, WAUPMJ, WATDAY, 
WAPID )
 Load Document # and Start Date into Program data 
structure
 WASTRT-jdStartDate
 WADOCO-mnOrderNumber
3. if return code  == ER_ERROR or API return value == JDEDB_FAILED
 a. set error message to 3143
 b. if cSuppressMessage does not = '1'
 Set GBR Error
 set return code = ER_ERROR
4. Program cleanup
5. Return 
D3400530 - Create WO Header
| Parameter Name | Data Item | Data Type | Req/Opt | I/O/Both | 
|---|---|---|---|---|
| mnShortItemNumber | ITM | MATH_NUMERIC | NONE | NONE | 
An inventory item number. The system provides three separate item numbers plus an extensive cross-reference capability to other item 
  | ||||
| szBranch | MMCU | char | NONE | NONE | 
A code that represents a high-level business unit. Use this code to refer to a branch or plant that might have departments or jobs, which 
  | ||||
| mnRequiredQuantity | TRQT | MATH_NUMERIC | NONE | NONE | 
A value that represents the available quantity, which might consist of the on-hand balance minus commitments, reservations, and 
  | ||||
| jdRequestedDate | RRQJ | JDEDATE | NONE | NONE | 
The completion date planned for this order.  | ||||
| szOrderType | DCTO | char | NONE | NONE | 
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 
  | ||||
| szUOMProduction | UOM8 | char | NONE | NONE | 
A user defined code (00/UM) that indicates the unit of measure in which you produce the item.  | ||||
| szWOStatusCode | SRST | char | NONE | NONE | 
A user defined code (00/SS) that describes the status of a work order, rate schedule, or engineering change order. Any status change from 
  | ||||
| mnOrderNumber | DOCO | MATH_NUMERIC | NONE | NONE | 
A number that identifies an original document. This document can be a voucher, a sales order, an invoice, unapplied cash, a journal entry, 
  | ||||
| jdStartDate | STRT | JDEDATE | NONE | NONE | 
The start date for the order. You can enter this date manually, or have the system calculate it using a backscheduling routine. The routine 
  | ||||
| szErrorMessageID | DTAI | char | NONE | NONE | 
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 
  | ||||
| cSuppressErrorMessage | EV01 | char | NONE | NONE | 
An option that specifies the type of processing for an event.  | ||||
| szProgramID | PID | char | NONE | NONE | 
The number that identifies the batch or interactive program (batch or interactive object). For example, the number of the Sales Order Entry 
  | ||||
| szDescription | DL01 | char | NONE | NONE | 
A user defined name or remark.  | ||||
| szBusinessUnit | MCU | char | NONE | NONE | 
An alphanumeric code that identifies a separate entity within a business for which you want to track costs. For example, a business unit 
  | ||||
| sz3rdItemNumber | AITM | char | NONE | NONE | 
The system provides three separate item numbers plus an extensive cross-reference capability to alternate item numbers. These item 
  | ||||
| sz2ndItemNumber | LITM | char | NONE | NONE | 
A number that identifies the item. The system provides three separate item numbers plus an extensive cross-reference capability to 
  | ||||
| mnManager | ANSA | MATH_NUMERIC | NONE | NONE | 
The address book number of a manager or planner.  
Note:  A processing option for some forms allows you to enter a default value for this 
  | ||||
| szTypeBill | TBM | char | NONE | NONE | 
A user defined code (40/TB) that designates the type of bill of material. You can define different types of bills of material for different uses. 
  | ||||
| szTypeRouting | TRT | char | NONE | NONE | 
A user defined code (40/TR) that indicates the type of routing. You can define different types of routing instructions for different uses.
For 
  | ||||
| cType | TYPS | char | NONE | NONE | 
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 
  | ||||
| None | 
| None |