cancel
Showing results for 
Search instead for 
Did you mean: 

How to add Namespace

Former Member
0 Kudos

Hi all,

I would like to use mutiple occurence for my mapping. My scenario is CSV File to JDBC.

So when I activate that option (set occurence to 0..unbounded) My messages has changed :


<messages>
    <message1>
        <MT_xxxxxxx>
            <col1/>
        </MT_xxxxxx>
    </message1>
</messages>

My payload looks like :


<?xml version="1.0" encoding="utf-8"?>
<ns:Messages xmlns:ns="http://sap.com/xi/XI/SplitAndMerge">
<Message1>
	<MT_xxxxxxxxx>
		<DIVISION_CODE>70</DIVISION_CODE>
		<DESCRIPTION>xxxxxx</DESCRIPTION>
		<COURSE_CODE>xxxxxx</COURSE_CODE>
		<COUR_DESC>xxxxxxx</COUR_DESC>
		<COURSE_REV>0001</COURSE_REV>
		<FREQUENCY>0</FREQUENCY>
		<ISSUE_DAT>01-Dec-2006</ISSUE_DAT>
		<DUE_DAT>01-Dec-2006</DUE_DAT>
		<COURSE_STATUS>A</COURSE_STATUS>
		<SERVER_TIME>11:43:10 AM</SERVER_TIME>
	</MT_xxxxxxxxxx>
</Message1>
</ns:Messages>

When I test it into the Mapping test :

caonnot produce target element /ns0:Messages/ns0:Message1

So my assumption is to reach a message like this :


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

<ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
   <ns0:Message1>
      <ns1:MT_xxxxxxxxxxxxx xmlns:ns1="http://mycompany.com/PI/ABC/xxxxxxx">
         <DIVISION_CODE/>
         <DESCRIPTION/>
         <COURSE_CODE/>
         <COUR_DESC/>
         <COURSE_REV/>
         <FREQUENCY/>
         <ISSUE_DAT/>
         <DUE_DAT/>
         <COURSE_STATUS/>
         <SERVER_TIME/>
      </ns1:MT_xxxxxxxxxxxxx>
   </ns0:Message1>
</ns0:Messages>

So how can I add namesapce into my message ?

Regards

Edited by: Joseph BERTHE on Mar 13, 2009 1:30 PM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

check this blog

/people/sameer.shadab/blog/2005/12/05/how-to-remove-namespaces-in-mapping--xi

Answers (2)

Answers (2)

former_member183908
Active Contributor
0 Kudos

Hi Joseph

The error which you are facing is that you might not mapped the subnode elements on both sender side and receiver side which are 1........UNBOUNDED in your XML payload this might be 1.....unbounded <MT_xxxxxxxxx>,you please map this fields on both sied if the receiver structure is also same as sender.

Thanks

Former Member
0 Kudos

Thanks guys, you helped me.

The solution is :

1. Do not copy the payload directly into the test field, just copy the data

2. The key word is : Multi-mapping

Kind regards

prateek
Active Contributor
0 Kudos

Your payload should not have Message and Message1 tags. It should start with <MT_xxxxxxxxx>.

Regards,

Prateek