cancel
Showing results for 
Search instead for 
Did you mean: 

Message mapping: RFC -> SOAP query with XML string

alancecchini
Participant
0 Kudos

Hi,

I'm setting up my first message mapping scenario and would like a pointer on how best to achieve the requirement.

The interface mapping is an RFC source interface to a target SOAP interface.

In my RFC I have a series of import parameters and a table with one or more student data records.

The import parameters map directly to the SOAP message structure and therefore I can use the drag and relate functionality in message mapping.

However, the table must be mapped to the SOAP message structure into a field called payload which will contain the XML data as a string, e.g:

<payload><students><interfaceid>01</interfaceid><student><studentid>074593486</studentid><studentname><title>Mr</title> ... </studentname> ... </student></students></payload>

I don't see how this can be achieved using simply the message mapping editor.

Any help greatly appreciated.

Alan

Accepted Solutions (0)

Answers (3)

Answers (3)

alancecchini
Participant
0 Kudos

Please can you clarify your response:

"tables will be listed as 'Items" in RFC Message Structure . use tat "Items" as table to map to target SOAP struture"

Do you mean using the function FixValues?

Either way please could you explain further.

Former Member
0 Kudos

Hi Alan,

The tables contains multiple rows, so each row will be trated as item.

Now here you have to consolidate all the rows to single field. This will be possible with Advanced User Defined Function.

Please refer How to create UDF and then copy below java code as it is.

http://help.sap.com/saphelp_nw04/helpdata/en/22/e127f28b572243b4324879c6bf05a0/content.htm

Source table field --> TestUDF ---> Target String

Cache parameter --> Queue

///Your code

try

{

String temp = new String("");

for(int i =0; a.length>i;i++)

temp = temp + a<i>;

result.addValue(temp);

} catch (ArrayIndexOutOfBoundsException e) {}

Let me know if you need anymore details.

Thanks

Swarup

Former Member
0 Kudos

tables will be listed as 'Items" in RFC Message Structure . use tat "Items" as table to map to target SOAP struture

santhosh_kumarv
Active Contributor
0 Kudos

Hi,

This can't be done using the standard graphical mapping. You have to use the java mapping to convert the source XML payload to string.

Thanks

SaNv...