F0007GetCalendarType

F0007 Get Calendar Type

Major Business Rule

Object Name: N3101670

Parent DLL: CMFGBASE

Location: Client/Server

Language: NER

1.1Purpose
The purpose of this business function is to determine what type of shop floor calendar is being used 

and to return that type to the calling program.  The calendar type is then used to determine what key 

values to use when accessing the Shop Floor Calendar.  The following is a list of the valid calendar 

types: 


• '1' = Reserved for future use (B/P, Century, Year, Month, Calendar Name, Shift)
• '2' = Branch/Plant, Century, Year, Month, Shift
• '3' = Branch/Plant, Century, Year, Month
• '4' = Branch/Plant (ALL), Century, Year, Month
'b7'b7

1.2Setup Notes and Prerequisites

If a shift level calendar is setup for one shift then shift level calendars must be setup for all 

shifts.


1.3Special Logic

None


2.4Processing 


Initialize Calendar Type.
Set Calendar Type = blank

Set Shop Floor Calendar key values based on entry parameters


Check for Branch/Plant Level Calendar.

Get Shop Floor Calendar entry using Branch Plant, Century, Year, Month

If Shop Floor Calendar entry was retrieved

Set Calendar Type = '3'

If Shop Floor Calendar Shift <> blank

Set Calendar Type = '2'

Else (Shop Floor Calendar entry found & shift = blank)

Get next Shop Floor Calendar entry with same key

If Shop Floor Calendar entry was retrieved

AND key hasn't changed 

AND Shop Floor Calendar Shift <> blank

Set Calendar Type = '2'

Else (Shop Floor Calendar entry not retrieved)

Set Branch/Plant key = '         ALL'

Get Shop Floor Calendar entry

If Shop Floor Calendar entry was retrieved

Set Calendar Type = '4'


If Calendar Type = blank

Set error '1923' (Calendar Not Setup)


Data Structure

D3101670 - F0007 Get Calendar Type

Required Fields
szBranch/Plant

mnCentury

mnCalendarYear

mnCalendarMonth

cShiftCode

szCalendarName (Future Use - B8)

^

Parameter NameData ItemData TypeReq/OptI/O/Both
szBranchPlantMMCUcharOPTNONE

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.

mnCenturyCTRYMATH_NUMERICOPTNONE

0 = 20th Century
1 = 21st Century

^

mnCalendarYearYRMATH_NUMERICOPTNONE

The calendar year for this calendar.

mnCalendarMonthMTMATH_NUMERICOPTNONE

A number that corresponds to the month in a calendar year. 

cShiftCodeSHFTcharOPTNONE

A user defined code (00/SH) that identifies daily work shifts. In payroll systems, you can use a shift code to add a percentage or amount to 
the hourly rate on a timecard. For payroll and time entry: If an employee always works a shift for which a shift rate differential is applicable, 
enter that shift code on the employee's master record. When you enter the shift on the employee's master record, you do not need to enter the 
code on the timecard when you enter time. If an employee occasionally works a different shift, you enter the shift code on each applicable 
timecard to override the default value.

szCalendarNameWDCKcharOPTNONE

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. 

cCalendarTypeEV01charOPTNONE

Output Parameter
'1' = Use Shift and Line Calendar (Future Use - B8)

'2' = Use Shift Calendar

'3' = Use Branch/Plant Calendar

'4' = Use default calendar "         ALL" 

^

cSuppressErrorMessageSUPPScharOPTNONE

A flag indicating whether or not runtime error messaging will occur when an error message is issued from a business function.        0 = allow 
runtime error message handling.        1 = suppress runtime error message handling.

cErrorCodeERRCcharOPTNONE

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

szErrorMessageIDDTAIcharOPTNONE

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.

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.

Related Functions

None

Related Tables

None