CreateTimeSeriesDetail

Create Time Series Detail

Major Business Rule

Object Name: B3401000

Parent DLL: CMFG

Location: Client/Server

Language: C

1.Functional Description

1.1Purpose
Reads F3413 records based on the ITM, MCU, QT, and STRT and writes these time series records to a 
user index file F34UI003. This BsFn is application specific to R3450 and P3413.


1.2Setup Notes and Prerequisites


1.3Special Logic


2.Technical Specifications

1. Constant:MaxQtyTypes = 50
2.   MaxDates = 57

3.  DemandLine = 48

4.  SupplyLine = 49

5. Arrays:QtyTypeArray[MaxQtyTypes]

6.  QtyTypeDescArray[MaxQtyTypes]

7.  DateInLongArray[MaxDates]

8.  DateInStringArray[MaxDates]

9.  QtyArray[MaxQtyTypes][MaxDates]

10.  DoNotSuppressLineArray[MaxQtyTypes]

11.Open table F0005, F3413 and F34UI003. If any table opens fail, exit business function with errors. 

If Input DisplayForecastConsumptionBuckets = '1' then Open F3405.

12.Call B9800420 for DD Item "QT" and retrieve the Wk System Code and Wk Reporting Code.

13.If Input Quantity Type is blank then 

14.Wk F0005 Reporting Code = Wk Reporting Code.

15.Else

16.  Wk F0005 Reporting Code = Input Quantity Type

17.End If

18.Select records from F0005 using Wk System Code and Wk F0005 Reporting Code

19.Initialize Wk ExitFlag = '0' and I = 0

20.While Wk ExitFlag <> '1'

21.  Read from F0005

22.  If read fails then Break from this While Loop.

23.  QtyTypeDescArray[I] = DRDL02 from F0005.

24.  QtyTypeArray[I] = DRKY from F0005.

25.  I = I + 1

26.End While

27.Wk NumberOfQtyTypes = I

28.Wk StartDate = Input StartDate

29.Select Records from F3413 with Input ShortItemNumber and Input BusinessUnit, sort sequence by 

MRSTRT.

30. While Wk ExitFlag <> '1'

31.  Read from F3413.

32.  If Read Fails then Break out of this While Loop.

33.  If MRSTRT = Null Date

34.  continue

35.  End If

36. 

37.  If Wk StartDate < MRSTRT then

38.  Wk StartDate = Null Date

39.  End If

40.  break

41. End While

42. If Wk StartDate > Null Date

43.  Select Records From F3413 with Input ShortItemNumber, Input BusinessUnit and 

MRSTRT >= Wk Start Date, order by MRSTRT.

44. Else

45.  Select Records From F3413 with Input ShortItemNumber, Input BusinessUnit,  order by 

MRSTRT.

46. End If

47. Initialize I = 0

48. Wk PreviousDate = Null Date

49. While Read from F3413 is Successful And I < InputNumberOfPeriods And I < MaxDates

50.  If MRQT <> "GD"

51.  If MRSTRT = Null Date And Wk PreviousDate = Null Date And I = 0

52.  DateInLongArray[I] = 0

53.  DateInStringArray[I] = "000000"

54.  I = I + 1

55.  Wk NumDates = Wk NumDates + 1

56.  End If

57.  If MRSTRT <> Wk PreviousDate

58.  DateInLongArray[I] = MRSTRT converted to Gregorian

59.  DateInStringArray[I] = " " + MRSTRT converted to mm/dd/yy format.

60.  I = I + 1

61.  Wk NumDates = Wk NumDates + 1

62.  Wk PreviousDate = MRSTRT

63.  End If

64.  End If

65. End While

66. If Input DisplayForecastConsumptionBuckets = '1'

67.  If Wk StartDate > Null Date

68.  Select Records from F3405 with MUPETY='FC' and MUENDD >= Wk StartDate and 

MUENDD <= DateInLong[Wk NumDates - ] in JDEDATE format.

