cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping Question

Former Member
0 Kudos

I am tring to map from a BAPI response to the mail package. My Problem is that my BAPI return structure returns a list of message items (unbounded) to the content field of the mail package. It only pulls the first message and emails it. I need to wrap up the messages and send them in the content field. How do I do this? I tried to reads some blogs on java mapping, but I didn't find what I was looking for. Any Ideas?

It looks like this...

<return>

<item>

<message>some message </message>

</item>

<item>

<message>some message 2 </message>

</item>

</return>

I need both those message together in the mail package content field.

Thanks,

Emmett

Accepted Solutions (1)

Accepted Solutions (1)

stefan_grube
Active Contributor
0 Kudos

Look at this thread:

There is an example with XSLT and one with the graphical mapping tool.

Regards

Stefan

Former Member
0 Kudos

Stefan,

Thanks! I used the advanced function in the graphical mapping tool. I did have to modify the function because it was capturing was looked like memory location instead of the string. It was missing the [ i ] which looks like it was just cut off in the post. It was cut off when I first typed this. I just added spaces to make it appear.

public void AddText(String[] a, ResultList result, Container container){

String b = "";

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

b = b + a[ i ] + "\n";
added [ i ]

result.addValue(b);

}

stefan_grube
Active Contributor
0 Kudos

hehe, [ + i + ] defines italic.

I changed it to [j] now

Stefan

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Emmett,

Are you using messages message or XSLT. If you are using XSLT between BAPI response and Mail then you can just use the <xsl:for-each> tag and position = "1" or position ="2" to pickup the message first and second message from unbounded message items.

Hope this helps.

Cheers,

Ranjan