on 11-22-2005 10:10 AM
Can anyone help me to do the following mapping:
Example:
From Array of strings
1234
test
ok
to 1 String
1234testok
it is the opposite of forum
I have some issues with the GlobalContainer in the java function. I see the result but anyhow he posts only the first value.
My function:
MappingTrace importanttrace;
importanttrace = container.getTrace();
importanttrace.addWarning("The value of incoming Pos :" + a + " text_line: " + b);
GlobalContainer gc = container.getGlobalContainer();
String totaltext = "";
String textmsg;
Object obj=gc.getParameter("TextMsg");
if (obj==null) textmsg = "";
else textmsg = (String)obj;
importanttrace.addWarning("The value of the textmsg is:" + textmsg);
totaltext = textmsg.concat(b);
importanttrace.addWarning("The value of the totaltext is:" + totaltext);
gc.setParameter("TextMsg", totaltext);
return totaltext;
the result in the test environment looks like:
Kompilierung von Mapping war erfolgreich.
Warning:The value of incoming Pos :01 text_line: 1234
Warning:The value of the textmsg is:
Warning:The value of the totaltext is:1234
Warning:The value of incoming Pos :02 text_line: TEST
Warning:The value of the textmsg is:1234
Warning:The value of the totaltext is:1234TEST
Warning:The value of incoming Pos :03 text_line: ok
Warning:The value of the textmsg is:1234TEST
Warning:The value of the totaltext is:1234TESTok
Ausführung war erfolgreich.
Thanks in advance for any idea.
Mike
Hi Michal,
thanks for the fast response but if i try your code i got an error
Quellcode hat Syntaxfehler:
301: concat(java.lang.String) in java.lang.String cannot be applied to (java.lang.String[])
totalValue = totalValue.concat(a);
^
1 error
sorry i am not the java geeky guy
what is wrong?
Thanks
Mike
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Michal,
it is working now
many thanks to you ...
also you did a lot of very good stuff here in this sdn area ... i really appreciate this ...
Mike
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
String totalValue = "";
for (int i = 0 ; i<a.length ; i++)
{
totalValue = totalValue.concat(a\i\);
}
result.addValue(totalValue);
gives the following error
13:40:06 Start of test
Source code has syntax error: F:/usr/sap/XID/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Mapa360eb2015d811dd8a1d001a4ba8d346/source/com/sap/xi/tf/_PM_CS_UpdateEquipmentsInGIS_MM_.java:106: illegal character: \92 totalValue = totalValue.concat(a\i\); ^ F:/usr/sap/XID/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Mapa360eb2015d811dd8a1d001a4ba8d346/source/com/sap/xi/tf/_PM_CS_UpdateEquipmentsInGIS_MM_.java:106: illegal character: \92 totalValue = totalValue.concat(a\i\); ^ 2 errors Source code has syntax error: F:/usr/sap/XID/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Mapa360eb2015d811dd8a1d001a4ba8d346/source/com/sap/xi/tf/_PM_CS_UpdateEquipmentsInGIS_MM_.java:106: illegal character: \92 totalValue = totalValue.concat(a\i\); ^ F:/usr/sap/XID/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Mapa360eb2015d811dd8a1d001a4ba8d346/source/com/sap/xi/tf/_PM_CS_UpdateEquipmentsInGIS_MM_.java:106: illegal character: \92 totalValue = totalValue.concat(a\i\); ^ 2 errors
13:40:07 End of test
any1 knows ?
thx Shai
wrong interpretation....sorry!!
Message was edited by: Priyanka Balagangadharan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mike,
do the removeContext (from node functions)
and then use this function (with queue)
String totalValue = "";
for (int i = 0 ; i<a.length ; i++)
{
totalValue = totalValue.concat(a<i>);
}
result.addValue(totalValue);
the result will only be one field - remember
then inside the totalValue you'll have the whole string
which you cna use later on somewhere
Regards,
michal
Message was edited by: Michal Krawczyk
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Are you maaping 3 elements from input node of source message type to one element in the output node of destnation message type.
Thanks
Abinash
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have something like
<in>
<textbox>
<TEXT_ID>01</TEXT_ID>
<TEXT_LINE>1234</TEXT_LINE>
<textbox>
<textbox>
<TEXT_ID>02</TEXT_ID>
<TEXT_LINE>Test</TEXT_LINE>
<textbox>
<textbox>
<TEXT_ID>03</TEXT_ID>
<TEXT_LINE>ok</TEXT_LINE>
<textbox>
</in>
which should be mapped to
<out>
<Description>1234Testok</Description>
</out>
but it could be n-textbox but only one destination field.
Thanks
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.