F4111GetNextLevelTracking

F4111 Get Next Level Tracking

Major Business Rule

Object Name: B3001590

Parent DLL: CMFG

Location: Client/Server

Language: C

1.Functional Description

1.1Purpose
Determine all of the transactions in the next level of lot tracking.  These transaction will be 
stored in a link list for each level.  Another link list, TrackingLinkList, will keep track the number of 

level link lists that have been built.


1.2Setup Notes and Prerequisites

• Required Work Fields
• EV01 - EndofTracking
• EV01 - RecordsFound
• EV01 - RecordsRetrieved
• INT01 - Level (Integer)
• INDL - Level
• MODE - ModeofProcessing'1' = Single Level, '2'= ..., '3'=Multi-level, '4'=Multi-Level 
Indented

• EV01 - LotTracking '1' = Lot Tracking, '0' = Lot Tracing
• Lot Track Trace Inclusion Rule Codes.
• I = Issue
• M = Manufacturing Completion
• B = Bottom
• C = Top

1.3Special Logic


Required ER


FC Level = 0

FC EndofTracking = '0'

FC RecordsFound = '1'

FC Level (Integer) = '0'



If FC Mode is equal to '1'

BF F4111GetNextLevelTracking

    FC RecordsRetrieved = '1'
    While FC RecordsFound = '1' and FC RecordsRetrieved = '1'

        BF F4111GetNextRowTracking

        If FC RecordsRetrieved = '1'
            WriteCustomGridLine

        End

    EndWhile

Else

    Do While FC EndofTracking = '0'
        Do While FC RecordsFound = '1'

BF F4111GetNextLevelTracking
            If FC RecordsFound = '1'

                BF GetNextRecordTracking

                If FC RecordRetrieved = '1'
                    Write Custom Grid Line

                end

end
        EndWhile    

        FC RecordRetrieved = '0'

        Do While FC RecordRetrieved = '0' and FC Level > 0

            BF GetNextRecordTracking

            If FC RecordRetrieved = '1'
                Write Custom Grid Line

            else

FC Level = FC Level - 1
            end

        Endwhile

        If FC Level <= 0

            FC EndofTracking = '1'

        else

            FC RecordsFound = '1'

        end

    EndWhile

End


2.Technical Specifications


2.4Processing 

Work File

LEVLLevel
LOTNLot Number

MCUBranch

ITMItem Number

CRDJCreate Date

TDAYTime

PLOTParent Lot

MMCUParent Branch

KITParent Item

DOCDocument Number

AN8Address Number

TREFTransaction Reference

TREXTransaction Explanation

DCTTransaction Type

FRTOFrom/To

TRQTTransaction Quantity

EV01Transaction Classification

EV02Lot Status Code

IDUnique Key ID

EV03IsIssueTransaction

EV04IsCompeletionTransaction

EV05MultipleRecords

LOCNFrom Location

EV06To Location


Index:  LEVL, LOTN, MCU, ITM, CRDJ, TDAY

Index:  LEVL, PLOT, MMCU, KIT, CRDJ, TDAY

Index:  Unique Key ID

Index:  LEVL, LOTN, MCU, ITM, PLOT, MMCU, KIT



0.0.  Initialize DS RecordsFound = '0', WK Level = DS Level +1.


1.0.  If DS Level is greater than 1, retrieve first record from the work file where level = DS 
Level.


1.1.  Save value of this transaction as previous transaction.
Prev Trans Unique Key Id
Prev Trans TrackTraceClassification

Prev Trans Parent Lot

Prev Trans Parent Item

Prev Trans Parent Branch

Prev Trans Item Number

Prev Trans Lot Number

Prev Trans Branch

Prev Trans Reference

Prev Trans Document

Prev Trans Doc Type

Prev Is WO Issue 

Prev Is WO Completion 


1.2.  Delete this record from the work file.


3.0.   If the Previous Transaction was the final level, tracking will only continue if the 

