MRPGetSupplyBranch

MRP, Get Supply Branch

Minor Business Rule

Object Name: B3500030

Parent DLL: CMFG

Location: Client/Server

Language: C

1.Functional Description

1.1Purpose
To read the F3403 table and retrieve the next available supply branch(MPMMCU) given a demand 
branch(MPCMCU), the item number(MPITM), transfer date (DRQJ) and the category code(MPPRPX). This function will 

return a pointer to the Request handle so that the next supply branch logic can be implemented. In 

addition, all field values for the record will be returned in the business function data structure.


1.2Setup Notes and Prerequisites

Pointers are being used to implement the 'get next' logic. The user is responsible for freeing (i.e. 
closing)the request handle to F3403 when no longer needed. 


1.3Special Logic


2.Technical Specifications

1.Set Output Error Message to '3143' if open tables fail, or failure in pointer operations.
2.Initialize Wk Perform Select = '0'

3.If Input Hrequest F3403 = 0 then

4. Open F3403.

5. Store the Hrequest using StoreDataPointer and return the value into Input Hrequest F3403.

6. Input Fetch Based Upon = '1'

7. Wk Perform Select = '1'

8. Init both caches

9.Else

10. Call RetrieveDataPointer to retrieve the Hrequest for F3403.

11.End If

12.If Close Mode = '1' then

13. Close F3403 using the hRequest retrieved.

14. Free Data Pointer to idhRequestF3403.

15. Terminate both caches

16. Exit Function.

17.End if

18.Initialize Error Code = '0'

19.Initialize Wk Exit Flag = '0'

20.While Wk Exit Flag = '0'

21. Wk Exit Flag = '1'

22. Switch( Input Fetch Based Upon )

23. Case '1'

24. If Wk Perform Select = '1'

25. Select Keyed Position on F3403 Using MPITM(=Input Item Number), 

MPCMCU(=Input Demand Branch), 

               MPPRPX(=" "), MPBRSQ(=0) And MPEFFT(>=Intended Tansfer Date).

26. Wk Perform Select = '0'

27. End If

28. Fetch Matching Key using MPCMCU(=Input Demand Branch), MPITM(=Input Item 

Number),and MPPRPX(=" ") only.

29. If the Fetch Failed

30. Input Fetch Based Upon = '2'

31. Wk Perform Select = '1'

32. Else

33. Call Internal Function to Validate F3403 Record (F3403 Record, lpDS, Wk 

Valid).

34. If Wk Valid = TRUE

35. Return the F3403 field values into output fields.

36. Add MPMMCU to Done Cache

37. Set Input Error Code = '0'

38. Else

39. Wk Exit Flag = '0'

40. End If

41. Break from Switch structure

42. End If

43. Case '2'

44. If Wk Perform Select = '1'

45. Select Keyed Position on F3403 Using MPITM(=0), MPCMCU(=Input Demand 

Branch), MPPRPX(=Input Category Code), MPBRSQ(=0) And MPEFFT(>=Intended  Tansfer 

Date).

46. Wk Perform Select = '0'

47. End If

48. Fetch Matching Key using MPCMCU(=Input Demand Branch), MPITM(=0), and 

MPPRPX(=Input Category Code) 

            only.

49. If the Fetch Failed

50. Input Fetch Based Upon = '3'

51. Wk Perform Select = '1'

52. Else

53. Call Internal Function to Validate F3403 Record (F3403 Record, lpDS, Wk 

Valid).

54. If Wk Valid = TRUE

55. Return the F3403 field values into output fields.

56. Add MPMMCU to Done Cache

57. Set Input Error Code = '0'

58. Else

59. Wk Exit Flag = '0'

60. End If

61. Break from Switch structure

62. End If

63. Case '3'

64. If Wk Perform Select = '1'

65. Select Keyed Position on F3403 Using MPITM(=0), MPCMCU(=Input Demand 

Branch), MPPRPX(=" "), MPBRSQ(=0) And MPEFFT(>=Intended Tansfer Date).

66. Wk Perform Select = '0'

67. End If

68. Fetch Matching Key using MPCMCU(=Input Demand Branch), MPITM(=0), and 

MPPRPX(=" ") only.

69. If the Fetch Failed

70. Set Input Error Code = '1'

71. Break from Switch structure.

72. Else

73. Call Internal Function to Validate F3403 Record (F3403 Record, lpDS, Wk 

Valid).

74. If Wk Valid = TRUE

75. Return the F3403 field values into output fields.

76. Add MPMMCU to Done Cache

77. Set Input Error Code = '0'

78. Else

79. Wk Exit Flag = '0'

80. End If

81. Break from Switch structure

82. End If

83. End Switch

84.End While


Validate F3403 Record(*F3403 Record, lpDS, *Valid)

1.If MPEFFF > Input Intended Transfer Date Or MPEFFT < Input Intended Transfer Date

2. Valid = FALSE

3.Else

4. Valid = TRUE

5. If MPEXIN = 'E'

6. Get from Exclude Cache using MPMMCU

7. If Not Found

8. Insert new record into Exclude cache with MPMMCU

9. End If

10. Valid = FALSE

11. Else

12. Get from Exclude Cache using MPMMCU

13. If Found then

14. Valid = FALSE

15. Else

16. Get from Done Cache using MPMMCU

17. If Found then

18. Valid = FALSE

19. End If

20. End If

21. End If

22.End if


^

Data Structure

D3500030 - MRP, Get Supply Branch

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

szDemandBranchCMCUcharNONENONE

