on 11-21-2013 9:16 PM
Hi Experts,
Since the source and target structure is huge and have many nested loops I would try to make it simple with a sketch below and an example as well.
----PO.......................1-n
-----Header..................1-1
-----OrderLinkage............1-1
--------ChainSegment.........0-n
-----------SeqNo.............0-1
-----------ElementNo.........0-1
-----------DocType...........0-1
-----Item....................0-n
-------Groupcode.............0-1
-------PONo..................0-1
Suppose 4 POs are coming with n number of Items in it, I have to group all the "PONo" that belong to a particular "GroupCode".
Then I have to match each of the PO numbers of one particular Group with "ElementNo" of each "ChainSegment" and extract that particular "ElementNo" whose "SeqNo" is minimum.
The "ElementNo" under "ChainSegment" also contains similar values as that of "PONo".
Example:
"GroupCode" G1 has 3 POs 10001, 10002, 10003
"GroupCode" G2 has 2 POs 20001, 20001, 20003
Now Chain Segment look like below for one PO
<ChainSegment/>
<SeqNo>00000001<SeqNo/>
<ElementNo>10003<ElementNo/>
<DocType>ABC<DocType/>
<ChainSegment/>
<SeqNo>00000002<SeqNo/>
<ElementNo>10005<ElementNo/>
<DocType>EFG<DocType/>
<ChainSegment/>
<SeqNo>00000003<SeqNo/>
<ElementNo>10001<ElementNo/>
<DocType>HIJ<DocType/>
Out of three POs of G1, 10001 and 10003 matches with the "ElementNo" of the chain segment. But the "SeqNo" of 10001 is 00000003 where as "SeqNo" of 10003 is 00000001. So we will consider 10003 as our output as the corresponding "SeqNo" of that "ElementNo" is minimum.
I tried doing it with a test data having 4 POs and these are the three queues that I have right now.
1st one is list of all POs based upon group.
2nd one has all the ElementNo for each ChainSegmqnt(5 chain segment in each of the 4 PO)
3rd one has all the SeqNo for each ElementNo
Please help me out
Thanks,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Mark for your reply.
But this is not what I need actually.
The grouping part is already done. Now I have the list of PO's that come under each of the group as given in the first screenshot.
I have to compare these PO's(from each group) with ElementNo, and get that particular ElementNo which is having the least SeqNo.
For example....
I have group G1 in which PO numbers present are 10001,10002,10003,10004, 10005, 10006,
once I compare these PO numbers with the ElementNo, lets suppose I have a match found for 10004 and 10006. Now I have to check which of these PO's (10004, 10006) have a least SeqNo. This might happen that the Seq No for 10004 is 5 and the SeqNo for 10006 is 3, so we will consider that PO with number as 10006 as that is having lower SeqNo than that of 10004.
I want to fetch the matching PO based upon the least SeqNo using UDF itself.
Please let me know if I am not clear enough.
Thanks,
Subhrapratim
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.