transaction has a parent lot, the transaction is a WO Completion, or the transaction is a WO issue.

If the PrevTransTrackTraceClassification = 'C', PrevTransParentLot is equal to blank, and 

PrevIsWOCompletion = '0' , and PrevIsWOIssue = '0', exit program.


4.0.  If DS LastLevel > DS Level, 

Add 1 to DS Level 

If records at this level exist, assign DS RecordsFound = '1' 

exit.


4.0  Building the next Level.


(If prev trans is a WO Issue, Search for WO Completion Transactions)

4.1.  If DS Level is greater than 1 and PrevIsWOIssue = '1', search for next level by document #.
4.1.1.  Select from the Item Ledger Table (F4111) 
  where DOC PrevTransDocumentNumber, 
TREF 'WO' or 'RT', 
FRTO not = 'T'.

4.1.1.  Select from the Item Ledger Table (F4111) 
  where DOC PrevTransDocumentNumber, 
FRTO not = 'T'.
4.1.2.  Fetch next record from selected records until fetch fails.
return:  LOTN, ITM, MCU, CRDJ, TDAY, PLOT, MMCU, KIT, DCT, DOCO, TREF, TREX...
4.1.2.1.  If the F4111 Date (trdj) are less than the prev transaction date and time, read 
next record.

4.1.2.1.  Determine if the document is included in Lot Tracking.  If Document Type is not 
found in the Lot Track & Trace Inclusion rules UDC Table, read next record.

4.1.2.2.  Assign TrackTraceClassification = 1st char of the F005 Description (40 DC).

4.1.2.3.  If TrackTraceClassification = 'I', read next record.

4.1.2.4.  If the PrevTransParentLot is not equal to blank and PrevTransParentLot (PLOT) is 

not equal to F4111 Lot Number (LOTN), read next record.

4.1.2.5.  If the PrevTransDocumentNumber is not equal to F4111 DocumentNumber, read next 

record.

4.1.2.6. If the PrevTranCreateDate and Time is greater than F4111 Create Date and 
Time, read next record.

4.1.2.7. IsCurrTransWOCompletion

If TrackTraceClassification is equal to 'M', IsCurrTransWOCompletion = '1' else = '0'.
4.1.2.8. IsCurrTransWOCompletion
If TrackTraceClassification is not equal to 'M', IsCurrTransWOCompletion = '1' else = 
'0'.

4.1.2.8. Is CurrTransWOIssue
If TrackTraceClassification is equal to 'I' , IsCurrTransWOIssue = '1' else '0'.
4.1.2.9.  Save the record in the work file (level = WK Level).  Set DS RecordsFound = '1'. 
Call Consolidate Records in WorkFile.

(normal next level)

4.2 If (DS Level = '1') or (DS Level not= '1' and PrevIsWOIssue = '0' and PrevTranParentLot 
not=blanks) or (DS Level not= '1' and PrevIsWOCompletion = '1'), search for next level by Lot 

Number, Item Number, and Branch.


4.2.1.  If DS Level is equal to '1', 
select from the Item Ledger Table (F4111)
whereLOTN=DS Lot Number

ITMDS Item Number

MCU=DS Branch

FRTO not='T'

 

If DS Level is not equal to '1' and PrevTransParentLot is not equal to blanks,
select from the Item Ledger Table (F4111)

where LOTN =PrevTransParentLot

ITMPrevTransParentItem

MCU=PrevTransParentBranch

FRTOnot='T'


If DS Level is not equal to '1' and PrevIsWOCompletion = '1', select from the Item 

Ledger 

Table (F4111)
whereLOTN=PrevTransLotNumber

ITM=Prev TransItemNumber

MCU=PrevTransBranch

FRTOnot='T'

4.2.2.  Fetch next record from selected records until fetch fails.
4.2.2.1.  If the F4111 Date and Time are less than the prev transaction date and time, read 
next record.

4.2.2.1.  Determine if the document is included in Lot Tracking.  If Document Type is not 