69.  Else

70.  Select Records from F3405 with MUPETY='FC' and MUENDD <= DateInLong[Wk 

NumDates - ]in JDEDATE format.

71.  End If

72.  While Wk ExitFlag <> '1'

73.  Read from F3405

74.  If Read Fails then Break from While Loop

75.  Scan DateInLongArray for a date >= MUENDD and retrieve the index of the 

date into I.

76.  If Date is Found then

77.  If Exact Match

78.  First Character of DateInStringArray[I] = '*'

79.  Else

80.  If DateInLong[I] > MUENDD

81.  I = I - 1

82.  First Character of DateInStringArray[I] = '*'

83.  End If

84.  End If

85.  End If

86.  End While

87. End If

88. 

89. If Wk NumDates > 0

90.  Init Wk LeadtimeDateCounter, Wk MfgDateCounter, Wk CumDateCounter, Wk 

FreezeDateCounter, Wk MsgDateCounter to -1

91.  Look for Input LeadtimeLevelDate in DateInLongArray

92.  If Found

93.  Wk LeadtimeDateCounter = Index of Matching Date in DateInLongArray.

94.  End If

95.  Look for Input LeadtimeMfgDate in DateInLongArray

96.  If Found

97.  Wk MfgDateCounter = Index of Matching Date in DateInLongArray.

98.  End If

99.  Look for Input PlanningDate in DateInLongArray

100.  If Found

101.  Wk PlanDateCounter = Index of Matching Date in DateInLongArray.

102.  End If

103.  Look for Input LeadtimeCumDate in DateInLongArray

104.  If Found

105.  Wk CumDateCounter = Index of Matching Date in DateInLongArray.

106.  End If

107.  Look for Input FreezeDate in DateInLongArray

108.  If Found

109.  Wk FreezeDateCounter = Index of Matching Date in DateInLongArray.

110.  End If

111.  Look for Input MessageDate in DateInLongArray

112.  If Found

113.  Wk MsgDateCounter = Index of Matching Date in DateInLongArray.

114.  End If

115.  Pad spaces to every date string in the DateInStringArray

116.  If DateInStringArray[0] = " Past Due     " and Input PastDueBuckets = 2

117.  DateInStringArray[0] = " Past Period 1"

118.  DateInStringArray[1] = " Past Period 2"

119.  End If

120.  Index = 14

121.  If Input MessageDays > 0 And Wk MsgDateCounter <> -1

122.  DateInStringArray[Wk MsgDateCounter][Index] = 'D'

123.  End If

124.  If Input FreezeDays > 0 And Wk FreezeDateCounter <> -1 And Wk  FreezeDateCounter > 

Input PastDuePeriods -1 

125.  DateInStringArray[Wk FreezeDateCounter][Index] = 'F'

126.  If Index > 12

127.  Index = Index - 1

128.  Else

129.  Index = 14

130.  End If

131.  If Input LeadtimeCumDays > 0 And Wk CumDateCounter <> -1 And Wk CumDateCounter 

Input PastDuePeriods -1 

132.  DateInStringArray[Wk CumDateCounter][Index] = 'C'

133.  If Index > 12

134.  Index = Index - 1

135.  Else

136.  Index = 14

137.  End If

138.  End If

139.  If Input LeadtimeMfgDate > 0 And Wk Wk MfgDateCounter <> -1 And Wk Wk 

MfgDateCounter > Input PastDuePeriods -1 

140.  DateInStringArray[Wk MfgDateCounter][Index] = 'M'

141.  If Index > 12

142.  Index = Index - 1

143.  Else

144.  Index = 14

145.  End If

146.  End If

147.  If Input PlanningDate > 0 And Wk PlanningDateCounter <> -1 And Wk 

PlanningDateCounter > Input PastDuePeriods -1 

148.  DateInStringArray[Wk PlanningDateCounter][Index] = 'P'

149.  If Index > 12

150.  Index = Index - 1

