cancel
Showing results for 
Search instead for 
Did you mean: 

Mail to File scenerio

0 Kudos

Hi Folks,

I am trying to do Mail to file scenario.

Requirement is reading the Mail attachment which we sent in email and place the attachment in FTP site.

Is there any message mapping involved in it?

Regards

Pavithra.R

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi Folks,

Thank you for your help..

Now my interface working.

I have used the below logic

1 AF_Modules/PayloadSwapBean                            Local Enterprise Bean     1

2        sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean     Local Enterprise Bean     mail

1          swap.keyName            Content-Disposition

1          swap.keyName            Content-Description

1          swap.keyValue           attachment;filename=".tsv"

1          swap.keyValue           .tsv

Answers (4)

Answers (4)

0 Kudos

Hello Friends ,

I am developing the File to Mail scenerio in SAP PI 7.4 . So, I want to configure in ESR and ID part please help me . Thanks in advance.

apu_das2
Active Contributor
0 Kudos

Its not required . Just create one pass through scenario with any ESR configuration. Recently I have developed one to pick mail with attachment from outlook server and put the attachment to FTP.

You just need to do some standard module configuration in mail Sender and File receiver CC to swap the attachment as mail payload and put this into FTP.

Thanks,

Apu

iaki_vila
Active Contributor
0 Kudos

Hi Apu,

Could you share your code module in a blog?, I think it will very helpful for all us

Regards.

apu_das2
Active Contributor
0 Kudos

Hi Inaki,

This is not custom module. I mentioned standard module. Requirement of Pavitra can be handled through SAP delivered modules. I was talking about MultiHeaderBean and Pawload Swap bean.

In Sender Mail CC


1       AF_Modules/MultipartHeaderBean   Local Enterprise Bean    0
2       AF_Modules/PayloadSwapBean   Local Enterprise Bean    1

3        sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean     Local Enterprise Bean     mail

0          dcNamespace              http://sap.com/xi/XI/System/Mail

0          requiredHeaders           All

1          swap.keyName            Payload-Name

1          Payload-Name             MailAttachment-1

In File Receiver CC

1      AF_Modules/DynamicConfigurationBean      Local Enterprise Bean      1

2       CallSapAdapter                                            Local Enterprise Bean       0

1                key.0                  write http://sap.com/xi/XI/System/Mail Part[1].Content-Description

1                key.value            message.interface

Thanks,

Apu

engswee
Active Contributor
0 Kudos

Apu is right. Totally forgot that it was possible with standard modules.

This approach was described in the following blog.

0 Kudos

Hi Apu,

My requirement is to pick the mail with attachment and place it in FTP path.

I have used Payload swap bean in Sender communication channel with below parameters

Payload swap bean

KeyName: Payload-Name

KeyValue: (name of the attachement)

I am not using any swapbean module in Receiver communication channel as this is not dynamic file name.

Even I am using the payload swap bean ,its not working..

apu_das2
Active Contributor
0 Kudos

Hi,

Try with this -

1 AF_Modules/PayloadSwapBean                            Local Enterprise Bean     1

2        sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean     Local Enterprise Bean     mail

1          swap.keyName            Comtent-Disposition

1          swap.keyName            Comtent-Description

1          swap.keyValue           attachment;filename="MailAttachment-1.xml"

1          swap.keyValue           MailAttachment-1

0 Kudos

Apu,

Same thing Im trying but the file not getting swap

apu_das2
Active Contributor
0 Kudos

In place of MailAttachment-1 can you put the exact name of attachment you are getting in mail and try once.

1          swap.keyValue           attachment;filename="<your attachment name>.<extension>"

1          swap.keyValue           <your attachment name>


Additionally check whether you check the ASMA parameter box as well or not.

engswee
Active Contributor
0 Kudos

Hi Pavithra

You still have not mentioned what PI version and SP level you are on. Without that, it can be very difficult to provide exact instructions to help because functionality and behavior are different over the different versions.

Also, in order to receiver valuable assistance in SCN, it is useful to provide screenshots of your configuration, logs and any error you are getting. I'd suggest you provide screenshot of your module configuration at the sender channel as well as the audit/message log details.

Back to your issue, it is most likely that the mail attachment name is different, so the swap fails to find the attachment. Please check what is the name of the mail attachment.

On a dual stack system, you can check as below in SXI_MONITOR

On a single stack system, you can check via PIMON

Also, for the approach to work, you need to know exactly in which MIME header field the file name is stored. This varies for different mail server type. As such, please check the dynamic configuration section (make sure ASMA is set in sender channel). As shown in the example below, the filename in my case is stored in the Content Disposition MIME field.

Please provide similar screenshots to the above in order to proceed further.

Regards

Eng Swee

engswee
Active Contributor
0 Kudos

Hi Pavithra

If your system so happen to be at least 7.31 SP14 or 7.4 SP9, then you can configure the sender mail channel to directly generate a message from the mail attachment. With this approach, you can do a passthrough interface without any mappings. You can read about it below, along with the corresponding SAP Note 2040884.

If your system do not have that capability, you will need to use a Java mapping to access the attachment.

Regards

Eng Swee

iaki_vila
Active Contributor
0 Kudos

HI Pavithra,

Check this wiki Step by Step Mail To File Scenario - Process Integration - SCN Wiki

It could be helpful for you.

Regards.