found in the Lot Track & Trace Inclusion rules UDC Table, read next record.

4.2.2.2.  Assign TrackTraceClassification = 1st char of the F005 Description 2.
4.2.2.3.  If TrackTraceClassification is equal to 'B' and F4111 ParentLot (PLOT) is equal 
to blanks, read next record.

4.2.2.4.  IsCurrTransWOCompletion.
If TrackTraceClassification is not equal to 'M', IsCurrTransWOCompletion = '1' else = 
'0'.

4.2.2.4.  IsCurrTransWOCompletion.
If TrackTraceClassification is equal to 'M', IsCurrTransWOCompletion = '1' else = 
'0'.

4.2.2.5.  IsCurrTransWOIssue
If TrackTraceClassification is equal to 'I', IsCurrTransWOIssue = '1' else = '0'.
4.2.2.6.  If IsCurrTransWOCompletion is equal to '1', read next record.
4.2.2.7.  Save the record in the Work File (Level = WK Level).  Set DS RecordsFound = '1'.
Call Consolidate Records in WorkFile.

5.0.  If DS RecordsFound = '1', add 1 to DS Level.


Consolidate Records in WorkFile


1.0.  If FRTO is equal to 'F', retrieve additional information from the 'T' transaction.

1.1.  The 'To' Transaction should be the transaction immediately following the 'From' Transation.  
This transaction can be fetched by adding 1 to the unique ID of the 'From' Transaction.  The 

following should be retrieved from the 'To' transaction and placed in the work file:  LOCN, PLOT, KIT, 

and MMCU.

2.0.  Determine if a matching record already exists in the work file.

2.1.  If the transaction is a WO completion, match using LEVEL, DCT, LOTN, ITM, MCU, DOC.
2.2.  If the transaction is an WO issue, match using LEVEL, DCT, LOTN, ITM, MCU, DOC.

2.3.  If the transaction is a 'From' transation, match using LEVEL, DCT, LOTN, ITM, MCU, LOCN, 

PLOT, KIT, MMCU.

2.4.  ELSE match using LEVEL, DCT, LOTN, ITM, MCU, PLOT, KIT, MMCU.

3.0.  If record does not exist, add the record to the work file.  Assign Multiple Records = '0'.

4.0.  If record exists, add TRQT to TRQT.  Assign MultipleRecords = '1'.

^

Data Structure

D3001590 - F4111GetNextLevelTracking

Parameter NameData ItemData TypeReq/OptI/O/Both
szLevelINDLcharNONENONE

A number indicating the level of a child in the relationship to its parent in a hierarchy.

mnJobNumberJOBSMATH_NUMERICNONENONE

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

cRecordsFoundEV01charNONENONE

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

cSuppressErrorMessagesEV01charNONENONE

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

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.

szComputerIDCTIDcharNONENONE

szLastLevelINDLcharNONENONE

A number indicating the level of a child in the relationship to its parent in a hierarchy.

mnShortItemNumberITMMATH_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

szLotLOTcharNONENONE

A lot is a quantity of items that you want to group together because they have similar characteristics.

szBranchMCUcharNONENONE

An alphanumeric code that identifies a separate entity within a business for which you want to track costs. For example, a business unit 
might be a warehouse location, job, project, work center, branch, or plant. You can assign a business unit to a document, entity, or person for 
purposes of responsibility reporting. For example, the system provides reports of open accounts payable and accounts receivable by 
business unit to track equipment by responsible department. Business unit security might prevent you from viewing information about business units 
for which you have no authority.

Related Functions

B3100710 Get Job Number
B9800100 Get Audit Information
X0005 Get User Defined Codes

Related Tables

F0101 Address Book Master
F30UI006 Lot Tracking Work File
F4108 Lot Master
F4111 Item Ledger File
F4111GetNextRecordTracking

F4111GetNextRecordTracking

F4111 Get Next Level Tracking

Major Business Rule

Object Name: B3001590

Parent DLL: CMFG

Location: Client/Server

