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.
^
D3401000 - Create Time Series Detail
Parameter Name | Data Item | Data Type | Req/Opt | I/O/Both |
---|---|---|---|---|
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
| ||||
cErrorCode | ERRC | char | NONE | NONE |
This error code indicates if any errors occurred during the creation of the Trip Document Detail (F4914) records by the Delivery Document
| ||||
cSuppressErrorMessage | EV01 | char | NONE | NONE |
An option that specifies the type of processing for an event. | ||||
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
| ||||
mnNumberOfPastDueWks | MATH01 | MATH_NUMERIC | NONE | NONE |
- - - Good Performance Low Value. | ||||
szQuantityType | QT | char | NONE | NONE |
This code is used to distinguish different quantities generated in the MPS/MRP system. | ||||
cSummarizeFlag | 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,
| ||||
mnMessageDays | MTF3 | MATH_NUMERIC | NONE | NONE |
The number of days after the generation start date within which the system should display order messages.
For example, if the generation
| ||||
mnFreezeDays | MTF2 | MATH_NUMERIC | NONE | NONE |
The number of days from the generation start date within which the system does not generate action messages.
For example, if the
| ||||
mnCumulativeDays | LTCM | MATH_NUMERIC | NONE | NONE |
The total number of days required to build an item from its lowest level components to the final assembly. The system calculates the value
| ||||
mnMfgDays | LTMF | MATH_NUMERIC | NONE | NONE |
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
| ||||
mnPlanningDays | MTF1 | MATH_NUMERIC | NONE | NONE |
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
| ||||
mnLeadtimeDays | LTLV | MATH_NUMERIC | NONE | NONE |
A value that represents the leadtime for an item at its assigned level in the production process, as defined on Plant Manufacturing Data.
| ||||
mnReportConversionFactor | CONV | MATH_NUMERIC | NONE | NONE |
The factor that the system uses to convert one unit of measure to another unit of measure. | ||||
mnJobNumber | JOBS | MATH_NUMERIC | NONE | NONE |
The job number (work station ID) which executed the particular job. | ||||
szComputerID | CTID | char | NONE | NONE |
szProgramID | PID | char | NONE | NONE |
The number that identifies the batch or interactive program (batch or interactive object). For example, the number of the Sales Order Entry
| ||||
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
| ||||
szBusinessUnit | 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
| ||||
jdLeadtimeDate | DATE01 | JDEDATE | NONE | NONE |
Event point for JDE Date. | ||||
jdPlanningDate | DATE01 | JDEDATE | NONE | NONE |
Event point for JDE Date. | ||||
jdMfgDate | DATE01 | JDEDATE | NONE | NONE |
Event point for JDE Date. | ||||
jdCumulativeDate | DATE01 | JDEDATE | NONE | NONE |
Event point for JDE Date. | ||||
jdFreezeDate | DATE01 | JDEDATE | NONE | NONE |
Event point for JDE Date. | ||||
jdMessageDate | DATE01 | JDEDATE | NONE | NONE |
Event point for JDE Date. | ||||
mnNumberOfPeriods | MATH01 | MATH_NUMERIC | NONE | NONE |
- - - Good Performance Low Value. | ||||
mnSectionsNeeded | MATH02 | MATH_NUMERIC | NONE | NONE |
- - - Good Performance High Value. | ||||
cDisplayFcstConsumptionBuckets | EV01 | char | NONE | NONE |
An option that specifies the type of processing for an event. | ||||
cUseDescription1 | EV01 | char | NONE | NONE |
An option that specifies the type of processing for an event. |
B3100710 Get Job Number | ||||
B9800100 Get Audit Information | ||||
B9800181 Environment List Business Functions | ||||
B9800420 Get Data Dictionary Definition |
F0005 User Defined Codes | ||||
F3405 Forecast Consumption Periods | ||||
F3413 MPS/MRP/DRP Summary File | ||||
F34UI003 MPS Time Series User Index |