Functional Description
Purpose
This function will validate the date range by checking the start and requested dates. If the range
is valid, the correct Work Day calendar will be chosen and a cache will be created for every valid work
day within the range. Calling functions can then loop through the cache records retrieving the work
days.
Setup Notes and Prerequisites
Data Item Data Structure DescI/ORequiredNotes
JOBSJob NumberI/ONJob Number as string for cache name.
Job number from the calling function can be
sent in
to eliminate duplicate call, but it is not
necessary.
Returned value is used by the calling function
to
retrieve records from the Date Spread Cache.
EV01SuppressErrorMessagesIN1 - Error Messages Suppressed
ERRCError CodeON'0' = No Errors '1`'= Warnings '2' = Error
DTAIErrorMessageIDONDD ID number to error Code
EV02Data Dictionary EditsIN'1' - Data Dictionary Validation will be
performed.
Set to '1' only if calling the function through
third party software
SESDScheduled Start DateIYStart and Requested Dates define the range
DRQJRequested DateIY " " " " " " "
MWDHPeriod IYUsed to determine the spread
SHFTShiftIYUsed to retrieve the Work Calendar
MMCUBranch/PlantIYUsed to retrieve the Work Center Data
DOCODocument NumberIYCache Key value
INT01Number Of Cache RecordsONumber of Dates added to the cache
EV01Process EditsIY'0' = No Editing
'1' = Full Edits - writes records to cache
'2' = Partial Edits - validates the date range
only
Special Logic
This function creates a unique cache for each Parts List process. The function appends the input Job
Number string to the function name 'B3101640-' to build the cache name used for the calling
application.
Technical Specification
NOTE: Calendar Array is defined as a 2 X 31 array. The 2 columns are necessary when the period = Week and the spread is over 2 months. The
Work Day calendar must be fetched for both months.
Initialize the Cache
/******* Validate that the Start Date and Requested Date create a valid date range **********/
If the DD Validation Flag = '1'
Call DD Validation API for SESD and DRQJ
End If
If the Start Date < Requested Date
Set Error and Return
End If
If the input Period = '1' (Month)
If the Start Date Month does not = Requested Date Month
Set Error - Date Range not valid
End If
Else if the input Period = '2' (Week)
If the Requested Date - Start Date > 7 days
Set Error - Date Range not valid
Else
/* Work Week defined as Sunday to Monday */
Get Day of the Week Offset for the Start Date
Get Day of the Week Offset for the Requested Date
If the Start Date Offset > Requested Date Offset
Set Error
End If
End If
Else if the input Period = '3' (Day)
If the Start Date does not equal the Requested Date
Set Error
End If
Else if the input Period = ' '
Work Order - no edits
Else
Set Error on invalid Period
End If
If valid Date Range and Input Process Edits = Full Edits
Call N3101670 to determine which calendar to use
Open F0007 and retrieve record using the keys determined by N3101670
If successful
Load Calendar Date values into the Calendar Array
Calendar Array [0][0] = F0007 CZDT01
Calendar Array [0][1] = F0007 CZDT02
.
.
.
Calendar Array [30] = F0007 CZDT31
If Period = '2' Week and Start Date Month does not = Requested Date Month
Retrieve the Work Day calendar using the Requested Date
Load Calendar Date values into the Calendar Array
Calendar Array [1][0] = F0007 CZDT01
Calendar Array [1][1] = F0007 CZDT02
.
Calendar Array [30] = F0007 CZDT31
Set Work Two Calendars Field = '1'
Calendar Index = Start Date Day
Work Date = Start Date
If Work Two Calendars Field = '1'
/* Process the 1st Calendar */
While the Calendar Index <= 31
End If
Increment the Work Date by 1
/* Process the 2nd Calendar */
Calendar Index = 0
While the Calendar Index <= Requested Date Day
End If
End While
While the Calendar Index is less than or equal to Requested Date Day
Add Work Date to Cache
End If
Increment the Work Date by 1
Increment the Calendar Index by 1
End While
End If
End If
D3101640B - Cache, Spread Dates
Parameter Name | Data Item | Data Type | Req/Opt | I/O/Both |
---|---|---|---|---|
mnJobNumber | JOBS | MATH_NUMERIC | REQ | INPUT |
The job number must be retrieved prior to calling this function. Job Number is retrieved in Create
| ||||
cCacheActionCode | EV01 | char | OPT | NONE |
1 - Get Cache Record
| ||||
nNumberOfCacheKeys | INT01 | integer | OPT | NONE |
Number of Days in Future to Query for Responses Due. | ||||
cSuppressErrorMessage | SUPPS | char | OPT | NONE |
1 - Suppress Runtime Error Handling
| ||||
szErrorMessageID | DTAI | char | OPT | 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
| ||||
idCacheCursorPtr | GENLNG | ID | OPT | NONE |
Required Input/Output for sequential fetches
| ||||
cSequentialFetch | EV02 | char | OPT | NONE |
If action is Get and this is '1', function will pass back cursor pointer for Get Next operation.
| ||||
mnDocumentNumber | DOCO | MATH_NUMERIC | OPT | NONE |
Key Element to cache record
| ||||
jdWorkDate | DRQJ | JDEDATE | OPT | NONE |
Output
| ||||
cCacheErrorCode | EV03 | char | OPT | NONE |
A radio button that specifies the level at which trace/track result is to be displayed. Select the Detail to display all transactions except IB, IX,
|
None |
None |