ForwardBackwardScheduleDates

Forward Backward Schedule Dates

Minor Business Rule

Object Name: B3100300

Parent DLL: CMFGBASE

Location: Client/Server

Language: C

1.Functional Description

1.1Purpose

This business function will forward or backward schedule the input date using the Work Day Calendar 

Table F0007.


1.2Setup Notes and Prerequisites

• None.
'b7'b7'b7'b7

1.3Special Logic

None.


2.Technical Specifications


2.4Processing 


If the Schedule Type is blanks, set it to 'B'.


a. From the input date, get the Month ,Year and Day. Load the Month and Year into CZMT and CZYR 

respectively.

b. Try to read the Work Day Calendar table (F0007) using using CZMMCU (value as input Branch), CZYR 

and CZMTas the key. If not found, Load "*ALL" into CZMMCU and try to read the table.

c. If both attempts fail, set the Error code to '1' and exit.

d. If record is found , Load the day fields (CZTD01 to CZTD31) into an array.

e. If Backward Schedule,

   Do While No of Days > 0 

If  Day is >= 1 and <= 31 

Day = Day - 1.

If array element [Day] is =  "W"

No of  Days = No of Days  - 1.

Endif.

Else

Day = 31.

Month = Month - 1.

If Month is < 0

Month = 12.

Year = Year - 1.

Endif.

Read Work Day Calender as in step b/c.

Endif.

   Endif.


f. If Forward Schedule,

   Do While No of Days > 0 

If  Day is >= 1 and <= 31 

Day = Day + 1.

If array element [Day] is =  "W"

No of  Days = No of Days  - 1.

Endif.

Else

Day = 1.

Month = Month + 1.

If Month is > 12

Month = 1.

Year = Year + 1.

Endif.

Read Work Day Calender as in step b/c.

Endif.

   Endif.

 g. Convert Month, Year and Day to Output Date and return.  


If  the Work Day Calendar is not found in the Calendar table, the function will return '1' in the 

Error Code field otherwise it will return a '1'. The Output date will be the scheduled date.


Data Structure

D3100300 - Forward Backward schedule dates

Parameter NameData ItemData TypeReq/OptI/O/Both
szBranchPlantMMCUcharNONENONE

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 
represent lower-level business units, subordinate to it. For example:     o Branch/Plant (MMCU)     o Dept A (MCU)     o Dept B (MCU)     o Job 123 
(MCU) Business unit security is based on the higher-level business unit.

jdInputDateDRQJJDEDATENONENONE

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

jdOutputDateSTRTJDEDATENONENONE

The start date for the order. You can enter this date manually, or have the system calculate it using a backscheduling routine. The routine 
starts with the required date and offsets the total leadtime to calculate the appropriate start date.

mnNumberOfDaysLTLVMATH_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).

cScheduleTypeWScharNONENONE

A user defined code to designate intra-pay period work schedules. This code can be used for reporting and to select employees to be 
included in a payroll run. For example:    A Monday through Friday    B Saturday through Wednesday    C Monday through Thursday (4 x 10 hrs)

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

szWorkDayCalendarTypeWDCTcharOPTNONE

A user defined code (42/WD) that specifies how the calendar is used. For example, the calendar might be specific to an industry such as 
banking or it might be used to schedule delivery persons for a route.  Note: If you use the default value of *, the system updates the value to 
blank even though blank is not set up as a valid value in the UDC table.

szWorkDayCalendarKeyWDCKcharOPTNONE

A code used to classify values within a calendar type. For example, if the calendar type is ROUTE, you can enter a code that specifies a 
particular route, such as Daily or Weekend.  Note: The system does not validate the code that you enter. 

Related Functions

None

Related Tables

None