on 08-19-2010 9:54 PM
Hi all,
I have requirement like this
File(xml) to Idoc Interface, i need to check the line item count and if it is greater than 999, i need to create second idoc for remaining line items
For EX:
XML file contains 1050 Line Items
I need to create 1 Idoc with 999 Line items and second Idoc with 51 Line Items
If i have the .TXT file means, i could split that record set per message option.
Please advice me in this...
Regards
Hi
Use the following UDF
For IDoc node mapping, item records will be input to UDF.
int count = a.length;
int b=999;
result.addValue("");
for(int i=0;i<count;i++)
{
if (i>=b){
result.addValue(""); // if records > 999, add IDoc node
b=b+999;
}
}
Complete the rest of the mapping .
Regards
Abhijit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Heloo,
Thanks for all replies. I have to check for another condition too
I need to create Idocs based on the company code change & that particular company code reached 999 lineitems then create another Idoc for that.
EX:
I have 1500 Line Items in file
1050 Items are related to Company Code "1100"
remaining 450 related to company code "1200"
For this i need to create idocs like this
one idoc with 999 line items which will contain 1100 company code
second idoc with 51 line items which will contain 1100 company code
Third Idoc with 450 line items which contain 1200 company code
To create separate idoc when company code is changed like this
company code--sort-Split By Value(Value Change)--Collapse ContextIdoc Segment(099999)
Please let me know how to satisfy both the conditions
Regards
Closing this thread as my requirement changed
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vamsi,
As you said, If the file received is TXT. Count can be handled through Content Conversion on the sender side using File communication Channel.
Let's talk about if the file received by PI is an xml, The scenario can be completed using java mapping. As we have the full control over the target and source xml.
Thanks,
Kiran.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
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.