MRPCalculateScheduleDatesforMRP

MRP, Calculate Schedule Dates for Planning

Major Business Rule

Object Name: B3400540

Parent DLL: CMFG

Location: Client/Server

Language: C

1.Functional Description
This business function will Forward or Backward Schedule from the Input Date based on the Stocking 

Type 'M' for Mfg Item and 'P' for Purchased Item and Calculate the Output Date. If the Item is Purchased 

it will use the Calendar Days Otherwise it will Schedule based on Work days in the Calendar table 

(F0007).


1.1Purpose

This function is used to calculate based on the Stocking Type, Lead time and Input date, the Output 

date after Back/Forward Scheduling.


1.2Setup Notes and Prerequisites

The Lead Time must be calculated and rounded to nearest whole Number

The Special Handling Code for the Stocking Type from UDC table must be obtained and passed to the 

function.


1.3Special Logic

None


2.Technical Specifications

The following actions have to be performed by the Business Function.

1. Initialize Variables and Defaults.

Output Date = Input Date

If Schedule Type = ' ', Schedule Type = 'B'.

If Input LTLV = Null, Input LTLV = 0.

If Input STKT = Blanks, Input STKT = 'P'.

Wk Lead Time = Input LTLV


2. Calculate Output Date

If Input STKT = 'P'

If Input Schedule Type = 'B'

Output Date = Output Date - Wk Lead Time

Else

Output Date = Output Date + Wk Lead Time

Endif

If Input Schedule Type = 'B'

Call B3401270 with Action Code = '9' passing key Branch, Output Date, 'B'
Output Date = the date returned by B3401270

Else
Call B3401270 with Action Code = '9' passing key Branch, Output Date, 'A'
Output Date = the date returned by B3401270

Endif

Endif

If Input STKT = 'M'

Call B3100300 with Branch, Output Date, Schedule Type, Wk Lead Time and get Output Date

If Error in B3100300 Call

If Input Schedule Type = 'B'

Output Date = Output Date - Wk Lead Time

Else

Output Date = Output Date + Wk Lead Time

Endif

If Input Date Error Flag <> '1'

Write F3411 record with Output Date from B3100300, Inp ITM, MCU, 

MSGT('A'), Inp Date Error Msg Desc, HCLD('A'), DRQJ(Input Date), Input PID, Input UKID

F3411 Unique ID = F3411 Unique ID + 1

Input Date Error Flag = '1'

Endif

Endif

Endif


3. If any Errors, Exit program with Error code = '1' and Error Message = '3143' 



Data Structure

D3400540 - MRP, Calculate Schedule Dates for Planning

Parameter NameData ItemData TypeReq/OptI/O/Both
cStockingTypeSTKTcharNONENONE

A user defined code (41/I) that indicates how you stock an item, for example, as finished goods or as raw materials. The following stocking 
types are hard-coded and you should not change them:    0   Phantom item    B Bulk floor stock    C Configured item    E Emergency/corrective 
maintenance    F Feature    K Kit parent item    N Nonstock  The first character of Description 2 in the user defined code table indicates if the item 
is purchased (P) or manufactured (M).

jdInputDateDATE01JDEDATENONENONE

Event point for JDE Date.

cScheduleTypeEV01charNONENONE

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

mnLeadTimeInDaysLTLVMATH_NUMERICNONENONE

A value that represents the leadtime for an item at its assigned level in the production process, as defined on Plant Manufacturing Data. 
The system uses this value to calculate the start dates for work orders using fixed leadtimes. Level leadtime is different for purchased and 
manufactured items: Purchased - The number of calendar days required for the item to arrive at your branch/plant after the supplier receives your 
purchase order. Manufactured - The number of workdays required to complete the fabrication or assembly of an item after all the 
components are available. You can enter level leadtime manually on Manufacturing Values Entry, or you can use the Leadtime Rollup program to 
calculate it. To calculate level leadtime using the Leadtime Rollup program, you must first enter a quantity in the Manufacturing Leadtime Quantity 
field in the Item Branch table (F4102).

cSuppressErrorMessageEV01charNONENONE

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

jdOutputDateDATE02JDEDATENONENONE

Event point for JDE Date.

cErrorCodeERRCcharNONENONE

This error code indicates if any errors occurred during the creation of the Trip Document Detail (F4914) records by the Delivery Document 
Set Server program (XT4914).

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.

szBranchMCUcharNONENONE

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.

mnShortItemNumberITMMATH_NUMERICNONENONE

An inventory item number. The system provides three separate item numbers plus an extensive cross-reference capability to other item 
numbers (see data item XRT) to accommodate substitute item numbers, replacements, bar codes, customer numbers, supplier numbers, and 
so forth. The item numbers are as follows:   o Item Number (short) - An eight-digit, computer-assigned item number     o 2nd Item Number - The 
25-digit, free-form, user defined alphanumeric item number     o 3rd Item Number - Another 25-digit, free-form, user defined alphanumeric item 
number

szProgramIDPIDcharNONENONE

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.

mnF3411UniqueIDUKIDMATH_NUMERICNONENONE

This field is a unique number used to identify a record in a file.

szDateErrorMsgDescDSC1charNONENONE

Brief information about an item; a remark or an explanation.

cDateErrorFlagEV02charNONENONE

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

szJobNumberJOBcharNONENONE

Job Number

mnUniqueKeyIDOffsetMATH01MATH_NUMERICOPTNONE

- - - Good Performance Low Value. 

nNumberofDatesINT01integerOPTNONE

Number of Days in Future to Query for Responses Due. 

Related Functions

B3100300 Forward Backward Schedule Dates
B3401270 Cache, Process MRP Bucketless Dates
B9800100 Get Audit Information

Related Tables

F3411 MPS/MRP/DRP Message File