cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping multiple source fields to one target field

alancecchini
Participant
0 Kudos

Hi,

I'd like to take the XML content fromy my outbound message and put this into a single field within my inbound message.

Please can someone suggest a suitable XSL mapping or user defined function I could use to achieve this.

Thanks,

Alan

Accepted Solutions (1)

Accepted Solutions (1)

udo_martens
Active Contributor
0 Kudos

Hi Alan,

please check out:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:template match="/">
		<SingleField>
			<xsl:text disable-output-escaping="yes"><![CDATA[<![CDATA[
			
			]]
			>
		
	
]]>

Regards,

Udo

alancecchini
Participant
0 Kudos

Hi,

OK, so I now have the XML data in one wrapper tag called inbound but when this is passed to the inbound ABAP proxy I obtain the error as listed below.

Any ideas how I overcome this?

XML payload

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

<inbound>

<![CDATA[ <n0:outbound xmlns:n0="http://homeoffice.gov.uk/immigration/migrant/cas/bulk-cas-re" xmlns:prx="urn:sap.com:proxy:NUD:/1SAI/TASDBA95DB1CF1834B8939A:700:2008/06/25"><ApplicantID>123</ApplicantID><FamilyName>Bloggs</FamilyName><GivenName>Blogs</GivenName><Nationality>GB</Nationality><Gender>1</Gender><CountryOfBirth>GB</CountryOfBirth><PlaceOfBirth>Gloucester</PlaceOfBirth><DateOfBirth><FullDate>1976-06-23</FullDate></DateOfBirth><ApplicantPassportOrTravelDocumentNumber>123</ApplicantPassportOrTravelDocumentNumber></n0:outbound>

]]>

</inbound>

Error

Error during XML => ABAP conversion (Request Message; error ID: CX_ST_MATCH_ELEMENT; (/1SAI/TXS2EC9427C9FBC1EDCA9A0 XML Bytepos.: 48 XML Path: inbound(1) Error Text: System expected the element 'inbound')) System expected the element 'inbound'

Thanks,

Alan

udo_martens
Active Contributor
0 Kudos

Hi Alan,

the namespace is missing.

Either you map it in the stylesheet, or you delete it in the message type (there is a field XML namespace, make it blank) and regenerate the proxy

Regards,

Udo

Former Member
0 Kudos

Have you regenerated the proxyafter making structural changes at the PI side if any?

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Can't you just use the 'concatenate' available in graphical mapping to do this ??

Cheers

Colin.

alancecchini
Participant
0 Kudos

Hi,

I should have clarified, I don't want to just move all the data content into the target field, I want all the XML payload from the different source fields.

Alan

Shabarish_Nair
Active Contributor
0 Kudos

you can use a java mapping also. Something as similar as this - https://wiki.sdn.sap.com/wiki/display/XI/WholePayloadtoaXML+field

Former Member
0 Kudos

Hi,

Just use another message mapping for the same and define the same in Interface mapping so that output of first mapping will be passed as input to second mapping and from there pass all the one fields to target message which will have only field..

HTH

Rajesh