on 2007 Jun 01 6:41 PM
Hi,
I am doing the following scenario according to Sravya's comments
/people/jeyakumar.muthu2/blog/2005/11/29/file-content-conversion-for-unequal-number-of-columns
Though the file is picked and reached the target
Sender file contains the following data as shown in the weblog:
Books,CD,Video,Games
CD,Games,DVD
DVD,CD,Video,Games,Books
Books
CD,DVD
But after conversion the target file contains only
-
<?xml version="1.0" encoding="UTF-8" ?>
<ns3:CG_OUTPUT_MT xmlns:ns3="http://unequalnoofcolumns.com" />
-
In Adapter Framework , I am getting this error
Initialization error: Conversion initialization failed with java.lang.Exception: java.lang.Exception: java.lang.Exception: Error(s) in XML conversion parameters found:
Format error in 'xml.recordset' argument: incomplete structure (name,number) pair
It does not contain any data
why the target file does not contain any data ?
Thanks,
ss
Message was edited by:
srinivas
Hi Shrinivas,
try using this UDF instead of that given in blog:
for(int i = 0 ; i < a.length ; i++)
{
String[] vals = a<b>[</b>i<b>]</b>.split( "," );
for(int j = 0 ; j < vals.length ; j++)
{
result.addValue(vals[j]);
}
result.addContextChange();
}
Thanks,
Maheshwari.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Maheshwari
Thank you for the code. I will do using this code and update you.
In addition to that I am just wondering about the empty target file when trying to do the way Sravya has instructed.
I dont know why the data not getting populated in the target file.
Any input is highly appreciated
Thanks
Srini
Srini,
You can get the result as per Maheshwari coding, but there is light modification.
Don't give the <b>result.addContextChange()</b>. As per the blog(without context change)
Give the <b>result.addContextChange()</b>, .As per Sravya's discussion, if you change the context.
Best Regards,
raj.
Thanks Raj
my outbound payload is
<?xml version="1.0" encoding="utf-8" ?>
- <ns:CG_INPUT_MT xmlns:ns="http://unequalnoofcolumns.com">
- <details>
- <TOTALSET>
<ITEMSET>Books,CD,Video,Games</ITEMSET>
</TOTALSET>
- <TOTALSET>
<ITEMSET>CD,Games,DVD</ITEMSET>
</TOTALSET>
- <TOTALSET>
<ITEMSET>DVD,CD,Video,Games,Books</ITEMSET>
</TOTALSET>
- <TOTALSET>
<ITEMSET>Books</ITEMSET>
</TOTALSET>
- <TOTALSET>
<ITEMSET>CD,DVD</ITEMSET>
</TOTALSET>
</details>
</ns:CG_INPUT_MT>
Do you think any changes I need to do in message mapping ?
Thanks
Srini
Hi
I have used your code as a simple function with one argument. But I am getting the following error when I check using F7 in message mapping
<b><u>Code:</u></b>
for(int i=0;i<a.length;i++)
{
String[]vals=a<i>.split( "," );
for(int j=0; j<vals.length; j++)
{
result.addValue(vals[j]);
}
result.addContextChange();
}
<u><b>Error</b></u>
Check Result for Object CG_MM Source code has syntax error:
C:/usr/sap/SXI/DVEBMGS01/j2ee/cluster/server0/./temp/classpath_resolver/Map28531c80abb411dba784001676478b29/source/com/sap/xi/tf/_CG_MM_.java:26: cannot resolve symbol symbol : variable length location: class java.lang.String for(int i=0;i<a.length;i++)
^
C:/usr/sap/SXI/DVEBMGS01/j2ee/cluster/server0/./temp/classpath_resolver/Map28531c80abb411dba784001676478b29/source/com/sap/xi/tf/_CG_MM_.java:28: array required, but java.lang.String found String[]vals=a<i>.split( "," );
^
C:/usr/sap/SXI/DVEBMGS01/j2ee/cluster/server0/./temp/classpath_resolver/Map28531c80abb411dba784001676478b29/source/com/sap/xi/tf/_CG_MM_.java:32: cannot resolve symbol symbol : variable result location: class com.sap.xi.tf._CG_MM_ result.addValue(vals[j]);
^
C:/usr/sap/SXI/DVEBMGS01/j2ee/cluster/server0/./temp/classpath_resolver/Map28531c80abb411dba784001676478b29/source/com/sap/xi/tf/_CG_MM_.java:34: cannot resolve symbol symbol : variable result location: class com.sap.xi.tf._CG_MM_ result.addContextChange();
^
4 errors
Anything that I have to change in the source code ?
Thanks,
srini
Raj,
I have done according to your instructions but am getting the errors
Error
-
Check Result for Object CG_MM Source code has syntax error:
C:/usr/sap/SXI/DVEBMGS01/j2ee/cluster/server0/./temp/classpath_resolver/Map15e9b9a1abb911db807f001676478b29/source/com/sap/xi/tf/_CG_MM_.java:26: cannot resolve symbol symbol : variable length location: class java.lang.String for(int i=0;i<a.length;i++)
^
C:/usr/sap/SXI/DVEBMGS01/j2ee/cluster/server0/./temp/classpath_resolver/Map15e9b9a1abb911db807f001676478b29/source/com/sap/xi/tf/_CG_MM_.java:28: array required, but java.lang.String found String[]vals=a<i>.split( "," );
^ C:/usr/sap/SXI/DVEBMGS01/j2ee/cluster/server0/./temp/classpath_resolver/Map15e9b9a1abb911db807f001676478b29/source/com/sap/xi/tf/_CG_MM_.java:32: cannot resolve symbol symbol : variable result location: class com.sap.xi.tf._CG_MM_ result.addValue(vals[j]);
^
C:/usr/sap/SXI/DVEBMGS01/j2ee/cluster/server0/./temp/classpath_resolver/Map15e9b9a1abb911db807f001676478b29/source/com/sap/xi/tf/_CG_MM_.java:34: cannot resolve symbol symbol : variable result location: class com.sap.xi.tf._CG_MM_ result.addContextChange();
^
4 errors
---srini
Message was edited by:
srinivas
Srini,
After content conversion, your file looks like below am i right?
<?xml version="1.0" encoding="utf-8" ?>
- <ns:CG_INPUT_MT xmlns:ns="http://unequalnoofcolumns.com">
- <details>
- <TOTALSET>
<ITEMSET>Books,CD,Video,Games</ITEMSET>
</TOTALSET>
- <TOTALSET>
<ITEMSET>CD,Games,DVD</ITEMSET>
</TOTALSET>
- <TOTALSET>
<ITEMSET>DVD,CD,Video,Games,Books</ITEMSET>
</TOTALSET>
- <TOTALSET>
<ITEMSET>Books</ITEMSET>
</TOTALSET>
- <TOTALSET>
<ITEMSET>CD,DVD</ITEMSET>
</TOTALSET>
</details>
</ns:CG_INPUT_MT>
So create a UDF with input argument name as <b>a</b> and choose queue.
Define mapping as ITEMSET --> UDF --->ITEM
you will get the o/p as
<ITEMSET>
<ITEM>Books</ITEM>
<ITEM>CD</ITEM>
<ITEM>Video</ITEM>
<ITEM>Games</ITEM>
</ITEMSET>
.....
.....
.....
.....
.....
If you have any doubt revert back.
Best regards,
raj.
Hi Raj,
Thanks for the corrections. Now I dont have any source code error. But.....
<u><b>Source xml</b></u>
<?xml version="1.0" encoding="UTF-8"?>
<ns3:CG_INPUT_MT xmlns:ns3="http://unequalnoofcolumns.com">
<TOTALSET>
<ITEMSET>Books</ITEMSET>
<ITEMSET>CD</ITEMSET>
<ITEMSET>Video</ITEMSET>
<ITEMSET>Games</ITEMSET>
</TOTALSET>
<TOTALSET>
<ITEMSET>CD</ITEMSET>
<ITEMSET>Games</ITEMSET>
<ITEMSET>DVD</ITEMSET>
</TOTALSET>
<TOTALSET>
<ITEMSET>DVD</ITEMSET>
<ITEMSET>CD</ITEMSET>
<ITEMSET>Video</ITEMSET>
<ITEMSET>Games</ITEMSET>
<ITEMSET>Books</ITEMSET>
</TOTALSET>
<TOTALSET>
<ITEMSET>Books</ITEMSET>
</TOTALSET>
<TOTALSET>
<ITEMSET>CD</ITEMSET>
<ITEMSET>DVD</ITEMSET>
</TOTALSET>
</ns3:CG_INPUT_MT>
After Mapping
<u><b>Target xml</b></u>
<?xml version="1.0" encoding="UTF-8"?>
<ns3:CG_OUTPUT_MT xmlns:ns3="http://unequalnoofcolumns.com">
<ITEMSET>
<ITEM>Books</ITEM>
</ITEMSET>
<ITEMSET>
<ITEM>CD</ITEM>
</ITEMSET>
<ITEMSET>
<ITEM>Video</ITEM>
</ITEMSET>
<ITEMSET>
<ITEM>Games</ITEM>
</ITEMSET>
<ITEMSET>
<ITEM>CD</ITEM>
</ITEMSET>
</ns3:CG_OUTPUT_MT>
But I am not getting what you have mentioned in your reply. If you can give me your mail ID I will send you the screen shots.
Thanks,
srini
Srinivas,
I have seen the weblog. Try to change the following conversion parameters and try . Reply back your results.
Instead of TOTALSET.fielSeparator, give
<b>TOTALSET.endSeparator as 'nl'</b> and
<b>ITEMSET.fieldSeparator as ,</b>
Best Regards,
raj.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Raj for your Reply
In SXMB_MONI status is processed successfully.
<b>In Display XML Message Versions</b>
Under XML Message Msg ID = B8C9B0AA........
I have
1.Green Flaged Inbound Message (CENTRAL)
2.Receiver Grouping
3.Checked Flag Response
You mean to say 3rd option (i.e. Checked Flag Response)payloads' mainDocument (application/xml) right side panel above or below ?
Thank you very much
Srinivas
Hi Raj,
I am getting the following in my outbound payload. But this is different from what is mentioned in the weblog.
<?xml version="1.0" encoding="utf-8" ?>
- <ns:CG_INPUT_MT xmlns:ns="http://unequalnoofcolumns.com">
- <details>
- <TOTALSET>
<ITEMSET>Books,CD,Video,Games</ITEMSET>
</TOTALSET>
- <TOTALSET>
<ITEMSET>CD,Games,DVD</ITEMSET>
</TOTALSET>
- <TOTALSET>
<ITEMSET>DVD,CD,Video,Games,Books</ITEMSET>
</TOTALSET>
- <TOTALSET>
<ITEMSET>Books</ITEMSET>
</TOTALSET>
- <TOTALSET>
<ITEMSET>CD,DVD</ITEMSET>
</TOTALSET>
</details>
</ns:CG_INPUT_MT>
weblogis /people/jeyakumar.muthu2/blog/2005/11/29/file-content-conversion-for-unequal-number-of-columns
Thanks,
Srinivas
User | Count |
---|---|
67 | |
10 | |
10 | |
10 | |
10 | |
8 | |
8 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.