on 01-10-2007 12:49 PM
Dear All,
I have a message mapping with the structures:
Souce:
<ns2:DadosMsg><cUF>SP</cUF><ano>2006</ano></ns2:DadosMsg>
Target:
<cUF>SP</cUF>
<ano>2006</ano>
I have to move the values between the tags <cUF> <ano> from the source structure that is one line only to the target structure that will be independent fields.
How can I do this?
Best Regards,
Fernando
You can do this with following simple UDF with the parameters <i>source</i> and <i>tag</i>:
int start = source.indexOf("<" + tag) + tag.length() + 2;
int end = source.indexOf("</" + tag);
if ((start > 0) && (end > start))
return source.substring(start, end);
else
return "";
As source you apply the string, as tag the constants cUF or ano.
Regards
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
<cUF>SP</cUF><ano>2006</ano>
and
<cUF>SP</cUF>
<ano>2006</ano>
are identical. 'nl' is considered as whitespace and omitted from the graphical mapping tool.
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
The structures are not identical because the souce has only a element with the all XML information and the target has a lot of elements.
Souce:
<ns2:DadosMsg><cUF>SP</cUF><ano>2006</ano></ns2:DadosMsg>
Target:
<cUF>SP</cUF>
<ano>2006</ano>
I want to select on a information between the tag <cUF> from the element <ns2:DadosMsg> 'SP' and move to the element cUF from the target structure.
How can I make this mapping?
Thaks,
Fernando
P.S. Both structures are external definitions.
Hi,
The structures are not identical because the souce has only a element with the all XML information and the target has a lot of elements.
Souce:
<ns2:DadosMsg><cUF>SP</cUF><ano>2006</ano></ns2:DadosMsg>
Target:
<cUF>SP</cUF>
<ano>2006</ano>
I want to select on a information between the tag <cUF> from the element <ns2:DadosMsg> 'SP' and move to the element cUF from the target structure.
How can I make this mapping?
Thaks,
Fernando
P.S. Both structures are external definitions.
Hi,
Is you soruce datatype like this,
<ns2:DadosMsg>XXXX</ns2:DadosMsg>
if yes, and if your data is going to be,
<ns2:DadosMsg><cUF>SP</cUF><ano>2006</ano></ns2:DadosMsg>
then , Graphical mappping will error out as your Source XML schema / XSD will not match with your input!
In this case, you will need to use java or XSL mapping to handle the same. By the ways, can you tell us why you have such an input? It would be better if you have a source datatype like the input itself/
Regards
Bhavesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
but this:
<cUF>SP</cUF>
<ano>2006</ano>
is not an xml document
create a normal xml document and just cut the rest in the adapter module
or create the output with the use of xslt mapping
as with message mapping you need to have
an xml document as an output (and with XSLT, java, abap
mappings it is not necessary)
Regards,
michal
-
<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
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.