cancel
Showing results for 
Search instead for 
Did you mean: 

SFTP file to mail attachment

Former Member
0 Kudos

Hello Experts,

We are using Java Single stack SAP PI.

I have a scenario to develop where I pull out files (xlsx) from an sftp server and without any processing I have to send that file as an attachment to email address. I tried to find similar scenario but I couldn't.

The files could be pulled out one by one or in bulk, whichever scenario is easier. I have about 20 files on server now, but new file will appear once per 1-2 days.

I would appreciate any links and advices how to approach this subject.

Best regards

Accepted Solutions (1)

Accepted Solutions (1)

engswee
Active Contributor
0 Kudos

Hi Marcin

Do you need to dynamically form the email subject, address, or body with some details from the XSLX file? If no, then you can just use a passthrough interface and in the receiver mail channel, do not use Mail Package and specify all the mail attributes statically.

Rgds

Eng Swee

Former Member
0 Kudos

No, the email address, subject and content will be constant. I just need to pass the file without any processing and attach that file as attachment.

I will look into "passthrough interface" and come back here if I have more questions.


Thanks for suggestion.

Best

Former Member
0 Kudos

Hi Marcin,

If you just need  to pass the file, you don't need ESR objects. Here an example scenario FILE to FILE without ESR objects.

http://saptechnical.com/Tutorials/XI/File2File/Demo1.htm


To configure the SFT adapter, you can check this link.

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/305eeb5b-81e7-2f10-d8aa-9216de04c...

regards

Former Member
0 Kudos

Hello,

I think thoose scenarios are for dual or abap stacks, I cannot find mentionded objects there like receiver determination or sender agreement. Can I make pass thru interface without IC, Operation Mapping seems to be required there ?

Integrated scenarios have a operation mapping required and to make those you need to define a data type, message type etc. Did anyone came across pass through scenario for Java stack only PI ?

Best

engswee
Active Contributor
0 Kudos

Hi Martin

Passthrough scenarios are valid for Java stack only too. You just type in the service interface name and namespace instead of selecting it from the value help list. And Operation Mapping is NOT a required field, you can leave it empty and manually type in the name of the receiver service interface.

Rgds

Eng Swee

Former Member
0 Kudos

Thank you very much !

My interface is pulling files from sftp and sending them as email. I run into another problem with duplicate files, but I will start new thread if I won't be able to resolve it myself.

Thanks again

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Experts,

I am working on PI 7.31 single stack,my scenario is same as above where I have to pull the files and email to constant email address which I have done through ICO no ESR objects. But the receiver channel is functioning in error and message got failed in PI. Please find the below error code:

"Transmitting the message to endpoint <local> using connection File_http://sap.com/xi/XI/System failed, due to: com.sap.engine.interfaces.messaging.api.exception.MessagingException: com.sap.aii.af.sdk.xi.srt.BubbleException: Failed to call the endpoint  [null "null"]; nested exception caused by: java.net.UnknownHostException: [smtp server of outlook]"

Please help to resolve the issue.

Thanks,

Nithin.