1.Functional Description
1.1Purpose
This function will load Parts List Comparison data from F3111, F3112, and F30006 for the Parts List
Comparison application P31117. It uses an internal cache to store the parts list comparison records
for display in the grid in P31117.
1.2Setup Notes and Prerequisites
The function must be called in Action Code 'L' first before subsequent records can be returned to the
calling application. This will load the cache and return the first record in the cache.
To return subsequent records in the cache, Action Code must be set to 'R'.
When the application exits, an Action Code of 'T' must be sent in to terminate all cache resources.
1.3Special Logic
When Action Code is 'L' or 'R' and there are no more records that can be returned to the calling
application, an Error Code of '1' will be returned.
2.Technical Specifications
2.4Processing
/********** Setup Processing *********/
1.If Input Action Code <> 'L', 'R' or 'T'
2.Exit Function with Error Code '2' and Error Message '0001'
3.End If
4.If Input Action Code = 'L'
5.Input Job Number = Random Number b/w 1 and 100
6.Initialize Cache Handle with 'PLComp' + Input Job Number
7.Counter = 0
8.While Initialize Was Successful and Action Code is 'L' And Counter < 100 then
9.Counter++
10.Input Job Number = Random Number b/w 1 and 100
11.Initialize Cache Handle with 'PLComp' + Input Job Number
12.End While
13.Set Up Cache Index and Initialize Cache with 'PLComp' + Input Job Number
14.Else
15.Initialize Cache Handle with 'PLComp' + Input Job Number
16.End If
17.***
18.If Cache Handle <> NULL
19.If Action Code = 'L'
20.Do Internal Function Load()
21.Do Internal Function ReturnRecord()
22.Else If Action Code = 'R'
23.Do Internal Function ReturnRecord()
24.Else If Action Code = 'T'
25.Call Cache Terminate.
26.End If
27.End If
Internal Function Load()
1.Open F3111 twice with 2 Request Handles.
2.Open F3112.
3.Open F30006.
4.SelectKeyed on F3111 with Input Order Number 1 with hRequest1(Order by DOCO, CPIT, CMCU)
5.SelectKeyed on F3111 with Input Order Number 2 with hRequest2(Order by DOCO, CPIT, CMCU)
6.Wk Order = 'B'
7.Wk Order1Failed = '0'
8.Wk Order2Failed = '0'
9.While Wk Order1Failed = '0' OR Wk Order2Failed = '0'
10.If Wk Order = 'B' Or '1'
11.Do Internal Function Load Order(&Wk Order1Failed, '1', hRequest1, Part1, Input Order Qty 1)
12.End If
13.If Wk Order = 'B' Or '2'
14.Do Internal Function Load Order(&Wk Order2Failed, '2', hRequest2, Part2, Input Order Qty 2)
15.End If
16.If Wk Order1Failed = '0' OR Wk Order2Failed = '0'
17.If Part1.WMCPIT = Part2.WMCPIT And Part1.WLMCU = Part2.WLMCU And Part1.Qty = Part2.Qty And
Part1.UOM = Part2.UOM And Input Difference or All = 'D'
18.Wk Order = 'B'
19.Else
20.If Part1.WMCPIT = Part2.WMCPIT And Part1.WLMCU = Part2.WLMCU And Part1.Qty <> Part2.Qty
OR
21.Part1.WMCPIT = Part2.WMCPIT And Part1.WLMCU = Part2.WLMCU And
22.Part1.UOM <> Part2.UOM OR
23.Part1.WMCPIT = Part2.WMCPIT And Part1.WLMCU = Part2.WLMCU And Input Difference or All = 'A'
24.Wk Order = 'B'
25.Do Internal Function Write Cache()
26.Else
27.If Part1.WMCPIT < Part2.WMCPIT OR
28.Part1.WMCPIT = Part2.WMCPIT And Part1.WLMCU < Part2.WLMCU
29.Wk Order = '1'
30.Do Internal Function Write Cache()
31.Else
32.If Part1.WMCPIT > Part2.WMCPIT OR
33.Part1.WMCPIT = Part2.WMCPIT And Part1.WLMCU > Part2.WLMCU
34.Wk Order = '2'
35.Do Internal Function Write Cache()
36.End If
37.End If
38.End If
39.End If
40.End If
41.End While
42.Close F3111 for each hRequest, Close F3112 and F30006.
Internal Function Load Order(*Wk Failed, cType, hRequestF3111, Part, OrderQty)
1.If *Wk Failed = '1' then
2. Exit Function
3.End If
4.Wk Done = '0'
5.Wk FetchF3111Failed = '0'
6.While Wk Done = '0'
7. Fetch F3111 using hRequestF3111.
8. If Failed
9. Part.WMCPIT = 99999999
10. Part.WLMCU = HiValue
11. Wk Done = '1'
12. Wk FetchF3111Failed = '1'
13. Else
14. Load F3111 columns to Part datastructure.
15. FetchKeyed to F3112 using WMDOCO And WMOPSQ
16. If Failed
17. Part.WLMCU = " "
18. End If
19. Wk Done = '1'
20. If Input Work Center <> " " And Part.WLMCU <> " " And Part.WLMCU
<> Input Work Center
21. Wk Done = '0'
22. End If
23. If Input Dispatch Group <> " "
24. FetchKeyed from F30006 using Part.WLMCU
25. If Successful And Input Dispatch Group <> IWMCUW then
26. Wk Done = '0'
27. End If
28. End If
29. End If
30.End While
31.If OrderQty <> 0 And Wk FetchF3111Failed = '0'
32. Part.Qty = Part.Qty / OrderQty
33.End If
Internal Function Write Cache(Part 1, Part 2, OrderFlag)
1.If Part1.WMCOBY = 'C' Or Part1.WMCOBY = 'B' Or Part1.WMCOBY = 'I' Or Part1.WMCPIT = 0 OR
2.Part2.WMCOBY = 'C' Or Part2.WMCOBY = 'B' Or Part2.WMCOBY = 'I' Or Part2.WMCPIT = 0
3. Exit Function
4.End If
5.If OrderFlag <> '2'
6. Cache.MCU = Part1.WLMCU
7. Cache.UITM = Primary Item Number of Part1.WMCPIT
8. Cache.DSC1 = Description 1 of Item Part1.WMCPIT
9.Else
10. Cache.MCU = Part2.WLMCU
11. Cache.UITM = Primary Item Number of Part2.WMCPIT
12. Cache.DSC1 = Description 1 of Item Part2.WMCPIT
13.End If
14.If OrderFlag <> '2'
15. Cache.UORG = Part1.Qty
16. Cache.UM = Part1.UOM
17.End If
18.If OrderFlag <> '1'
19. Cache.TRQT = Part2.Qty
20. Cache.UOM = Part2.UOM
21.End If
22.Add Record to Cache.
Internal Function ReturnRecord()
1.If Action Code = 'L' then
2. Open Cursor on Cache
3. If Failed
4. Return Error Code = '1'
5. Else
6. Store Cursor in Input hCursor
7. End If
8.End If
9.If Input hCursor <> 0
10. Retrieve Wk hCursor from Input hCursor
11. Cache Fetch
12. If Successful
13. Copy Cache Data to Output Parameters
14. Else
15. Return Error Code = '1'
16. Close cursor
17. Free Input hCursor Pointer
18. Input hCursor = 0
19. End If
20.Else
21. Return Error Code = '2'
22.End If
^
D3101210 - F3111 Write Parts List Comparison Cache
Parameter Name | Data Item | Data Type | Req/Opt | I/O/Both |
---|---|---|---|---|
cActionCode | ACTN | char | NONE | NONE |
A code that specifies the action that is performed. Valid values are: A Add C Change | ||||
nJobNumberInteger | INT01 | integer | NONE | NONE |
Number of Days in Future to Query for Responses Due. | ||||
idCursorPtr | GENLNG | ID | NONE | NONE |
General purpose ID variable. | ||||
mnOrderNumber1 | DOCO | MATH_NUMERIC | NONE | NONE |
A number that identifies an original document. This document can be a voucher, a sales order, an invoice, unapplied cash, a journal entry,
| ||||
mnOrderQty1 | UORG | MATH_NUMERIC | NONE | NONE |
The quantity of units affected by this transaction. | ||||
mnOrderNumber2 | DOCO | MATH_NUMERIC | NONE | NONE |
A number that identifies an original document. This document can be a voucher, a sales order, an invoice, unapplied cash, a journal entry,
| ||||
mnOrderQty2 | UORG | MATH_NUMERIC | NONE | NONE |
The quantity of units affected by this transaction. | ||||
szWorkCenter | 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
| ||||
szDispatchGroup | MCUW | char | NONE | NONE |
A category code used to group work centers within an overall business unit.
For example, you can use this code to group similar machines
| ||||
cAllDifferences | DIFF | char | NONE | NONE |
Display All records or those that have Differences. | ||||
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
| ||||
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
| ||||
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
| ||||
szWorkCenterOutput | 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
| ||||
szPartDescription | DSC1 | char | NONE | NONE |
Brief information about an item; a remark or an explanation. | ||||
mnQtyPerItem1 | UORG | MATH_NUMERIC | NONE | NONE |
The quantity of units affected by this transaction. | ||||
mnQtyPerItem2 | UORG | MATH_NUMERIC | NONE | NONE |
The quantity of units affected by this transaction. | ||||
szUMItem1 | UM | char | NONE | NONE |
A user defined code (00/UM) that identifies the unit of measurement for an amount or quantity. For example, it can represent a barrel, box,
| ||||
szUMItem2 | UM | char | NONE | NONE |
A user defined code (00/UM) that identifies the unit of measurement for an amount or quantity. For example, it can represent a barrel, box,
| ||||
cUseCache | EV01 | char | NONE | NONE |
An option that specifies the type of processing for an event. | ||||
szPartNumberLong | LITM | char | NONE | NONE |
A number that identifies the item. The system provides three separate item numbers plus an extensive cross-reference capability to
| ||||
szPartNumberThird | AITM | char | NONE | NONE |
The system provides three separate item numbers plus an extensive cross-reference capability to alternate item numbers. These item
| ||||
mnPartNumberShort | 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
| ||||
szComputerID | CTID | char | NONE | NONE |
None |
F30006 Work Center Master File | ||||
F30UI008 Bill of Material Comparison Work File | ||||
F3111 Work Order Parts List | ||||
F3112 Work Order Routing |