Quantcast
Channel: SCN : Unanswered Discussions - Process Integration (PI) & SOA Middleware
Viewing all articles
Browse latest Browse all 6719

Need help to create an UDF to group PO numbers based upon Group Code then match each of the PO number of that Group with ElementNumber and take the output whose sequence number is minimun.

$
0
0

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,


Viewing all articles
Browse latest Browse all 6719

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>