cancel
Showing results for 
Search instead for 
Did you mean: 

Work with attachments

Former Member
0 Kudos

All,

Within the file adapter, it is possible to upload a message (e.g. XML) with attachment (e.g. binary PDF).

But how to work with these attachments in SAP XI?

1. Can the Receiver file adapter convert a message with attachment into 2 files?

2. How to send the main part to 1 destination and the other part to another destination?

3. How to access the main part (xml) and additional parts (pdf) within a business process?

4. Can I remove an attachment from a message in a mapping step?

5. Can I replace the main part (XML) with the attachment (binary PDF) in a mapping step (or elsewhere)?

Kind regards, Guy Crets

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Guy

Gr8 man finally u completed ur scenario.:-))

Regards

Arpit Seth

Former Member
0 Kudos

Hi

>>replace the main part (XML) with the attachment (binary PDF)

Yes you can do this by using <b>PayloadSwapBean</b>in module tab of the mail receiver. For this go through this link

<b>http://help.sap.com/saphelp_nw04/helpdata/en/2e/bf37423cf7ab04e10000000a1550b0/content.htm</b>

and

<b>http://help.sap.com/saphelp_nw04/helpdata/en/6b/4493404f673028e10000000a1550b0/content.htm</b>

Do as it is given in the links.

Hope it helps.

Regards

Arpit Seth

Former Member
0 Kudos

All,

Success! I was able to write the attachment to disk with the J2EE File adapter and the PayloadSwapBean.

Sample configuration:

Parameter Name: swap.keyName

Parameter Value: payload-name

Parameter Name: swap.keyValue

Parameter Value: Attachment-0

Some corrections on the docs:

- the PayloadSwapBean can be used with the file adapter (and is not limited to the mail adapter, as told in the docs)

- the Module name is "localejbs/AF_Modules/PayloadSwapBean" (localejb with s, so localejbS)

Some suggestions for improvement of attachment handling:

- possibility to swap binary attachment to file within the J2SE file adapter

- possibility to manipulate attachments in a mapping step (at least swap)

- Java mapping code that can access and manipulate attachments

- possibility to write payload and attachments to separate files with single file adapter

Kind regards, Guy Crets

Former Member
0 Kudos

Hi crets,

I have to do the same but with zip files. I can store the attachements on my disk but it is empty.

Do you any Idea of the PRoblem?

Thank's

Mattia

Former Member
0 Kudos

Hi Crets,

I would like to know in more detail the file receiver with attachments.

What were the settings in the adapter?

What did your data type look like e.g. settings.

Thanks in advance.

Ian

Former Member
0 Kudos

Hi

I am sending you links of two blogs which cover your requirements to some extent

<b>https://www.sdn.sap.com/sdn/weblogs.sdn?blog=/pub/wlg/1685</b [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken]> [original link is broken]

<b>/people/prasad.ulagappan2/blog/2005/06/07/mail-adapter-scenarios-150-sap-exchange-infrastructure

I had also completed my scenario with the help of these blogs.If you still have problem do post i will try to solve.

Hope it help.

Regards

Arpit Seth

Former Member
0 Kudos

Arpit,

Thanks for the blog entries. It seems that most adapters cannot handle attachments and therefore simply ignore them.

Would it be possible to use the PayloadSwapBean with e.g. the File/FTP adapter?

Kind regards, Guy Crets