F4111GetNextLevelTracing

F4111GetNextLevelTracing

Major Business Rule

Object Name: B3001600

Parent DLL: CMFGBASE

Location: Client/Server

Language: C

1.Functional Description

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

level link lists that have been built.


1.2Setup Notes and Prerequisites

• Required Work Fields
• EV01 - EndofTracing
• 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

1.3Special Logic

Required ER

FC Level = 0

FC EndofTracing = '0'

FC RecordsFound = '1'

FC Level (Integer) = '0'



If FC Mode is equal to '1'

BF F4111GetNextLevelTracing

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

        BF F4111GetNextRowTracing

        If FC RecordsRetrieved = '1'
            WriteCustomGridLine

        End

    EndWhile

Else

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

BF F4111GetNextLevelTracing
            If FC RecordsFound = '1'

                BF GetNextRecordTracing

                If FC RecordRetrieved = '1'
                    Write Custom Grid Line

                end

end
        EndWhile    

        FC RecordRetrieved = '0'

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

            BF GetNextRecordTracing

            If FC RecordRetrieved = '1'
                Write Custom Grid Line

            else

FC Level = FC Level - 1
            end

        Endwhile

        If FC Level <= 0

            FC EndofTracing = '1'

        else

            FC RecordsFound = '1'

        end

    EndWhile

End


2.Technical Specifications


2.4Processing 

Work Fields

WK Level
WK Prev Trans Unique Key Id

WK Prev Trans TrackTraceClassification

WK Prev Trans Parent Lot

WK Prev Trans Parent Item

WK Prev Trans Parent Branch

WK Prev Trans Item Number

WK Prev Trans Lot Number

WK Prev Trans Branch

WK Prev Trans Reference

WK Prev Trans Document

WK Prev Trans Doc Type

WK Prev Is WO Issue 

WK Prev Is WO Completion 

WK Prev Trans Date

WK Prev Trans Time


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


2.0.  If DS Level is greater than 1, retrieve first record from the F30UI006 Work file where F30UI006 

Level = DS Level.


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

WK Prev Trans Parent Lot

WK Prev Trans Parent Item

WK Prev Trans Parent Branch

WK Prev Trans Item Number

WK Prev Trans Lot Number

WK Prev Trans Branch

WK Prev Trans Reference

WK Prev Trans Document

WK Prev Trans Doc Type

WK Prev Is WO Issue 

WK Prev Is WO Completion 

WK Prev Trans Date

WK Prev Trans Time


2.2.  Delete this record from the F30UI006 Work File.

2.3.   If the Previous Transaction is a bottom level transaction, tracing will only continue if 
the transaction has a parent lot or the transaction is a WO issue.

If the WK PrevTransTrackTraceClassification = 'B', WK PrevTransParentLot is equal to blank, 

and WK PrevIsWOIssue = '0', exit program.


3.0.  If WK PrevTransLotNumber is equal to blank, exit program.


3.0.  If DS LastLevel > DS Level, 

Add 1 to DS Level 

If records at this level exist (fetch F30UI006 where F30UI006 Level = DS Level), assign DS 

RecordsFound = '1' 

EXIT this function.


4.0  Building the next Level.


(first level search for stranded Issues)

If the issue transactions do not contain the lot number of the product to which it is being issued, 
lot tracing cannot find the issue transactions.  This section will find those issue transactions by 

locating the completion transaction and tracing to the issue transaction.

4.0.If DS Level is equal to 1, search for WO Completion transactions.
4.0.1.Select from the Item Ledger Table (F4111).
Where LOTN=  DS ParentLot
ITM=DS ParentItem
MCU=DS ParentBranch

return:  LOTN, ITM, MCU, CRDJ, TDAY, PLOT, MMCU, KIT, DCT, DOCO, TREF, TREX...
4.0.2.  Fetch next F4111 record from selected records until fetch fails.
4.0.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.0.2.2.  Assign TrackTraceClassification = 1st char of the F0005 Description 2.
4.0.2.3.  IsCurrTransWOCompletion.
If TrackTraceClassification is equal to 'M', IsCurrTransWOCompletion = '1' else = 
'0'.

4.0.2.4.  IsCurrTransWOIssue
If TrackTraceClassification is equal to 'I', IsCurrTransWOIssue = '1' else = '0'.
4.0.2.5.If IsCurrTransWOCompletion is not equal to '1', read next record.
4.0.2.6.Locate Issue Transactions

Select from the Item Ledger Table (F4111).
Where DOC=F4111 Document Number

FRTOnot='T'

return:  LOTN, ITM, MCU, CRDJ, TDAY, PLOT, MMCU, KIT, DCT, DOCO, TREF, TREX...
4.0.2.6.1.  Fetch next F4111 record from selected records until fetch fails.
4.0.2.6.1.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.0.2.6.1.2.   Assign TrackTraceClassification = 1st char of the F0005 

Description (40 DC).

4.0.2.6.1.3.If TrackTaceClassification is equal to I, IsCurrTransWOIssue = 
'1' else '0'.

4.0.2.6.1.4.If TrackTraceClassification is equal to C, 

IsCurrTransWOCompletion = '1' else '0'.

4.0.2.6.1.5.If F4111 Lot Number (LOTN) is equal to blanks, read next record.

4.0.2.6.1.6.If TrackTraceClassification not= 'I', read next record.

4.0.2.6.1.7.If the F4111 Prarent Lot (PLOT) is not equal to blank, read next 

record

4.0.2.6.1.8.Save the record in the work file (leve = WK Level).  Set DS 

Records Found = 1.

