CRPInitializeBucketDates

CRP, Initialize Bucket Dates

Major Business Rule

Object Name: B3300200

Parent DLL: CMFG

Location: Client/Server

Language: C

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

If DCDUEP = '0'
PastDuePeriods = 0
Else if DCDUEP = '1'
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

End


^

Data Structure

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 NameData ItemData TypeReq/OptI/O/Both
szBranchMMCUcharNONENONE

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.

iPastDuePeriodsINT01integerNONENONE

Number of Days in Future to Query for Responses Due. 

iNumberOfPeriodsINT02integerNONENONE

Number of Days in the Past to Query for Quote Requests Received. 

idBucketDateArrayPtrGENLNGIDNONENONE

General purpose ID variable.

cSuppressErrorMessageSUPPScharNONENONE

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.

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.

Related Functions

B9800210 Convert From and To Julian Date from JDEDATE

Related Tables

F33133 Capacity Dates File