cancel
Showing results for 
Search instead for 
Did you mean: 

XI Header Line into a XML File with message mapping

Former Member
0 Kudos
44

I'm making a Message Mapping, and in the source i have one line with three Columns.

This is an example of the line docitmMsg with the three columns called doctype, rate DataVersion.

</ns2:docitmMsg>doctype rate="1.00" DataVersion="1.05"</ns2:docitmMsg>

I need to know With format I have to use to create that.

Any help and suggestions will be welcome.

regards,

Fernando

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

When you ask "I need to know With format I have to use to create that..." what exactly do you mean? If you are referring to what type you should make the field when defining the XML structure I would make it a string, then depending on how you need to manipulate the data for transformations, it looks quite possible that you may need a user-defined java function.

Former Member
0 Kudos

Mr Holland, thanks for your reply.

Yes, you are right, but I would like to know what is the best way to make this mapping, i mean, do i have to use message mapping or a java function ?

After that, I need to know how to do this. So, Do you know where I can find some documents like manuals ( step by step ) or examples about how to create a message mapping ?

Thank you so much for your help !

best regards,

Fernando Pinto.

Former Member
0 Kudos

Hi,

You can use normal graphical mapping to create your target message.

let's say that in your source you have something like:


+ source
  + rate 
  + DataVersion  

then you need to use concatenate (standard function from string set function in graphical mapping) and map in this way:

<b>***** STEP 1 *****</b>


constant['doctype rate="'] -----> concatenate1
source:rate -------------------->     

constant['" DataVersion="'] ---> concatenate2 
source:DataVersion ------------>

<b>***** STEP 2 *****</b>


output of concatenate1---> concatenate3 
output of concatenate2--->

<b>***** STEP 3 *****</b>


output of concatenate3 ---> concatenate 4 ---> ns2:docitmMsg
constant['"'] ------------>

About documents, I suggest you to have a look at this document: <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/8a57d190-0201-0010-9e87-d8f327e1dba7">XI 3.0 New Mapping Features</a>.

Hope it helps,

Kind Regards,

Sergio

Former Member
0 Kudos

Hi Sergio,

Thanks for your help, but the mapping didn't work.

It returned: &apos; instead of " and &apos; instead of '

Regards,

Fernando

Former Member
0 Kudos

Hi Consultor,

Writing

'"'

I meant use the symbol

"

as a constant.

Hope it helps,

Kind Regards,

Sergio

Former Member
0 Kudos

Hi Sergio,

When I use symbol ", the XI change to the string &quot:

Do you know why it happens?

Regards,

Fernando

Former Member
0 Kudos

Hi,

it is due to the xml conversion.

Symbols like & are converted in & a m p ; (I added spaces to avoid conversion)

The single quote instead is & a p o s ;

Kind Regards,

Sergio

Former Member
0 Kudos

HI Sergio,

When I open the XML File in the browse, It shows me the caractere " istead of &quot;.

Thank you.

Fernando

Former Member
0 Kudos

Hi Fernando,

the browser parse the content of the file and does that kind of substituion (like it did in the message you posted), but if you look at the file content it is not processed by the browser xml engine.

Kind Regards.

Sergio

Answers (1)

Answers (1)

STALANKI
Active Contributor
0 Kudos

Also check this.

/people/sravya.talanki2/blog/2005/08/16/message-mapping-simplified--part-i

/people/sravya.talanki2/blog/2005/12/08/message-mapping-simplified-150-part-ii