151.  Else

152.  Index = 14

153.  End If

154.  End If

155.  If Input LeadtimeLevelDate > 0 And Wk LeadtimeDateCounter <> -1 And Wk 

LeadtimeDateCounter > Input PastDuePeriods -1 

156.  DateInStringArray[Wk LeadtimeDateCounter][Index] = 'L'

157.  If Index > 12

158.  Index = Index - 1

159.  Else

160.  Index = 14

161.  End If

162.  End If

163. End If

164. For I = 0 to Wk NumberOfQtyTypes - 1

165. 

166.  If Wk StartDate > Null Date

167.  Select from F3413 with Input ShortItemNumber, Input Business Unit, MRSTRT 

>= WkStartDate and MRQT = QtyTypeArray[I]

168.  Else

169.  Select from F3413 with Input ShortItemNumber, Input Business Unit  and MRQT 

= QtyTypeArray[I]

170.  End If

171.  While Wk ExitFlag <> '1'

172.  Read from F3413

173.  If Read Fails then Break from While Loop

174.  lDateInLong = MRSTRT (0 if MRSTRT is Null Date)

175.  While DateInLongArray[Index2 ] < lDateInLong

176.  Index2 = Index2 + 1

177.  End While

178.  If Input ConversionFactor <> 0 then

179.  MRTRQT = MRTRQT / Input ConversionFactor

180.  End If

181.  QtyArray[I][Index2] = QtyArray[I][Index2] + MRTRQT

182.  If QtyArray[I][Index2] <> 0

183.  DoNotSuppressLineArray[I] = '1'

184.  End If

185.  End While

186. End For

187. For I = 0  to Wk NumDates - 1

188.  For Y = 0 to Wk NumberOfQtyTypes - 1

189.  iQtyType = QtyTypeArray[Y] in integer format

190.  If iQtyType >= 15 and <= 40

191.  If iQtyType <> 15 And <> 25 And <> 35

192.  Wk Supply = Wk Supply + QtyArray[Y][I]

193.  End If

194.  End If

195.  If iQtyType >= 42 And <= 80

196.  If iQtyType <> 45 And <> 55 And <> 70

197.  Wk Demand = Wk Demand + QtyArray[Y][I]

198.  End If

199.  End If

200.  End For

201.  QtyArray[DemandLine][I] = Wk Demand

202.  QtyArray[SupplyLine][I] = Wk Supply

203.  Wk Demand = 0

204.  Wk Supply = 0

205. End For

206. Write Array Data to F34UI003

207. Insert to F34UI003 with 'D', LineID=1, and contents in DateInStringArray.

208. LineID = LineID+1

209. For I = 0 to Wk NumberOfQtyTypes - 2

210.  If QtyTypeArray[I] = " " then Continue

211.  If QtyTypeArray[I] > 42 And Wk DemandWrittenFlag <> '1'

212.  Insert into F34UI003 '1', 'Demand', 'DD' and contents of 

QtyArray[DemandLine]

213.  LineID =LineID + 1

214.  Wk DemandWrittenFlag = '1'

215.  End If

216.  Insert into F34UI003 with EV01= DoNotSuppressLineArray[I], QtyTypeDesc[I], 

QtyTypeArray[I].

217.  LineID = LineID + 1

218.  If QtyTypeArray[I] >= 40 And Wk SupplyWrittenFlag <> '1'

219.  Insert into F34UI003 '1', 'Supply', 'SS' and contents of 

QtyArray[DemandLine]

220.  LineID =LineID + 1

221.  Wk SupplyWrittenFlag = '1'

222.  End If

223. End For

224. Close tables.



^

Data Structure

D3401000 - Create Time Series Detail

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

cErrorCodeERRCcharNONENONE

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

cSuppressErrorMessageEV01charNONENONE

An option that specifies the type of processing for an event.

jdStartDateSTRTJDEDATENONENONE

