1.Functional Description
This function is to be used to determine the time series dates and quantities by date for the 
selected Item Number and Branch/Plant.  This business function will calculate the time series quantities, 
time series period dates, and pass those back in the form of a string.  The application using this 
function should provide the short item number, cost center, user defined code system code, user defined code 
record type, user defined code key, starting date, and units of measure for conversion.
1.1Purpose
The purpose of this business function is to calculate the time series amounts for a selected item and 
branch/plant.  The first call to this business function will pass a blank in the user defined code 
key.  This should signal to the business function that the dates for this system code and record type 
are being requested.  The second and all subsequent calls will pass a non-blank code to signal to the 
business function that the quantities should be returned.
If the input unit of measure parameters are not the same, the function will retrieve a conversion 
factor which will be applied to the retrieved quantities.  These quantities will also need to be 
converted to a string and placed in the parameter that matches the previously returned dates.  An error should 
be returned if no quantities exists for this user defined code key, item, and branch or if the 
function is unable to retrieve a conversion factor between the two units of measure.
When summarizing supply and demand records, the input Summary Flag parameter must be set to one.  The 
Initialize Quantity Fields parameter should be set to one to signal when the quantity acumulation 
array should be initialized to zero. The business function will continue to accumulate values until the 
initialization flag is reset to 0.
1.2Setup Notes and Prerequisites
The use of this business function is for both retrieval of dates and quantities.  All will be 
returned in string formats.
 By Item, Branch, and Start Date
 52 possible quantity/date parameters
 Application will only call business function as needed
 Application must call business function FreePointerToDataStructure to free the memory allocated for 
the date array and quantity summary array
1.3Special Logic
This business function will need to allow for math numeric and date fields to be passed back to the 
application in string format.
2.Technical Specifications
Qty Summary Array = Qty Summary Array Ptr from data structure
If Summary Flag = '1'
 If Qty Summary Array = NULL
  Allocate memory for Qty Summary Array which will hold 52 MATH NUMERIC values
  If memory allocation fails
   Set Error Message ID = '4346'.  If Suppress Error Messages <> '1', SetGBRError   
withcode '4346'
   Exit the function
  EndIf
 EndIf
 If Initialize Quantity Fields = '0'
  Initialize the Qty Summary Array to zeroes
 EndIf
EndIf
If Initialize Quantity Fields = 0
 Initialize all output quantity strings to ' '
 Suppress Quantity = '1'
EndIf
Date Array = Date Array Ptr from data structure
Open the Time Series table (F3413)
If the open fails
 Set Error Message ID = '3143'.  If Suppress Error Messages <> '1', SetGBRError with code '3143'
 Exit the function
EndIf
If KY = ' '
 If Date Array = NULL
  Allocate memory for Date Array which will hold 52 sorted JDEDATE values
  If memory allocation fails
   Set Error Message ID = '4346'.  If Suppress Error Messages <> '1', SetGBRError   
with code '4346'
   Exit the function
  EndIf
 EndIf
 Date Count = 0
 Wk Key = ' '
 Call GetAllUDCValues with Type = '1' to open the F0005 table and retrieve the first Key value 
for the input System Code and Report Type
 If successful 
  Wk Key = DRKY
 EndIf
 While Wk Key <> ' '
  While EOF F3413 not reached
   Read the next Time Series record using the partial key Short Item (ITM),   
Branch (MCU), and Quantity Type (QT)
   If record found and MRSTRT >= input Start Date and MRSTRT is not a member of   
Date Array
    If (Date Count = 52 and MRSTRT > Date Array[0] and MRSTRT < Date Array[51])    
or(Date Count < 52)
     Insert MRSTRT into the proper index position in Date Array to maintain a     
sorted array
     Date Count = min(52, Date Count + 1)
    Else
     If Date Count = 52 and MRSTRT > Date Array[51]
      Exit the inner While loop
     EndIf
    EndIf
   EndIf
  EndWhile
  Wk Key = ' '
  Call GetAllUDCValues with Type = '2' to retrieve the next Key value for the input  
