GetPeggingChildParentNode

Get Pegging Child Parent Structure

Major Business Rule

Object Name: B3400350

Parent DLL: CMFG

Location: Client/Server

Language: C

1.Functional Description
This function is used to build a linked list of the child/parent Item hierarchy for a given Component 
Item and Branch from the Pegging table (F3412).  After the original list is built, the function 

assigns a level number to each node in the list.  The function should be called multiple times for a given 

component so that the function can determine if additional branches exist in the tree due to a node in 

the list having multiple parents.  On subsequent calls, the function will recurse through all 

branches of the child/parent tree and update the list for each branch.  New child/parent level values are 

assigned each time the list is modified.


1.1Purpose
The purpose of this function is to build a linked list of each child/parent hierarchy path for a 
given Component Item and Branch from the Lower Level Requirements table (F3412).  As each path is 

traversed and stored in a linked list, the function assigns level values to each record.  The calling 

application can use GetPeggingChildParentNode to retrieve the records sequentially from the list built by this 

function.


1.2Setup Notes and Prerequisites

• Initially, this function should be called with the Pass parameter = '1'.  After the initial 
child/parent linked list is returned, the function should be called again with Pass = '2' until the function 

returns End Of Parent Search = '1'.  This signals that all child/parent branches for this Component 

have been traversed and returned.

• The calling application must call the business function FreeHUserAndHRequest (C4102A1) to release 
the User handle allocated by the function.


1.3Special Logic

This function will not trace a child/parent branch past the 25th level.  Therefore, the linked list 
will contain a maximum of 25 nodes.


2.Technical Specifications

Wk Linked List = Linked List Ptr
End Of Records = '0'

If Wk Linked List <> NULL

If Pass = '1'

Wk Node = the first node in the list

Pass = '2'

Else

Wk Node = the next node in the list

EndIf

Create a string for the level value saved in Wk Node.  Look at Indent Level Flag to determine 

how to format the level string.

Copy the Pegging record values from Wk Node to the output fields

If List Current Node Ptr = the last node in the list

End Of Records = '1'

EndIf

EndIf




^

Data Structure

D3400350 - Get Pegging Child Parent Structure

Data Item Data Structure DescriptionI/ORequiredNotes
ITM            Short Item Number                  I/OY

MCU            Business Unit                  IY

KIT            Parent Item Number            I/OY

EV01            Indent Level Flag                  I

EV01            Pass                              I/OY      '1' = Build a new list for 

the given                                                                         component '2' = Use 

the existing list                                                                         and check for 

different branches

GENLNG      hUser Pointer                  I/OY

GENLNG      Linked List Ptr                  I/OY

EV03            Suppress Error Messages            I      '1' = Suppress run time error 

message                                                                                               

                                                  handling '0' = Allow run time error                 

                                                        message handling

INDL            Level                              O      Level value as string

EV02            End Of Parent Search            O      '1' = End of the child/parent 

search                                                                         reached '0' = Continue 

checking                                                                         child/parent 

hierarchy

EV03            End Of Records                  O

DTAI            Error Message ID                  O


^

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

szBusinessUnitMCUcharNONENONE

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.

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.

cIndentLevelFlagEV01charNONENONE

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

cPassEV01charNONENONE

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

idhUserPtrGENLNGIDNONENONE

General purpose ID variable.

idLinkedListPtrGENLNGIDNONENONE

General purpose ID variable.

cSuppressErrorMessagesEV03charNONENONE

A radio button that specifies the level at which trace/track result is to be displayed.  Select the Detail to display all transactions except IB, IX, 
and IZ types.  Or, select Derivative Lots Only to display only those transactions that may have created new derivative lot. 

szLevelINDLcharNONENONE

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

cEndOfParentSearchEV02charNONENONE

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

cEndOfRecordsEV04charNONENONE

PeopleSoft event point processing flag 04.

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.

Related Functions

None

Related Tables

None
GetPeggingChildParentVertical