The start date for the order. You can enter this date manually, or have the system calculate it using a backscheduling routine. The routine 
starts with the required date and offsets the total leadtime to calculate the appropriate start date.

mnNumberOfPastDueWksMATH01MATH_NUMERICNONENONE

- - - Good Performance Low Value. 

szQuantityTypeQTcharNONENONE

This code is used to distinguish different quantities generated in the MPS/MRP system.

cSummarizeFlagEV03charNONENONE

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, 
and IZ types.  Or, select Derivative Lots Only to display only those transactions that may have created new derivative lot. 

mnMessageDaysMTF3MATH_NUMERICNONENONE

The number of days after the generation start date within which the system should display order messages. For example, if the generation 
start date is 01/01/05, and the message time fence is 30 days, the system displays messages with dates less than or equal to 01/31/05. The 
system does not display messages with dates of 02/01/05 or later. However, the planning horizon for orders continues past this date and is 
reflected in available to promise totals. Note that:     o The system does not count the generation start date; that is, the day after the generation 
start date is day 1.     o For manufactured items, the system counts working days, as defined in the Shop Floor Calendar.     o For purchased 
items, the system counts calendar days.

mnFreezeDaysMTF2MATH_NUMERICNONENONE

The number of days from the generation start date within which the system does not generate action messages. For example, if the 
generation start date is 01/03/05, and the freeze time fence is 3 days, the planning system does not generate messages with required dates that are 
less than or equal to 01/06/05. Note: o The system does not count the generation start date; that is, the day after the generation start date is 
day 1. o For manufactured items, the system counts working days, as defined in the shop floor calendar. o For purchased items, the system 
counts calendar days.

mnCumulativeDaysLTCMMATH_NUMERICNONENONE

The total number of days required to build an item from its lowest level components to the final assembly. The system calculates the value 
differently for manufactured and purchased items. Manufactured - The total of all level leadtimes for all manufactured items,plus the highest 
cumulative leadtime of all its components. Purchased - The item's level leadtime. Purchased item leadtimes are included in the calculation of 
cumulative leadtimes. You can enter this value manually or you can have the system calculate it when you run the Leadtime Rollup program.

mnMfgDaysLTMFMATH_NUMERICNONENONE

The total number of days required to build an item from its lowest level components to the final assembly. This value is the total of the level 
leadtimes for all manufactured items, plus the highest manufacturing leadtime for all its components. If all components are purchased, the 
manufacturing leadtime equals the item's level leadtime. Purchased item leadtimes are not included in the calculation of manufacturing 
leadtimes. You can enter the manufacturing leadtime manually or you can have the system calculate it when you run the Leadtime Rollup program.

mnPlanningDaysMTF1MATH_NUMERICNONENONE

The number of days that the system uses in conjunction with the time fence rule to determine how the forecast is used. Enter the number of 
days after the start date when the time fence rule changes from the first rule to the second rule. For example, if the time fence rule is S (customer 
demand before the time fence, forecast after the time fence), the generation start date is 01/03/05,and the planning time fence is 3 days, the 
system plans using customer demand through 01/06/05. Beginning on 01/07/05, the system plans using the forecast. Note that:     o The 
system does not count the generation start date; that is, the day after the generation start date is day 1.     o For manufactured items, the system 
counts working days, as defined in the Shop Floor Calendar.     o For purchased items, the system counts calendar days.

mnLeadtimeDaysLTLVMATH_NUMERICNONENONE

A value that represents the leadtime for an item at its assigned level in the production process, as defined on Plant Manufacturing Data. 
The system uses this value to calculate the start dates for work orders using fixed leadtimes. Level leadtime is different for purchased and 
manufactured items: Purchased - The number of calendar days required for the item to arrive at your branch/plant after the supplier receives your 
purchase order. Manufactured - The number of workdays required to complete the fabrication or assembly of an item after all the 
components are available. You can enter level leadtime manually on Manufacturing Values Entry, or you can use the Leadtime Rollup program to 
calculate it. To calculate level leadtime using the Leadtime Rollup program, you must first enter a quantity in the Manufacturing Leadtime Quantity 
field in the Item Branch table (F4102).

