1.Functional Description
This function will update the branch levels for the lower level plants in the Branch Relationship
table, given the branch level for the parent.
1.1Purpose
The purpose of this function is for P3403T to be able to automatically update the Branch Level field
in F3403 when a new record/relationship is added. This function emulates 'X34BRLV' on the AS400
system.
1.2Setup Notes and Prerequisites
1.3Special Logic
2.Technical Specifications
Cache Datastructure for both caches are identical:
MMCU- Branch
BRLV- Level
Index caches by Branch.
1. Process Demand Branches according to the F3403 table:
2. Create 2 Caches: "3500100ALL" and "3500100UNP".
3. Open Table F3403
4.
5. If Cache Creation Fails or Open Table fails
6. Exit Function with Error Code '3143'
7. End iF
8.
9. cLoop = '1'
10. Add the Input MMCU and Input BRLV to the "3500100ALL" cache.
11. Add the Input CMCU and Input BRLV to the "3500100ALL" cache.
12. Wk CMCU = Input CMCU
13. While cLoop = '1'
14. cLoop = '0'
15. SelectKeyedPosition on F3403 using MPMMCU(=Wk CMCU)
16. While cExit <> '1'
17. FetchMatchingKey from F3403 using MPMMCU(=Input CMCU)
18. If Fetch Failed
19. Break
20. End If
21. Fetch from "3500100ALL" cache using MPCMCU as key.
22. If Fetch Succeeded
23. If Input BRLV >= Branch Level from Cache
24. Branch Level from Cache = Input BRLV + 1
25. Update the "3500100ALL" cache with current value of MMCU, and Branch
Level.
26. Fetch from "3500100UNP" cache using MPCMCU as key.
27. If Fetch Succeeded then
28. Branch Level from Cache = Input BRLV + 1
29. Update the "3500100UNP" cache with current value of MMCU, and
Branch Level.
30. End If
31. End If
32. Else
33. Branch Level Cache = Input BRLV + 1
34. Branch Cache = MPCMCU.
35. Add Record to "3500100ALL" Cache
36. Add Record to "3500100UNP" Cache.
37. End If
38. If MPBRLV <= Input BRLV
39. MPBRLV = Input BRLV + 1
40. Update F3403
41. Else
42. cExit = '1'
43. End If
44. End While
45.
46. Fetch from "3500100UNP" Cache with 0 keys
47. If Fetch Succeeded
48. Wk CMCU = Cache Branch
49. Delete Record from "3500100UNP" Cache.
50. cLoop = '1'
51. End If
52. End While
53.
54. Close table F3403.
55. Destroy both the caches if they were created.
^
D3500100 - F3403, Update Branch Level
Parameter Name | Data Item | Data Type | Req/Opt | I/O/Both |
---|---|---|---|---|
szFromBranch | MMCU | char | NONE | NONE |
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
| ||||
szToBranch | CMCU | char | NONE | NONE |
A secondary or lower-level business unit. The system uses the value that you enter to indicate that a branch or plant contains several
| ||||
mnBranchLevel | BRLV | MATH_NUMERIC | NONE | NONE |
Determines the level at which a component branch should be processed in multi-plant processing. The lowest level branches (which are
| ||||
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
| ||||
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
|
None |
F3403 Branch Relationships Master File |