Routine Search a component in a bill of material list

10 pts.
Tags:
AS/400
Hi all, I have requirement to search all the end items that a given component has in a Bill of Material with the required quantity at each level in the bill and its cumulative requires quantity as the search progresses from level to level. In other words. Component Z can go to parent Y which in turn go to parent X and which in turn ends at parent W. So my final end parent is W. I need a way to search component Z through the entire bill. Appreciate help. Sk
ASKED: March 5, 2008  2:48 AM
UPDATED: March 5, 2008  3:48 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.

To drill into nested levels, it is easlest to use recursion.

One solution:
- Write one program to process the initial product list, Prog1. For each product in the list, call Prog2.
- Write a simple program, Prog2, to do the work for one level of the bill of materials.
- In Prog2, when a parent is found, call Prog2 again to do the work for that level.
- Pass the product in and the quantity out as parms.
- On the program H-spec, use DftActGrp(*no) ActGrp(*new).
- Set on *INLR when exiting Prog2 so that file-opens will be cleaned up.

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following