mnReportConversionFactorCONVMATH_NUMERICNONENONE

The factor that the system uses to convert one unit of measure to another unit of measure.

mnJobNumberJOBSMATH_NUMERICNONENONE

The job number (work station ID) which executed the particular job.

szComputerIDCTIDcharNONENONE

szProgramIDPIDcharNONENONE

The number that identifies the batch or interactive program (batch or interactive object). For example, the number of the Sales Order Entry 
interactive program is P4210, and the number of the Print Invoices batch process report is R42565. The program ID is a variable length value. 
It is assigned according to a structured syntax in the form TSSXXX, where: T The first character of the number is alphabetic and identifies the 
type, such as P for Program, R for Report, and so on. For example, the value P in the number P4210 indicates that the object is a 
program. SS The second and third characters of the number are numeric and identify the system code. For example, the value 42 in the number P4210 
indicates that this program belongs to system 42, which is the Sales Order Processing system. XXX The remaining characters of the numer are 
numeric and identify a unique program or report. For example, the value 10 in the number P4210 indicates that this is the Sales Order Entry 
program.

mnShortItemNumberITMMATH_NUMERICNONENONE

An inventory item number. The system provides three separate item numbers plus an extensive cross-reference capability to other item 
numbers (see data item XRT) to accommodate substitute item numbers, replacements, bar codes, customer numbers, supplier numbers, and 
so forth. The item numbers are as follows:   o Item Number (short) - An eight-digit, computer-assigned item number     o 2nd Item Number - The 
25-digit, free-form, user defined alphanumeric item number     o 3rd Item Number - Another 25-digit, free-form, user defined alphanumeric item 
number

szBusinessUnitMCUcharNONENONE

An alphanumeric code that identifies a separate entity within a business for which you want to track costs. For example, a business unit 
might be a warehouse location, job, project, work center, branch, or plant. You can assign a business unit to a document, entity, or person for 
purposes of responsibility reporting. For example, the system provides reports of open accounts payable and accounts receivable by 
business unit to track equipment by responsible department. Business unit security might prevent you from viewing information about business units 
for which you have no authority.

jdLeadtimeDateDATE01JDEDATENONENONE

Event point for JDE Date.

jdPlanningDateDATE01JDEDATENONENONE

Event point for JDE Date.

jdMfgDateDATE01JDEDATENONENONE

Event point for JDE Date.

jdCumulativeDateDATE01JDEDATENONENONE

Event point for JDE Date.

jdFreezeDateDATE01JDEDATENONENONE

Event point for JDE Date.

jdMessageDateDATE01JDEDATENONENONE

Event point for JDE Date.

mnNumberOfPeriodsMATH01MATH_NUMERICNONENONE

- - - Good Performance Low Value. 

mnSectionsNeededMATH02MATH_NUMERICNONENONE

- - - Good Performance High Value. 

cDisplayFcstConsumptionBucketsEV01charNONENONE

An option that specifies the type of processing for an event.

cUseDescription1EV01charNONENONE

An option that specifies the type of processing for an event.

Related Functions

B3100710 Get Job Number
B9800100 Get Audit Information
B9800181 Environment List Business Functions
B9800420 Get Data Dictionary Definition

Related Tables

F0005 User Defined Codes
F3405 Forecast Consumption Periods
F3413 MPS/MRP/DRP Summary File
F34UI003 MPS Time Series User Index
DeleteTimeSeriesDetail

DeleteTimeSeriesDetail

Create Time Series Detail

Major Business Rule

Object Name: B3401000

Parent DLL: CMFG

Location: Client/Server

Language: C

1.Functional Description

1.1Purpose
Reads F3413 records based on the ITM, MCU, QT, and STRT and writes these time series records to a 
user index file F34UI003. This BsFn is application specific to R3450 and P3413.


