1.Functional Description
1.1Purpose
This function allocates memory and initializes an array of bucket dates from the Capacity Date table
(F33133).
1.2Setup Notes and Prerequisites
The calling application must call business function B4000460, FreePtrToDataStructure, to free the
memory allocated by this function for the date array.
1.3Special Logic
2.Technical Specifications
// Fetch the date record from F33133 using the input Branch, determine the size of the date array and
allocate memory
Declare a variable TempDateArray to hold an array of 56 dates
BucketDateArrayPtr = 0
Fetch the F33133 record for Branch
If the fetch fails
ErrorMessageID = "071U"
Else
PastDuePeriods = 1
Else
PastDuePeriods = 2
End
For every date in DCDCRP
Convert the date string to a math numeric
Call B9800210 to convert the Julian numeric date to a JDEDATE
Store the JDEDATE into TempDateArray
End
NumberOfPeriods = 1
Do while TempDateArray[NumberOfPeriods] <> 0 and NumberOfPeriods <= 56
NumberOfPeriods = NumberOfPeriods + 1
End
NumberOfPeriods = NumberOfPeriods - 1
If NumberOfPeriods <= 0
Set ErrorMessageID = "071U"
Else
Allocate memory for the BucketDateArray to hold NumberOfPeriods dates
If the allocation fails
ErrorMessageID = "4374"
Else
Do X = 1 to NumberOfPeriods
BucketDateArray[X] = TempDateArray[X]
End
End
End
^
D3300200 - CRP, Initialize Bucket Dates
Data Item Data Structure DescriptionI/ORequiredNotes
MMCU Branch IY
INT01 Past Due Periods O
INT01 Number Of Periods O
GENLNG Bucket Date Array Ptr O
SUPPS Suppress Error Message I '1' = Suppress runtime error
message
handling
' ' = Allow runtime error
message handling
DTAI Error Message ID O " " = success
"3143" = table access error
"4374" = memory allocation
error
"071U" = CRP date error
^
Parameter Name | Data Item | Data Type | Req/Opt | I/O/Both |
---|---|---|---|---|
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
| ||||
iPastDuePeriods | INT01 | integer | NONE | NONE |
Number of Days in Future to Query for Responses Due. | ||||
iNumberOfPeriods | INT02 | integer | NONE | NONE |
Number of Days in the Past to Query for Quote Requests Received. | ||||
idBucketDateArrayPtr | GENLNG | ID | NONE | NONE |
General purpose ID variable. | ||||
cSuppressErrorMessage | SUPPS | char | NONE | NONE |
A flag indicating whether or not runtime error messaging will occur when an error message is issued from a business function.
0 = allow
| ||||
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
|
B9800210 Convert From and To Julian Date from JDEDATE |
F33133 Capacity Dates File |