Call Consolidate Records in WorkFile.

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

Issue transactions are located by using the document number of the WO Completion transaction.  The 
issue transaction and completion transaction will contain the same document number.

4.1.  If DS Level is greater than 1 and WK PrevIsWOCompletion = '1', search for next level by 
document number.

4.1.1.  Select from the Item Ledger Table (F4111) 
  where DOC WK PrevTransDocumentNumber, 
TREF 'WO' or 'RT', 
FRTO not = 'T'.

return:  LOTN, ITM, MCU, CRDJ, TDAY, PLOT, MMCU, KIT, DCT, DOCO, TREF, TREX...
4.1.1.  Select from the Item Ledger Table (F4111) 
  where DOC WK PrevTransDocumentNumber, 
FRTO not = 'T'.
return:  LOTN, ITM, MCU, CRDJ, TDAY, PLOT, MMCU, KIT, DCT, DOCO, TREF, TREX...
4.1.2.  Fetch next F4111 record from selected records until fetch fails.
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 F0005 Description (40 DC).

4.1.2.3.If TrackTraceClassification not= 'I', read next record.
4.1.2.4.  If the F4111 Parent Lot (PLOT) is not equal to blank and F4111 Parent Lot (PLOT) 
is not equal to WK PrevTransLotNumber (LOTN), read next record.

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

record.

4.1.2.6.  If the WK PrevTranCreateDate and Time is less than F4111 Create Date and Time, 

read next record.

4.1.2.6.  Save the record in the work file (level = WK Level).  Set DS RecordsFound = '1'. 

Call Consolidate Records in WorkFile.

(Completion transactions)

This search will locate WO Completion transactions when the previous transaction is a WO issue.  This 
will link multi-level completion transactions.




(normal next level)

This search will locate  WO Issues, Transfers, and Reclassification transactions which all contain a 
parent lot numbers. This can be the starting point of lot tracing. 

4.2.  If (DS Level = '1') or  (DS Level not= '1', WK PrevIsWOCompletion = '0', and WK 
PrevTransLotNumber not= blanks) , search for next level by ParentLot, Parent Item, and Parent Branch.

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

KITDS ParentItem

MMCU=DS ParentBranch

FRTO not='T'

 

If DS Level is not equal to '1' and PrevTransLotNumber is not equal to blanks,

select from the Item Ledger Table (F4111)

where PLOT =PrevTransLotNumber

KIT PrevTransItemNumber

MMCU=PrevTransBranch

FRTOnot='T'

4.2.2.  Fetch next F4111 record from selected records until fetch fails.
4.2.2.1.  If the F4111 Date and Time are greater than the WK Prev Trans Date and WK Prev 
Trans 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 F0005 Description 2.
4.2.2.3.  If TrackTraceClassification is equal to 'C', 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', IsCurrTransWOIss

Data Structure

D3001600A - F4111GetNextLevelTracing

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.

cSuppressErrorMessageEV01charNONENONE

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

idTracingLinkListGENLNGIDNONENONE

General purpose ID variable.

cRecordsFoundEV01charNONENONE

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.

szLastLevelINDLcharNONENONE

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

szComputerIdCTIDcharNONENONE

mnJobNumberJOBSMATH_NUMERICNONENONE

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

szParentLotPLOTcharNONENONE

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

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

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.

Related Functions

X0005 Get User Defined Codes

Related Tables

F4111 Item Ledger File
F4111GetNextRowTracing

F4111GetNextRowTracing

F4111GetNextLevelTracing

Major Business Rule

Object Name: B3001600

Parent DLL: CMFGBASE

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 F30UI006 Level is equal to DS Level.

use index2:  JobNumber, ComputerID, Level, Lot Number, Branch, Item Number, Create Date, Time of Day


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

assign DS LotNumber = F30UI006 Parent Lot Number.

DS ItemNumber= F30UI006 Parent Item

DS Branch= F30UI006 Parent Branch

DS Transaction Qty= AbsoluteValue of F30UI006 Transaction Quantity

else
assign DS LotNumber= F30UI006 Lot Number

DS ItemNumber= F30UI006 Item Number
DS Branch= F30UI006 Branch

DS Transaction Qty= F30UI006 Transaction Quantity


4.0.  Assign DS Vendor = F30UI006 AN8.


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

returnAlpha DescriptionALPH


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

where LOTN F30UI006 Lot Number

MCUF30UI006 Branch

ITMF30UI006 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 (F4108)

where LOTN=F30UI006 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 F30UI006 Lot Number is equal to F30UI006 Parent Lot Number, and F30UI006 Item Number is 

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

another level in the work file.


9.1.  If DS SingleLevel is NOT equal to '1'.
9.1.1.  Delete the current record from the work file.
SV LotNumber = F30UI006 LotNumber
SV ItemNumber = F30UI006 ItemNumber

SV Branch = F30UI006 Branch.


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

SV Branch.


9.1.3. DS Last Level = DS Level +1

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

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

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

Branch,


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

^

Data Structure

D3001600B - F411GetNextLevelTracing

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.

idLotTrackPointerGENLNGIDNONENONE

General purpose ID variable.

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

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

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

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.

szComputerIdCTIDcharNONENONE

mnJobNumberJOBSMATH_NUMERICNONENONE

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

cDuplicateLotsAllowedEV01charNONENONE

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

cFromToEV01charNONENONE

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

cSingleLevelEV01charNONENONE

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

szSupplierNameDSC1charNONENONE

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

cRecordRetievedEV01charNONENONE

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

Related Functions

X0005 Get User Defined Codes

Related Tables

F4111 Item Ledger File