1.2Setup Notes and Prerequisites


1.3Special Logic



2.Technical Specifications

1. Constant:MaxQtyTypes = 50
2.   MaxDates = 57

3.  DemandLine = 48

4.  SupplyLine = 49

5. Arrays: QtyTypeArray[MaxQtyTypes]

6.  QtyTypeDescArray[MaxQtyTypes]

7.  DateInLongArray[MaxDates]

8.  DateInStringArray[MaxDates]

9.  QtyArray[MaxQtyTypes][MaxDates]

10.  DoNotSuppressLineArray[MaxQtyTypes]

11.Open table F0005, F3413 and F34UI003. If any table opens fail, exit business function with errors. 

If Input DisplayForecastConsumptionBuckets = '1' then Open F3405.

12.Call B9800420 for DD Item "QT" and retrieve the Wk System Code and Wk Reporting Code.

13. If Input Quantity Type is blank then 

14.  Wk F0005 Reporting Code = Wk Reporting Code.

15. Else

16.  Wk F0005 Reporting Code = Input Quantity Type

17. End If

18. Select records from F0005 using Wk System Code and Wk F0005 Reporting Code

19. Initialize Wk ExitFlag = '0' and I = 0

20. While Wk ExitFlag <> '1'

21.  Read from F0005

22.  If read fails then Break from this While Loop.

23.  QtyTypeDescArray[I] = DRDL02 from F0005.

24.  QtyTypeArray[I] = DRKY from F0005.

25.  I = I + 1

26. End While

27. Wk NumberOfQtyTypes = I

28. Wk StartDate = Input StartDate

29. Select Records from F3413 with Input ShortItemNumber and Input BusinessUnit, sort sequence by 

MRSTRT.

30. While Wk ExitFlag <> '1'

31.  Read from F3413.

32.  If Read Fails then Break out of this While Loop.

33.  If MRSTRT = Null Date

34.  continue

35.  End If

36. 

37.  If Wk StartDate < MRSTRT then

38.  Wk StartDate = Null Date

39.  End If

40.  break

41. End While

42. If Wk StartDate > Null Date

43.  Select Records From F3413 with Input ShortItemNumber, Input BusinessUnit and 

MRSTRT >= Wk Start Date, order by MRSTRT.

44. Else

45.  Select Records From F3413 with Input ShortItemNumber, Input BusinessUnit,  order by 

MRSTRT.

46. End If

47. Initialize I = 0

48. Wk PreviousDate = Null Date

49. While Read from F3413 is Successful And I < InputNumberOfPeriods And I < MaxDates

50.  If MRQT <> "GD"

51.  If MRSTRT = Null Date And Wk PreviousDate = Null Date And I = 0

52.  DateInLongArray[I] = 0

53.  DateInStringArray[I] = "000000"

54.  I = I + 1

55.  Wk NumDates = Wk NumDates + 1

56.  End If

57.  If MRSTRT <> Wk PreviousDate

58.  DateInLongArray[I] = MRSTRT converted to Gregorian

59.  DateInStringArray[I] = " " + MRSTRT converted to mm/dd/yy format.

60.  I = I + 1

61.  Wk NumDates = Wk NumDates + 1

62.  Wk PreviousDate = MRSTRT

63.  End If

64.  End If

65. End While

66. If Input DisplayForecastConsumptionBuckets = '1'

67.  If Wk StartDate > Null Date

68.  Select Records from F3405 with MUPETY='FC' and MUENDD >= Wk StartDate and 

MUENDD <= DateInLong[Wk NumDates - ] in JDEDATE format.

69.  Else

70.  Select Records from F3405 with MUPETY='FC' and MUENDD <= DateInLong[Wk 

NumDates - ]in JDEDATE format.

71.  End If

72.  While Wk ExitFlag <> '1'

73.  Read from F3405

74.  If Read Fails then Break from While Loop

