on 01-25-2011 1:47 PM
My source data looks like below,I want to created IDoc based on OrderNum
<Order> 1..unbounded
<CustomerID>
<MaterialID>
<OrderNum>
</Order>
Suppose in my source data I have OrderNum then only IDoc to be created , if I have multiple orders then I have to sort based on CustomerID, the records which have same cutomer ID to send as a one Idoc, and reaming IDoc which have different CustdID send a one more IDoc.
<Order>
<CustomerID>234</CustomerID>
<MaterialID>12345</MaterialID>
<OderNum>400</OrderNum>
</Order>
<Order>
<CustomerID>111</CustomerID>
<MaterialID>12345</MaterialID>
</Order>
<Order>
<CustomerID>235</CustomerID>
<MaterialID>12345</MaterialID>
<OderNum>400</OrderNum>
</Order>
For aboive output I want to individual IDocu2019s.
I changed IDoc occurance to 1 to unbounded, trying different ways in mapping, but runninbg without Luck
Hi ,
If I understood correctly, as per your requirement you want to create one IDoc per source Order node , if the Order structure is having the order number. This can be achieved by mapping the root IDoc node with createif function .
Ordernum -> exists-- >
and -
> createif ---> IDoc
ordernum->length-> greater
constant [0]
I think you also need to use the multiple IDoc at target side as you are receiving multiple Orders in the source.
use the XSD of the IDoc by extending the occurrence as 0..unbounded. If this is the case then you have to use node function remove context first to get the total number of ordernumber in the entire message then write a UDF where you will pass the length and using a for loop
for (int p=0;p<k;p++)
{
result.addValue(str[p]);
}
here k is the length of the ordernum queue.
you can generate the target IDoc node. Remember to handle the suppress values in the input queue for Ordernumber.
after this do a sort and splitbyValue [valuechange for the customer ID]
Hope it should work.
Thanks
Sugata
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
As far as I know, sorting and filtering can be done easily using XSLT mapping than graphical mapping.
Regards,
Raghu_Vamsee
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.