Language: C

1.Functional Description

1.1Purpose
This function gets next row tracking from F4111.

1.2Setup Notes and Prerequisites



1.3Special Logic



2.Technical Specifications


2.4Processing 

1.0.  Retrieve first record from the Work file where level is equal to DS ComputerID, DS JobNumber, 
and DS Level.

use index:  Job Number, MachineKey, Level, Lot Number, Item Number, Branch, Create Date, Time of 
Day


1.0.  If a record is fetched successfully, set DS RecordRetrieved = '1'.


2.0.  If F4111 FromTo is equal to 'F', 

assign DS LotNumber = F30UI010 Parent Lot Number.

DS ItemNumber= F30UI010 Parent Item

DS Branch= F30UI010 Parent Branch

DS Transaction Qty = AbsoluteValue of F30UI010 Transaction Quantity

else
assign DS LotNumber= F30UI010 Lot Number

DS ItemNumber= F30UI010 Item Number

DS Branch= F30UI010 Branch

DS Transaction Qty= F30UI010 Transaction Quantity


4.0.  Assign DS Vendor = F30UI010 AN8.


5.0.  Retrieve Vendor Name from the Address Book Master Table (F0101) using  F30UI010 AN8.

returnAlpha DescriptionALPH


6.0.  If DuplicateLotsAllowed = '1', Fetch record from the Lot Master Table

where LOTN F30UI010 Lot Number

MCUF30UI010 Branch

ITMF30UI010 Item

return Lot Grade (LOTG), Lot Potency (LOTP), Supplier Lot (RLOT), and Vendor (VEND).


7.0.  If DuplicateLots are NOT allowed, Fetch record from the Lot Master Table

where LOTN=F30UI010 Lot Number

return Lot Grade (LOTG), Lot Potency (LOTP), Supplier Lot (RLOT), and Vendor (VEND).


8.0.  Move values to Data Structure.


9.0.  If F30UI010 Lot Number is equal to F30UI010 Parent Lot Number, and F30UI010 Item Number is 

equal to F30UI010 Parent Item Number, and F30UI010 Branch is equal to F30UI010 Parent Branch,  create 

another level in the work file.


9.1.  If DS Single Level is not equal to '1', 
9.1.1.  Delete the current record from the work file.
SV LotNumber = F30UI010 LotNumber
SV ItemNumber = F30UI010 ItemNumber

SV Branch = F30UI010 Branch.


9.1.2.  Add 1 to the level of remaining records in the work file where F30UI010 level = DS 
Level, F30UI010 Lot Number = SV LotNumber, F30UI010 Item Number = SV ItemNumber, F30UI Branch = SV 

Branch.


9.1.3.  DS Last Level = DS Level +1

9.2.  If DS Single Level is equal to '1',
  9.2.1.  Delete all remaining records from the work file.

10.0. If F30UI010 Lot Number is not equal to F30UI010 Parent Lot Number or F30UI010 Item Number 

is not equal to F30UI010 Parent Item Number or F30UI010 Branch is not equal to F30UI010 Parent 

Branch,


  If  DS Single Level is equal to '1', delete the current record from the work file.

^

Data Structure

D300159B - Get Next Record Tracking

Parameter NameData ItemData TypeReq/OptI/O/Both
szLevelINDLcharNONENONE

A number indicating the level of a child in the relationship to its parent in a hierarchy.

cSuppressErrorMessagesEV01charNONENONE

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

szLotNumberLOTNcharNONENONE

A number that identifies a lot or a serial number. A lot is a group of items with similar characteristics.

szBranchMCUcharNONENONE

An alphanumeric code that identifies a separate entity within a business for which you want to track costs. For example, a business unit 
might be a warehouse location, job, project, work center, branch, or plant. You can assign a business unit to a document, entity, or person for 
purposes of responsibility reporting. For example, the system provides reports of open accounts payable and accounts receivable by 
business unit to track equipment by responsible department. Business unit security might prevent you from viewing information about business units 
for which you have no authority.