75.  Scan DateInLongArray for a date >= MUENDD and retrieve the index of the 

date into I.

76.  If Date is Found then

77.  If Exact Match

78.  First Character of DateInStringArray[I] = '*'

79.  Else

80.  If DateInLong[I] > MUENDD

81.  I = I - 1

82.  First Character of DateInStringArray[I] = '*'

83.  End If

84.  End If

85.  End If

86.  End While

87. End If

88. 

89. If Wk NumDates > 0

90.  Init Wk LeadtimeDateCounter, Wk MfgDateCounter, Wk CumDateCounter, Wk 

FreezeDateCounter, Wk MsgDateCounter to -1

91.  Look for Input LeadtimeLevelDate in DateInLongArray

92.  If Found

93.  Wk LeadtimeDateCounter = Index of Matching Date in DateInLongArray.

94.  End If

95.  Look for Input LeadtimeMfgDate in DateInLongArray

96.  If Found

97.  Wk MfgDateCounter = Index of Matching Date in DateInLongArray.

98.  End If

99.  Look for Input PlanningDate in DateInLongArray

100.  If Found

101.  Wk PlanDateCounter = Index of Matching Date in DateInLongArray.

102.  End If

103.  Look for Input LeadtimeCumDate in DateInLongArray

104.  If Found

105.  Wk CumDateCounter = Index of Matching Date in DateInLongArray.

106.  End If

107.  Look for Input FreezeDate in DateInLongArray

108.  If Found

109.  Wk FreezeDateCounter = Index of Matching Date in DateInLongArray.

110.  End If

111.  Look for Input MessageDate in DateInLongArray

112.  If Found

113.  Wk MsgDateCounter = Index of Matching Date in DateInLongArray.

114.  End If

115.  Pad spaces to every date string in the DateInStringArray

116.  If DateInStringArray[0] = " Past Due     " and Input PastDueBuckets = 2

117.  DateInStringArray[0] = " Past Period 1"

118.  DateInStringArray[1] = " Past Period 2"

119.  End If

120.  Index = 14

121.  If Input MessageDays > 0 And Wk MsgDateCounter <> -1

122.  DateInStringArray[Wk MsgDateCounter][Index] = 'D'

123.  End If

124.  If Input FreezeDays > 0 And Wk FreezeDateCounter <> -1 And Wk  FreezeDateCounter > 

Input PastDuePeriods -1 

125.  DateInStringArray[Wk FreezeDateCounter][Index] = 'F'

126.  If Index > 12

127.  Index = Index - 1

128.  Else

129.  Index = 14

130.  End If

131.  If Input LeadtimeCumDays > 0 And Wk CumDateCounter <> -1 And Wk CumDateCounter 

Input PastDuePeriods -1 

132.  DateInStringArray[Wk CumDateCounter][Index] = 'C'

133.  If Index > 12

134.  Index = Index - 1

135.  Else

136.  Index = 14

137.  End If

138.  End If

139.  If Input LeadtimeMfgDate > 0 And Wk Wk MfgDateCounter <> -1 And Wk Wk 

MfgDateCounter > Input PastDuePeriods -1 

140.  DateInStringArray[Wk MfgDateCounter][Index] = 'M'

141.  If Index > 12

142.  Index = Index - 1

143.  Else

144.  Index = 14

145.  End If

146.  End If

147.  If Input PlanningDate > 0 And Wk PlanningDateCounter <> -1 And Wk 

PlanningDateCounter > Input PastDuePeriods -1 

148.  DateInStringArray[Wk PlanningDateCounter][Index] = 'P'

149.  If Index > 12

150.  Index = Index - 1

151.  Else

152.  Index = 14

153.  End If

154.  End If

155.  If Input LeadtimeLevelDate > 0 And Wk LeadtimeDateCounter <> -1 And Wk 

LeadtimeDateCounter > Input PastDuePeriods -1 

156.  DateInStringArray[Wk LeadtimeDateCounter][Index] = 'L'