A secondary or lower-level business unit. The system uses the value that you enter to indicate that a branch or plant contains several 
subordinate departments or jobs. For example, assume that the component branch is named MMCU. The structure of MMCU might be as follows:    
Branch/Plant - (MMCU)       Dept A - (MCU)       Dept B - (MCU)       Job 123 - (MCU)

szCategoryCodePRPXcharNONENONE

A user defined code (system 41, type P4) under which you can organize logically related items. You can simplify the master planning 
process by concentrating on only the top 10% of the inventory value. This is similar to using the ABC Analysis, except that you can use this code to 
allow exceptions to ABC rules. Generally, you should only include items with high inventory investment in Master Planning. Excess stock can 
be carried for inventory items with little financial impact.

jdIntendedTransferDateDRQJJDEDATENONENONE

The date that an item is scheduled to arrive or that an action is scheduled for completion.

cFetchBasedUponEV01charNONENONE

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

szSupplyBranchMMCUcharNONENONE

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 
represent lower-level business units, subordinate to it. For example:     o Branch/Plant (MMCU)     o Dept A (MCU)     o Dept B (MCU)     o Job 123 
(MCU) Business unit security is based on the higher-level business unit.

mnBranchLevelBRLVMATH_NUMERICNONENONE

Determines the level at which a component branch should be processed in multi-plant processing. The lowest level branches (which are 
assigned a higher numerical value) are processed first, followed by the higher level branches (which are assigned a lower numerical 
value). NOTE: Assign branch levels carefully so that the planning system generates all demand before allocating supply.

mnBranchPriorityBRSQMATH_NUMERICNONENONE

Determines the sequence within a level that the branches are processed in multi-plant DRP/MPS/MRP. Use this field along with the Branch 
Level field to check inventory availability first in one branch, and then another.

cExcludeIncludeFlagEXINcharNONENONE

A code that indicates whether the system includes or excludes the item/category code in the Branch Relationships Master table (F3403) 
when generating a multi-plant schedule. If an item/category code is excluded, then that item/category code will be purchased or manufactured 
at the demand branch.

cAvailabilityCheckAVLCcharNONENONE

Indicates if the planning system will check availability of the item or family at the supply branch/plant. If you enable availability checking on 
the item or family being demanded, the available inventory at the branch/plant will be committed until there is a zero balance. If you disable 
availability checking,the inventory balance in the supplying branch/plant can be negative.

jdEffectiveFromDateEFFFJDEDATENONENONE

A date that indicates one of the following:     o When a component part goes into effect on a bill of material     o When a routing step goes into 
effect as a sequence on the routing for an item     o When a rate schedule is in effect The default is the current system date. You can enter 
future effective dates so that the system plans for upcoming changes. Items that are no longer effective in the future can still be recorded and 
recognized in Product Costing, Shop Floor Management, and Capacity Requirements Planning. The Material Requirements Planning system 
determines valid components by effectivity dates, not by the bill of material revision level. Some forms display data based on the effectivity 
dates you enter.

jdEffectiveThruDateEFFTJDEDATENONENONE

A date that indicates one of the following:     o When a component part is no longer in effect on a bill of material     o When a routing step is no 
longer in effect as a sequence on the routing for an item     o When a rate schedule is no longer active The default is December 31 of the 
default year defined in the Data Dictionary for Century Change Year. You can enter future effective dates so that the system plans for upcoming 
changes. Items that are no longer effective in the future can still be recorded and recognized in Product Costing, Shop Floor Management, 
and Capacity Requirements Planning. The Material Requirements Planning system determines valid components by effectivity dates, not by 
the bill of material revision level. Some forms display data based on the effectivity dates you enter.

mnTransitLeadtimeTRLTMATH_NUMERICNONENONE

The number of days to ship items from the supply branch to the demand branch. This leadtime is set up in the Branch Relationships Master 
table and can vary for different category codes or even for different items.

mnSourcePercentSRCPMATH_NUMERICNONENONE

The system uses source percentage to determine what percentage of the planned order should be supplied by the source branch. For 
example:        Demand Branch - ATL         Supply Branch - DEN source percentage = 40%, CHI source percentage =  60%        If ATL needs 100 
parts, the system generates a message to transfer 40 parts from DEN and 60 parts from CHI. A source percentage of 100 transfers the entire 
supply from that branch/plant.

mnPercentToFillPCTFMATH_NUMERICNONENONE

A field used during multi-plant processing to determine what percent of an order should be filled to place a transfer order message. For 
example:     o Percent to Fill - 75%     o Demand - 200     o If the supply branch has 150 (75 percent of 200) or more available, then the planning 
system places the transfer order message. The system generates the transfer order message when the percent to fill is zero.

mnPercentMarkupPCMUMATH_NUMERICNONENONE

The percent markup is the percent the cost is to be marked up when the item is transfered from one branch to another.

mnFixedMarkupAmountFXMUMATH_NUMERICNONENONE

The amount the cost is to be marked up when being transfered from one branch to another.

cMarkupExtendedOrUnitFXUEcharNONENONE

This code determines if the fixed cost markup is to be added to the unit cost or the extended cost. Valid values are:    U Add markup to the 
unit cost    E Add markup to the extended cost

idhRequestF3403GENLNGIDNONENONE

General purpose ID variable.

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

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.

cSuppressErrorMessageSUPPScharNONENONE

A flag indicating whether or not runtime error messaging will occur when an error message is issued from a business function.        0 = allow 
runtime error message handling.        1 = suppress runtime error message handling.

cCloseModeEV02charNONENONE

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

szJobNumberJOBcharNONENONE

Job Number

idhrequestF4102GENLNGIDOPTNONE

General purpose ID variable.

Related Functions

None

Related Tables

F3403 Branch Relationships Master File