MRPMultiPlantSequenceBranchInUI

MRP, Multi-Plant Sequence Branches in UI

Minor Business Rule

Object Name: B3500090

Parent DLL: CMFG

Location: Client/Server

Language: C

1.Functional Description
This function will read the available plants to adjust and sequence the order of plants to be 

processed in the User Index F35UI001.


1.1Purpose


1.2Setup Notes and Prerequisites


1.3Special Logic


2.Technical Specifications

This function should not be modified for other programs. It should be used only for R3483.


1. Process Demand Branches according to the F3403 table:
2. Wk Number of Plants = Input Number of Branches.

3. Allocate Array @Branch with size = Wk Number Of Plants * sizeof (MCU)

4. $X = 0

5. Select All Records from F35UI001

6. While Wk Exit Flag <> '1'

7.  Read F35UI001

8.  If Read Succeeds

9.  Copy Branch from record to @Branch[$X * sizeof(MCU)]

10.  $X++

11.  Else

12.  Break

13.  End If

14. End While

15. $X = 1

16. Set up SELECT structure on F3403 using MPCMCU = List(@Branch).

17. Set up SEQUENCE structure to order selection by Branch Level (MPBRLV) in Descending Order, 

and Branch Sequence (MPBRSQ) in Ascending order. 

18. Perform the Select Keyed Statement.

19. While Wk Exit Flag <> '1'

20.  Fetch from F3403.

21.  If Fetch Failed then 

22.  Exit While Loop

23.  End If

24.  If MPCMCU = Wk Previous Branch then

25.  Continue

26.  End If

27.  Wk Previous Branch = MPCMCU

28. 

29.  Call B3500060 with Job Number String, 'D', and MPCMCU in mode '1', non- sequential 

fetch.

30.  Retrieve $$BEG and $$ENDD

31. 

32.  Fetch Keyed on F35UI001 using Input Job Number, Computer ID, and MPCMCU.

33.  If Not Found Or MABRSQ <> 999

34.  Continue

35.  End If

36. 

37. 

38.  Call Internal Function Check Exclusions

39.  If Exclude Flag (from Internal Function) <> '0'

40.  Continue

41.  End If

42. 

43.  * This branch is included in a valid relationship.

44.  * Set this branch's BRSQ code in F35UI001.

45. 

46.  Update Record in F35UI001 using Input Job Number, Computer ID, and MPCMCU and  set 

the BRSQ field with $X.

47.  $X ++

48. 

49. End While

50. 

51. 

52. Cleanup:

53. Free @Branch array.

54. Close F3403 and F34UI005


Internal Function Check Exclusions(F3403 Record DS, F3403 Hrequest, $$BEG, $$ENDD, Input DS, Output 

Exclude)

If Input F3403 Hrequest = NULL

Open F3403 and store F3403 Hrequest

End If

Set Output Exclude to '1'



* Check if Branch is Included by Item Number.

Wk Override Category Code = '0'

Select Keyed on F3403 using MPMMCU=Input MPMMCU, MPCMCU=Input MPCMCU, MPPRPX=" ", and MPITM=Input 

Item

While Wk Exit Flag <> '1'

Fetch From F3403.

If Fetch Failed then

Break from While Loop

End If

If MPEXIN = 'I' And MPEFFF <= $$ENDD And MPEFFT >= $$BEG

Output Exclude = '0'

Wk Override Category Code = '1'

Exit While Loop

Else

If MPEXIN = 'E' And MPEFFF <= $$ENDD And MPEFFT >= $$BEG

Output Exclude = '1'

Wk Override Category Code = '1'

Exit While loop

End if

End If

End While


* If Override Category Code = '0' Check if Branch is Included by Category

If Wk Override Category Code = '0'

Wk Override Generic Relationship = '0'

Select Keyed on F3403 using MPMMCU=Input MPMMCU, MPCMCU=Input MPCMCU, MPPRPX=Input SVPRPX, 

and MPITM=0

While Wk Exit Flag <> '1'

Fetch from F3403.

If Fetch Failed then

Break from While Loop

End If

If MPEXIN = 'I' And MPEFFF <= $$ENDD And MPEFFT >= $$BEG

Output Exclude = '0'

Wk Override Generic Relationship = '1'

Exit While Loop

Else


If MPEXIN = 'E' And MPEFFF <= $$ENDD And MPEFFT >= $$BEG

Output Exclude = '1'

Wk Override Generic Relationship = '1'

Exit While Loop

End if

End If

End While

* If Override Generic Relationship = '0' Check if Branch is Included by Generic 

Relationship.

If Wk Override Generic Relationship = '0'

Select Keyed on F3403 using MPMMCU=Input MPMMCU, MPCMCU=Input MPCMCU, 

MPPRPX=" ", and MPITM=0

While Wk Exit Flag <> '1'

Fetch from F3403.

If Fetch Failed then

Break from While Loop

End If

If MPEXIN = 'I' And MPEFFF <= $$ENDD And MPEFFT >= $$BEG

Output Exclude = '0'

Exit While Loop

Else

If MPEXIN = 'E' And MPEFFF <= $$ENDD And MPEFFT >= $$BEG

Output Exclude = '1'

Exit While Loop

End If

End If

End While

End If

End If



Data Structure

D3500090 - MRP, Multi-Plant Sequence Branches in UI


^

Parameter NameData ItemData TypeReq/OptI/O/Both
mnJobNumberJOBSMATH_NUMERICNONENONE

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

szComputerIDCTIDcharNONENONE

mnIdentifierShortItemITMMATH_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

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.

cSuppressErrorsEV01charNONENONE

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

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

nNumberOfBranchesINT01integerNONENONE

Number of Days in Future to Query for Responses Due. 

szJobNumberAsStringJOBcharNONENONE

Job Number

Related Functions

B3500060 Cache, Process Multi Plants

Related Tables

F3403 Branch Relationships Master File
F35UI001 MPS/MRP Planning - Multiple Plant User Index