157.  If Index > 12

158.  Index = Index - 1

159.  Else

160.  Index = 14

161.  End If

162.  End If

163. End If

164. For I = 0 to Wk NumberOfQtyTypes - 1

165. 

166.  If Wk StartDate > Null Date

167.  Select from F3413 with Input ShortItemNumber, Input Business Unit, MRSTRT 

>= Wk StartDate and MRQT = QtyTypeArray[I]

168.  Else

169.  Select from F3413 with Input ShortItemNumber, Input Business Unit  and MRQT 

= QtyTypeArray[I]

170.  End If

171.  While Wk ExitFlag <> '1'

172.  Read from F3413

173.  If Read Fails then Break from While Loop

174.  lDateInLong = MRSTRT (0 if MRSTRT is Null Date)

175.  While DateInLongArray[Index2 ] < lDateInLong

176.  Index2 = Index2 + 1

177.  End While

178.  If Input ConversionFactor <> 0 then

179.  MRTRQT = MRTRQT / Input ConversionFactor

180.  End If

181.  QtyArray[I][Index2] = QtyArray[I][Index2] + MRTRQT

182.  If QtyArray[I][Index2] <> 0

183.  DoNotSuppressLineArray[I] = '1'

184.  End If

185.  End While

186. End For

187. For I = 0  to Wk NumDates - 1

188.  For Y = 0 to Wk NumberOfQtyTypes - 1

189.  iQtyType = QtyTypeArray[Y] in integer format

190.  If iQtyType >= 15 and <= 40

191.  If iQtyType <> 15 And <> 25 And <> 35

192.  Wk Supply = Wk Supply + QtyArray[Y][I]

193.  End If

194.  End If

195.  If iQtyType >= 42 And <= 80

196.  If iQtyType <> 45 And <> 55 And <> 70

197.  Wk Demand = Wk Demand + QtyArray[Y][I]

198.  End If

199.  End If

200.  End For

201.  QtyArray[DemandLine][I] = Wk Demand

202.  QtyArray[SupplyLine][I] = Wk Supply

203.  Wk Demand = 0

204.  Wk Supply = 0

205. End For

206. Write Array Data to F34UI003

207. Insert to F34UI003 with 'D', LineID=1, and contents in DateInStringArray.

208. LineID = LineID+1

209. For I = 0 to Wk NumberOfQtyTypes - 2

210.  If QtyTypeArray[I] = " " then Continue

211.  If QtyTypeArray[I] > 42 And Wk DemandWrittenFlag <> '1'

212.  Insert into F34UI003 '1', 'Demand', 'DD' and contents of 

QtyArray[DemandLine]

213.  LineID =LineID + 1

214.  Wk DemandWrittenFlag = '1'

215.  End If

216.  Insert into F34UI003 with EV01= DoNotSuppressLineArray[I], QtyTypeDesc[I], 

QtyTypeArray[I].

217.  LineID = LineID + 1

218.  If QtyTypeArray[I] >= 40 And Wk SupplyWrittenFlag <> '1'

219.  Insert into F34UI003 '1', 'Supply', 'SS' and contents of 

QtyArray[DemandLine]

220.  LineID =LineID + 1

221.  Wk SupplyWrittenFlag = '1'

222.  End If

223. End For

224. Close tables.




^

Data Structure

D3401000B - F3413 Delete Time Series

Parameter NameData ItemData TypeReq/OptI/O/Both
szComputerIDCTIDcharNONENONE

mnJobNumberJOBSMATH_NUMERICNONENONE

The job number (work station ID) which executed the particular job.

Related Functions

B3100710 Get Job Number
B9800100 Get Audit Information
B9800181 Environment List Business Functions
B9800420 Get Data Dictionary Definition

Related Tables

F0005 User Defined Codes
F3405 Forecast Consumption Periods
F3413 MPS/MRP/DRP Summary File
F34UI003 MPS Time Series User Index