System Code and Report Type
  If successful 
   Wk Key = DRKY
  EndIf
 EndWhile
 Call GetAllUDCValues with Type = '3' to close the F0005 table and release the request
 If Date Count = 0
  Set Error Message ID = '0001'. If Suppress Error Messages <> '1', SetGBRError  with 
code '0001'
 Else
  For each date stored in Date Array
  Copy the Date Array date into the next output Transaction Quantity parameter
  EndFor
 EndIf
EndIf
If KY <> ' ' and Date Array <> NULL
 Wk Conversion Factor = 1
 If Primary UOM <> Selected UOM
  Call B4000520 to get the conversion factor from Primary UOM to Selected UOM
  If the retrieval was successful
   Wk Conversion Factor = retrieved conversion factor
  Else
   Set Error Message ID = '0269' ('Unit of Measure Conversion Unsuccessful')
  EndIf
 EndIf
 While EOF not reached
  Read the next Time Series record using the partial key ITM, MCU, KY
  If a record was found
   If MRSTRT is a member of the array Date Array
    MRTRQT = MRTRQT * Wk Conversion Factor
    If Summary Flag = '1'
     Set Wk Quantity = the Summary Quantity in Qty Summary Array 
corresponding to MRSTRT
     MRTRQT = MRTRQT + Wk Quantity
     Save MRTRQT back into Qty Summary Array
    EndIf
    Convert MRTRQT to a string (Wk Quantity String)
    Set the output Transaction Quantity parameter corresponding to MRSTRT = 
Wk Quantity String
    Suppress Quantity = '0'
   Else
    If MRSTRT >= Start Date
     Exit the While loop
    EndIf
   EndIf
  EndIf
 EndWhile
EndIf
^
D3400330 - Determine Time Series
Data Item Data Structure DescriptionI/ORequiredNotes
ITM            Short Item                         IYes
MCU            Cost Center                        IYes
SY            System Code                        IYes
RT            Record Type                        IYes
KY            Key (Quantity Type)            INo
UOM1            Primary Unit of Measure            IYes
UOM            Selected Unit of Measure      IYes
STRT            Start Date                        INo
EV01            Suppress Error Messages            IYes      1 = Suppress run time error 
message                                                                                                 
                                                handling 0 = Allow run time error                     
                                                    message handling
DTAI            Error Message ID                  ONo
GENLNG      Pointer to Date Array            I/OYes
GENLNG      Pointer to Quantity Summary ArrayI/OYes
EV02            Suppress Quantity                  OYes      1 = All quantity values are 
blank 0 =                                                                         Non-blank quantity 
found
QT01E1      Quantity Time Series 01            ONo      String
QT02E1      Quantity Time Series 02         ONo      String
QT03E1      Quantity Time Series 03            ONo       String
QT04E1      Quantity Time Series 04            ONo      String
QT05E1      Quantity Time Series 05            ONo      String
QT06E1      Quantity Time Series 06            ONo      String
QT07E1      Quantity Time Series 07            ONo      String
QT08E1      Quantity Time Series 08            ONo      String
...
QT52E1      Quantity Time Series 52        ONo      String
EV03            Initialize Quantity Fields      IYes      1=Do not initialize quantity 
values                                                                         0=Initialize quantity 
values to zero
EV04            Summary Flag                  IYes      1=Summarize quantity values 
0=Do not                                                                                                
                                                                         summarize quantity values
^
| Parameter Name | Data Item | Data Type | Req/Opt | I/O/Both | 
|---|---|---|---|---|
| mnShortItemNumber | ITM | MATH_NUMERIC | NONE | NONE | 
An inventory item number. The system provides three separate item numbers plus an extensive cross-reference capability to other item 
  | ||||
| szCostCenter | MCU | char | NONE | NONE | 
An alphanumeric code that identifies a separate entity within a business for which you want to track costs. For example, a business unit 
  | ||||
| szSystemCode | SY | char | NONE | NONE | 
A user defined code (98/SY) that identifies a system. Valid values include:
01
Address Book
03B
Accounts Receivable
04
Accounts 
  | ||||
