Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 3510

Issue sending single attachment per child message in Multimapping

$
0
0

Hello All,

 

We are having a Proxy to Mail scenario. We have used Multi-mapping(1 - N) with mail package on the target side. Our requirement is to read the XML from every ITEM node(Source) and send as an email with one attachment. Please find the source structure below.

 

We are using Return as XML function (on Node3) on the source side[This XML should be sent as attachment in every mail]

 

Source structure

 

MT_XXX

-->Item(0..unbounded)

------>Node1(1)

------>Node2(1)

---------->Node3(1)

------------------->SubNode3.1(1)..

 

Target structure

Mail package(Signature tab we have changed the occurance to 0..unbounded)

 

We use the below udf to create attachment and the Email body in our message mapping

 

{

String emailBody = "Hello " "\n"+"Attached is the interface file for invoice:

 

//creating attachment

String attachmentName = invoiceNumber + ".xml";

String contentType = "application/xml;name=" + attachmentName;

GlobalContainer globalContainer = container.getGlobalContainer();

OutputAttachments outputAttachments =  globalContainer.getOutputAttachments();

Attachment attachments = outputAttachments.create(attachmentName,contentType,sourceXML.getBytes());

outputAttachments.setAttachment(attachments);

 

return emailBody;

}

 

 

The issue we face is all the attachments are sent for every target message delivered. We need to send one email + one attachment for evry item.

 

Reference :

http://scn.sap.com/docs/DOC-64444

http://scn.sap.com/people/jyothi.anagani/blog/2010/06/17/convert-the-input-xml-to-string-in-pi-71-using-standard-graphical-mapping

 

 

Any inputs pleease!!

 

Regards,

Malini


Viewing all articles
Browse latest Browse all 3510

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>