cancel
Showing results for 
Search instead for 
Did you mean: 

FCC Message Mapping Problem

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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.

Former Member
0 Kudos

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

justin_santhanam
Active Contributor
0 Kudos

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.

Former Member
0 Kudos

Hi Raj,

Thanks you very much for all your help.

I just wanted to know whatever I am getting in my output payload is right or wrong.

1. outbound payload is nothing but inbound message, am I right ?

Because my outbout payload is different from what is mentioned in the weblog

Thanks,

Srini

justin_santhanam
Active Contributor
0 Kudos

Srini,

The Outbound Payload is nothing but Input File.

<i>Because my outbout payload is different from what is mentioned in the weblog</i>

Can you paste the sample ?

Best Regards,

raj.

Former Member
0 Kudos

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

justin_santhanam
Active Contributor
0 Kudos

Srini,

Yah its correct,the payload must look like the above u mentioned. In the blog you are looking Inbound payload(Output file). To get that o/p you have to do message mapping.

If you still have doubts to achieve it, reply back ..

Best Regards,

raj.

Former Member
0 Kudos

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

justin_santhanam
Active Contributor
0 Kudos

Srini,

<b>for(int j=0; j><vals.length; j++)</b>

change it as for(int j=0;j <b>less than</b> vals.length ; j++)

Replace <b>less than</b> by operator.

Best regards,

raj.

Message was edited by:

Raj

Former Member
0 Kudos

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

justin_santhanam
Active Contributor
0 Kudos

Srini,

The input parameter u are passing must have the name a , if you are following as per UDF, also it must be queue.[check the radio button as queue]

Best regards,

raj.

justin_santhanam
Active Contributor
0 Kudos

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.

Former Member
0 Kudos

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

justin_santhanam
Active Contributor
0 Kudos

Srini,

Source XML in the sense , u r looking the outbound payload in the SXMB_MONI right. If yes then no issues.

Map ITEMSET >Splitbyvalue[eachvalue]> ITEM .

Hope it solves the issue. If not mail me, sapient.xi@gmail.com

Best regards,

raj.

Former Member
0 Kudos

Thanks Raj, Just now I have sent the screen shots to you.

srini

justin_santhanam
Active Contributor
0 Kudos

Srini,

I have sent you mail, can you check it and get back to me asap.

Best regards,

raj.

Answers (1)

Answers (1)

justin_santhanam
Active Contributor
0 Kudos

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.

Former Member
0 Kudos

Thanks Raj for your reply, Update you on monday

Former Member
0 Kudos

Hi Raj,

I have made changes whatever you said, But no data is populated in the target file except the first 2 lines

<?xml version="1.0" encoding="UTF-8" ?>

<ns3:CG_OUTPUT_MT xmlns:ns3="http://unequalnoofcolumns.com" />

Pls help me out

Thanks,

srinivas

justin_santhanam
Active Contributor
0 Kudos

Srini,

Go to SXMB_MONI , and check the outbound payload, whether the Content conversion happened as described in the blog. Please let me know the results.

Best regards,

raj.

Former Member
0 Kudos

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

justin_santhanam
Active Contributor
0 Kudos

Srini,

<b><i> 1.Green Flaged Inbound Message (CENTRAL)</i></b>

If you expand the above selection you can see payload<b> MainDocument</b>

Check there.

Best regards,

raj.

Former Member
0 Kudos

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