on 02-12-2009 6:21 PM
Hi,
In my scenario I receive an XML file with another file as attachment. I need to map both the content of the XML file and the attachment to the target which will be sent as an attachment in a mail.
I have used JavaMapping and I'm now able to send the mail with the attachment. But i'm not sure how to read the contents of the attachment in the mapping.
Any help would be appreciated.
Thanks,
Bhargav
Edited by: Bhargav Srinadh Gundabolu on Feb 12, 2009 10:03 PM
Hello Bhargav,
It depends on the version of SAP PI you have,
Prior to Version 7.1 there was no support to access attachments in a Mapping Programm, so in that
case the only way to handle it is e.g. to access it in an adapter module (dependent on your scenario).
In SAP PI 7.1 you can easily access an attachment within a mapping.
Within a Java mapping program this can be done with the TransformationInput Class, calling the method getInputAttachments() which will give you all available attachments.
Also see the SAP PI 7.1 javadocs (com.sap.aii.mapping.api):
https://help.sap.com/javadocs/pi/SP3/xpi/index.html
In a graphical mapping you can access attachments within a UDF through the GlobalContainer parameter:
GlobalContainer globalContainer = container.getGlobalContainer();
InputAttachments inputAttachments = globalContainer.getInputAttachments();
With best regards
Sebastian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bhargav,
if your receiver system is a SAP system with WAS >= 6.20 then you can use a ABAP inbound proxy and create the business logic there. It is quite easy to pick the attachment there: [SAP help: Attachments|http://help.sap.com/saphelp_nw2004s/helpdata/en/a7/3b2a2d45a34a23b75e3b18745c63bc/content.htm]
Regards,
Udo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You will not be able to read the attachment in mapping unless u use the payloadswap been. But this would replace your actual payload. If you want both of them in the mapping, you need to write an adapter module which would read both the payload and the attachment and create a sinlge message and sends it to IE. You have to define your message types according to this new XML and use in mapping.
VJ
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.