| szRecordType | RT | char | NONE | NONE | 
A code that identifies the table that contains user defined codes. The table is also referred to as a UDC type.  | ||||
| szKeyQuantityType | KY | char | NONE | NONE | 
A list of valid codes for a specific user defined code list.  | ||||
| jdStartDate | STRT | JDEDATE | NONE | NONE | 
The start date for the order. You can enter this date manually, or have the system calculate it using a backscheduling routine. The routine 
  | ||||
| cSuppressErrorMessages | EV01 | char | NONE | NONE | 
An option that specifies the type of processing for an event.  | ||||
| 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 
  | ||||
| cSuppressQuantity | EV02 | char | NONE | NONE | 
An option that specifies the type of processing for an event.  | ||||
| idDateArray | GENLNG | ID | NONE | NONE | 
General purpose ID variable.  | ||||
| szSelectedUnitOfMeasure | UOM | char | NONE | NONE | 
A user defined code (00/UM) that indicates the quantity in which to express an inventory item, for example, CS (case) or BX (box).  | ||||
| szPrimaryUnitOfMeasure | UOM1 | char | NONE | NONE | 
A user defined code (00/UM) that identifies the unit of measure that the system uses to express the quantity of an item, for example, EA 
  | ||||
| szQuantityTimeSeries01 | QT01E1 | char | NONE | NONE | 
Time Series Quantity column 01.  | ||||
| szQuantityTimeSeries02 | QT02E1 | char | NONE | NONE | 
Time Series Quantity column 02  | ||||
| szQuantityTimeSeries03 | QT03E1 | char | NONE | NONE | 
Time Series Quantity column 03  | ||||
| szQuantityTimeSeries04 | QT04E1 | char | NONE | NONE | 
Time Series Quantity column 04  | ||||
| szQuantityTimeSeries05 | QT05E1 | char | NONE | NONE | 
Time Series Quantity column 05  | ||||
| szQuantityTimeSeries06 | QT06E1 | char | NONE | NONE | 
Time Series Quantity column 06  | ||||
| szQuantityTimeSeries07 | QT07E1 | char | NONE | NONE | 
Time Series Quantity column 07  | ||||
| szQuantityTimeSeries08 | QT08E1 | char | NONE | NONE | 
Time Series Quantity column 08  | ||||
| szQuantityTimeSeries09 | QT09E1 | char | NONE | NONE | 
Time Series Quantity column 09  | ||||
| szQuantityTimeSeries10 | QT10E1 | char | NONE | NONE | 
Time Series Quantity column 10  | ||||
| szQuantityTimeSeries11 | QT11E1 | char | NONE | NONE | 
Time Series Quantity column 11  | ||||
| szQuantityTimeSeries12 | QT12E1 | char | NONE | NONE | 
Time Series Quantity column 12  | ||||
| szQuantityTimeSeries13 | QT13E1 | char | NONE | NONE | 
Time Series Quantity column 13  | ||||
| szQuantityTimeSeries14 | QT14E1 | char | NONE | NONE | 
Time Series Quantity column 14  | ||||
| szQuantityTimeSeries15 | QT15E1 | char | NONE | NONE | 
Time Series Quantity column 15  | ||||
| szQuantityTimeSeries16 | QT16E1 | char | NONE | NONE | 
Time Series Quantity column 16  | ||||
| szQuantityTimeSeries17 | QT17E1 | char | NONE | NONE | 
Time Series Quantity column 17  | ||||
| szQuantityTimeSeries18 | QT18E1 | char | NONE | NONE | 
Time Series Quantity column 18  | ||||
| szQuantityTimeSeries19 | QT19E1 | char | NONE | NONE | 
Time Series Quantity column 19  | ||||
| szQuantityTimeSeries20 | QT20E1 | char | NONE | NONE | 
Time Series Quantity column 20  | ||||
| szQuantityTimeSeries21 | QT21E1 | char | NONE | NONE | 
Time Series Quantity column 21  | ||||
| szQuantityTimeSeries22 | QT22E1 | char | NONE | NONE | 
Time Series Quantity column 22  | ||||
| szQuantityTimeSeries23 | QT23E1 | char | NONE | NONE | 
Time Series Quantity column 23  | ||||
| szQuantityTimeSeries24 | QT24E1 | char | NONE | NONE | 
Time Series Quantity column 24  | ||||
| szQuantityTimeSeries25 | QT25E1 | char | NONE | NONE | 
Time Series Quantity column 25  | ||||
| szQuantityTimeSeries26 | QT26E1 | char | NONE | NONE | 
Time Series Quantity column 26  | ||||
| szQuantityTimeSeries27 | QT27E1 | char | NONE | NONE | 
Time Series Quantity column 27  | ||||
| szQuantityTimeSeries28 | QT28E1 | char | NONE | NONE | 
Time Series Quantity column 28  | ||||
| szQuantityTimeSeries29 | QT29E1 | char | NONE | NONE | 
Time Series Quantity column 29  | ||||
| szQuantityTimeSeries30 | QT30E1 | char | NONE | NONE | 
Time Series Quantity column 30  | ||||
| szQuantityTimeSeries31 | QT31E1 | char | NONE | NONE | 
Time Series Quantity column 31  | ||||
| szQuantityTimeSeries32 | QT32E1 | char | NONE | NONE | 
Time Series Quantity column 32  | ||||
| szQuantityTimeSeries33 | QT33E1 | char | NONE | NONE | 
Time Series Quantity column 33  | ||||
| szQuantityTimeSeries34 | QT34E1 | char | NONE | NONE | 
Time Series Quantity column 34  | ||||
| szQuantityTimeSeries35 | QT35E1 | char | NONE | NONE | 
Time Series Quantity column 35  | ||||
| szQuantityTimeSeries36 | QT36E1 | char | NONE | NONE | 
Time Series Quantity column 36  | ||||
| szQuantityTimeSeries37 | QT37E1 | char | NONE | NONE | 
Time Series Quantity column 37  | ||||
| szQuantityTimeSeries38 | QT38E1 | char | NONE | NONE | 
Time Series Quantity column 38  | ||||
| szQuantityTimeSeries39 | QT39E1 | char | NONE | NONE | 
Time Series Quantity column 39  | ||||
| szQuantityTimeSeries40 | QT40E1 | char | NONE | NONE | 
Time Series Quantity column 40  | ||||
| szQuantityTimeSeries41 | QT41E1 | char | NONE | NONE | 
Time Series Quantity column 41  | ||||
| szQuantityTimeSeries42 | QT42E1 | char | NONE | NONE | 
Time Series Quantity column 42  | ||||
| szQuantityTimeSeries43 | QT43E1 | char | NONE | NONE | 
Time Series Quantity column 43  | ||||
| szQuantityTimeSeries44 | QT44E1 | char | NONE | NONE | 
Time Series Quantity column 44  | ||||
| szQuantityTimeSeries45 | QT45E1 | char | NONE | NONE | 
Time Series Quantity column 45  | ||||
| szQuantityTimeSeries46 | QT46E1 | char | NONE | NONE | 
Time Series Quantity column 46  | ||||
| szQuantityTimeSeries47 | QT47E1 | char | NONE | NONE | 
Time Series Quantity column 47  | ||||
| szQuantityTimeSeries48 | QT48E1 | char | NONE | NONE | 
Time Series Quantity column 48  | ||||
| szQuantityTimeSeries49 | QT49E1 | char | NONE | NONE | 
Time Series Quantity column 49  | ||||
| szQuantityTimeSeries50 | QT50E1 | char | NONE | NONE | 
Time Series Quantity column 50  | ||||
| szQuantityTimeSeries51 | QT51E1 | char | NONE | NONE | 
Time Series Quantity column 51  | ||||
| szQuantityTimeSeries52 | QT52E1 | char | NONE | NONE | 
Time Series Quantity column 52  | ||||
| cInitializeQuantityFields | EV03 | char | NONE | 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, 
  | ||||
| idQtySummaryArray | GENLNG | ID | NONE | NONE | 
General purpose ID variable.  | ||||
| cSummaryFlag | EV04 | char | NONE | NONE | 
PeopleSoft event point processing flag 04.  | ||||
| None | 
| None |