mnItemNumberITMMATH_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

szParentLotPLOTcharNONENONE

An inventory separation device that allows tracking of the inventory by date received or similar convention to control lots or layers.

szParentBranchMMCUcharNONENONE

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.

mnParentItemNumberKITMATH_NUMERICNONENONE

The system provides for three separate item numbers.    1.   Item Number (short) - An eight-digit, computer assigned, completely 
non-significant item number.    2.   2nd Item Number - The 25-digit, free form, user defined alphanumeric item number.    3.   3rd Item Number - Another 
25-digit, free form, user defined alphanumeric item number.

szTransactionTypeDCTcharNONENONE

A user defined code (00/DT) that identifies the origin and purpose of the transaction.  PeopleSoft reserves several prefixes for document 
types, such as, vouchers, invoices, receipts, and timesheets. The reserved document type prefixes for codes are: P Accounts payable 
documents R Accounts receivable documents  T Time and Pay documents I Inventory documents  O Purchase order documents  S Sales order 
documents 

mnDocumentNumberDOCMATH_NUMERICNONENONE

A number that identifies the original document, such as a voucher, invoice, or journal entry. On entry forms, you can assign the document 
number or let the system assign it using the Next Numbers program (P0002). Matching document numbers (DOCM) identify related documents 
in the Accounts Receivable and Accounts Payable systems. Examples of original and matching documents are: Accounts Payable     o 
Original document - voucher     o Matching document - payment  Accounts Receivable     o Original document - invoice     o Matching document - 
receipt  Note: In the Accounts Receivable system, the following transactions simultaneously generate original and matching documents: 
deductions, unapplied receipts, chargebacks, and drafts.

szLotGradeLOTGcharNONENONE

A code that indicates the grade of a lot. The grade is used to indicate the quality of the lot. Examples include the following:    A1   Premium 
grade    A2   Secondary grade  The grade for a lot is stored in the Lot Master table (F4108).

mnLotPotencyLOTPMATH_NUMERICNONENONE

A code that indicates the potency of the lot expressed as a percentage of active or useful material (for example, the percentage of alcohol 
in a solution). The actual potency of a lot is defined in the Lot Master table (F4108).

mnTransactionQuantityTRQTMATH_NUMERICNONENONE

A value that represents the available quantity, which might consist of the on-hand balance minus commitments, reservations, and 
backorders. You enter this value in the Branch/Plant Constants program (P41001).

jdTransactionDateTRDJJDEDATENONENONE

The date that an order was entered into the system. This date determines which effective level the system uses for inventory pricing.

szExplanationTREXcharNONENONE

Text that identifies the reason that a transaction occurred.

szSupplierLotRLOTcharNONENONE

The supplier's lot number for the item.

mnSupplierVENDMATH_NUMERICNONENONE

The address book number of the preferred provider of this item.

cFromToFRTOcharNONENONE

A code that indicates whether a line in a transaction is a From line or a To line. This field allows you to combine multiple existing products or 
locations into a single product or location. For example, you can create three From lines and one To line. You can also split one existing 
product or location into several new products or locations. For example, you can create one From line and two To lines. The information that is 
contained in a From transaction line is always existing item location information.

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.

szLastLevelINDLcharNONENONE

A number indicating the level of a child in the relationship to its parent in a hierarchy.

cDuplicateLotsAllowedEV01charNONENONE

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

szComputerIDCTIDcharNONENONE

mnJobNumberJOBSMATH_NUMERICNONENONE

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

cRecordRetrievedEV01charNONENONE

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

szSupplierNameDSC1charNONENONE

Brief information about an item; a remark or an explanation.

cSingleLevelEV01charNONENONE

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

Related Functions

B3100710 Get Job Number
B9800100 Get Audit Information
X0005 Get User Defined Codes

Related Tables

F0101 Address Book Master
F30UI006 Lot Tracking Work File
F4108 Lot Master
F4111 Item Ledger File