GetPeggingChildParentVertical

Get Pegging Child Parent Structure

Major Business Rule

Object Name: B3400350

Parent DLL: CMFG

Location: Client/Server

Language: C

1.Functional Description
This function is used to build a linked list of the child/parent Item hierarchy for a given Component 
Item and Branch from the Pegging table (F3412).  After the original list is built, the function 

assigns a level number to each node in the list.  The function should be called multiple times for a given 

component so that the function can determine if additional branches exist in the tree due to a node in 

the list having multiple parents.  On subsequent calls, the function will recurse through all 

branches of the child/parent tree and update the list for each branch.  New child/parent level values are 

assigned each time the list is modified.


1.1Purpose
The purpose of this function is to build a linked list of each child/parent hierarchy path for a 
given Component Item and Branch from the Lower Level Requirements table (F3412).  As each path is 

traversed and stored in a linked list, the function assigns level values to each record.  The calling 

application can use GetPeggingChildParentNode to retrieve the records sequentially from the list built by this 

function.


1.2Setup Notes and Prerequisites

• Initially, this function should be called with the Pass parameter = '1'.  After the initial 
child/parent linked list is returned, the function should be called again with Pass = '2' until the function 

returns End Of Parent Search = '1'.  This signals that all child/parent branches for this Component 

have been traversed and returned.

• The calling application must call the business function FreeHUserAndHRequest (C4102A1) to release 
the User handle allocated by the function.


1.3Special Logic

This function will not trace a child/parent branch past the 25th level.  Therefore, the linked list 
will contain a maximum of 25 nodes.


2.Technical Specifications

Wk Linked List = Linked List Ptr
End Of Records = '0'

If Wk Linked List <> NULL

If Pass = '1'

Wk Node = the first node in the list

Pass = '2'

Else

Wk Node = the next node in the list

EndIf

Create a string for the level value saved in Wk Node.  Look at Indent Level Flag to determine 

how to format the level string.

Copy the Pegging record values from Wk Node to the output fields

If List Current Node Ptr = the last node in the list

End Of Records = '1'

EndIf

EndIf





^

Data Structure

D3400350 - Get Pegging Child Parent Structure

Data Item Data Structure DescriptionI/ORequiredNotes
ITM            Short Item Number                  I/OY

MCU            Business Unit                  IY

KIT            Parent Item Number            I/OY

EV01            Indent Level Flag                  I

EV01            Pass                              I/OY      '1' = Build a new list for 

the given                                                                         component '2' = Use 

the existing list                                                                         and check for 

different branches

GENLNG      hUser Pointer                  I/OY

GENLNG      Linked List Ptr                  I/OY

EV03            Suppress Error Messages            I      '1' = Suppress run time error 

message                                                                                               

                                                  handling '0' = Allow run time error                 

                                                        message handling

INDL            Level                              O      Level value as string

EV02            End Of Parent Search            O      '1' = End of the child/parent 

search                                                                         reached '0' = Continue 

checking                                                                         child/parent 

hierarchy

EV03            End Of Records                  O

DTAI            Error Message ID                  O


^

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

szBusinessUnitMCUcharNONENONE

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.

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.

cIndentLevelFlagEV01charNONENONE

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

cPassEV01charNONENONE

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

idhUserPtrGENLNGIDNONENONE

General purpose ID variable.

idLinkedListPtrGENLNGIDNONENONE

General purpose ID variable.

cSuppressErrorMessagesEV03charNONENONE

A radio button that specifies the level at which trace/track result is to be displayed.  Select the Detail to display all transactions except IB, IX, 
and IZ types.  Or, select Derivative Lots Only to display only those transactions that may have created new derivative lot. 

szLevelINDLcharNONENONE

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

cEndOfParentSearchEV02charNONENONE

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

cEndOfRecordsEV04charNONENONE

PeopleSoft event point processing flag 04.

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.

Related Functions

None

Related Tables

None