cancel
Showing results for 
Search instead for 
Did you mean: 

How to dynamically getting the file name as attachment name in FILE to MAIL Scenario

Former Member
0 Kudos

Hi Experts,

I created File to Mail scenario with out ESR objects successfully.The File is picked from my ftp server and reached to mail as attachment. But iam getting the Email attachment name as UNTITLED.XML. My requirement is to get the attachment name  as what we are giving file name in FTP server.

EX: My file name is ABC.txt. I have to receive the attachment to EMAIL with the same name ABC.txt

Please help me on this. Its very urgent.

Regards,

Anjee.

Accepted Solutions (0)

Answers (2)

Answers (2)

sukhsimran_singh
Explorer
0 Kudos

Hi Anji Reddy Gundreddi,

Please go to the below post.

@Renaming Email Attachment with input File Name

Hope you will find it helpful.

Regards,

Sukhsimran Singh

RaghuVamseedhar
Active Contributor
0 Kudos

Anji,

Please check

Former Member
0 Kudos

HI Raghu,

Thanks for quick reply.

Here I have to pick different types of files(.txt,.xls,.xml,.pdf...) with different types data from FTP server and need to send  mail as attachment. So I excluded Mapping part.

As suggested by you if I use java mapping, I guess it will throw mapping exception. Please suggest if you have any other way to get the attachment name as same as file name.

Regards,

Anji Reddy.

RaghuVamseedhar
Active Contributor
0 Kudos

Anji,

Java mapping will not through exception. Please follow steps mentioned in below, wiki.

http://wiki.scn.sap.com/wiki/display/XI/Dynamic+file+name+for+pass-through+scenario

Former Member
0 Kudos


Hi Raghu,

Thanks for reply. Iam unable to get the com.sap.aii.mapping.api jar file please specify the path so that we can take this jar , after going through a link in sap scn , we took a jar file related to this api but there we don't have

  • import com.sap.aii.mapping.api.TransformationInput; 
  • import com.sap.aii.mapping.api.TransformationOutput;

these two imports , please suggest a solution

Regards

Anji Reddy G

Harish
Active Contributor
0 Kudos

Hi Anjli,

Please refer the below links

Where to get the libraries for XI development - Process Integration - SCN Wiki

regards,

Harish

Former Member
0 Kudos

Hi Harish,

Thanks for reply. I searched in your mentioned url. Bu t ididn't get the jar files related to below imports.

  • import com.sap.aii.mapping.api.TransformationInput; 
  • import com.sap.aii.mapping.api.TransformationOutput

Please suggest any alternate.

Regards,

Anji Reddy

Former Member
0 Kudos

Hi Raghu,

Iam unable to get the com.sap.aii.mapping.api jar file please specify the path so that we can take this jar , after going through a link in sap scn , we took a jar file related to this api but there we don't have

  • import com.sap.aii.mapping.api.TransformationInput; 
  • import com.sap.aii.mapping.api.TransformationOutput;

these two imports , please suggest a solution

Regards

Anji Reddy G

engswee
Active Contributor
0 Kudos

Anji

What PI/PO version are you working on and what NWDS version are you using? On newer versions of NWDS, the JAR files are already included - so you don't need to manually get them from the server.

Rgds

Eng Swee

Former Member
0 Kudos

Hi Eng Swee,

PI version is 7.0 and my nwds version is 7.0.14 , so here we are facing issue importing these two imports.

  • import com.sap.aii.mapping.api.TransformationInput; 
  • import com.sap.aii.mapping.api.TransformationOutput;

Regards

Anji

engswee
Active Contributor
0 Kudos

For PI 7.0, your class needs to be implementing StreamTransformation instead of AbstractTransformation. And you need to override method execute(InputStream in, OutputStream out).

Refer to the sample in the following JavaDoc link.

StreamTransformation (PI Mapping and Lookup (Netweaver�2004S�SPS 09))