cancel
Showing results for 
Search instead for 
Did you mean: 

IDOC to PDF and XML via EMail: using InputAttachment interface in mapping

Former Member
0 Kudos

Hello Together,

I am working on the following scenario:

IDOC --> Transformation Nr. 1 IDOC-XML; Transformation Nr.2 XML- PDF --> Email with 2 Attachments XML and PDF.

Till now Iu2019ve managed "IDOC to Email" with XML-Attachment. Therefore I used MailPackage and SwapBean. Unfortunately I didnu2019t see any possibility to send PDF attachment with MailPackage approach.

Thatu2019s why I decided to change the scenario in this way to avoid using of MailPackage:

u2022 first step: IDOC to FTP (2 XML files)

u2022 second step: FTP (1. file = payload + 2. file= attachment) to Email with one XML-attachment

It works without MailPackage, but I still need the PDF-attachment. In the moment I am trying to read the XML-attachment, to transform XML2PDF and to add the second attachment to the message inside of mapping . I use InputAttachment and OutputAttachment interfaces.

http://help.sap.com/javadocs/pi/SP3/xpi/com/sap/aii/mapping/api/InputAttachments.html

Unfortunately the reading of the XML-attachment with u201CInputAttachementu201D interface inside of mapping doesnu2019t work. Tracing says: "there is no attachment".

So my questions are:

1. Is it possible to work with Input- and OutputAttachement interfaces inside of mapping? Or does it work only inside of adapter module?

2. If it works inside of mapping, how can I test it in design time?

If you see any other way to solve my problem, let me know please.

Thank you a lot, regards Anna

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Question Nr. 1:

"... Mapping programs are executed in the Java part of SAP NetWeaver AS. Consequently, the mapping runtime transfers the message payload from the ABAP part of the SAP NetWeaver Application Server to the Java part before the mapping program is executed. Since mapping programs do not usually access any MIME attachments in a message, the default setting is for the mapping runtime to transfer the payload only and not the attachments. This applies for both attachments that are removed as part of MTOM optimization in the Web services runtime, as well as for attachments that a sender sends together with a payload by using proxy methods in the XI runtime.

If you want to access an attachment from a mapping program, it must have been transferred from the ABAP part to the Java part prior to execution. You can configure this in the basic settings of the operation mapping in which you reference the mapping program (select the Read Attachments checkbox)..."