cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic files as attachment to File adapter

Former Member
0 Kudos

Hello Experts,

I am having a file to mail scenario where the file adapter is expected to get a data file followed by 2 PDFs attachment files. The standard file adapter allows to specify additional files in Sender adapter.

However I suppose, the number of the files to be attached has to be determined at the design time and that wildcard characters '*' does not work over there. Also I guess it requires exact filename of the attachment file.

Is there any way by which we can specify wild-card characters in the File adapter additional files?

Thanks in advance.

Regards

Accepted Solutions (1)

Accepted Solutions (1)

former_member181985
Active Contributor
0 Kudos

Hi,

Unfortunately there is no provision for this.

http://help.sap.com/saphelp_nw2004s/helpdata/en/3c/b4a6490a08cd41a8c91759c3d2f401/content.htm

However, You can achieve your requirement in an indirect way, if source system can generate zip file which can have PDF files.

Pick the main payload along with zip file as attachment using file sender adapter. In the mapping phase, read the zip attachment and then unzip and then read each PDF and create attachment out it and then attach. You can do this either in graphical mapping or using a java mapping (as a first step in interface mapping).


Refer my document which describes about zipping: http://scn.sap.com/docs/DOC-26528 (Attachments zipping during Mapping)

You have to use unzipping logic in your case.

- praveen

Former Member
0 Kudos

Thanks Praveen for your reply and a good suggestion.

Picking up the zip file means the source application has to take care of zipping the files and put on the source folder and that to either with the same name as of the source data file (file adapter determines names of the attachment based on the name of the source file) or we will have to configure the name of the files in the adapter.

Actually the files are expected to be fetched from a FTP server location and unfortunately file adapter doesn't  provides the facility for FTP server as well .

Regards

Answers (2)

Answers (2)

Former Member
0 Kudos

Hello,

Below Blog can answer your second question,

http://scn.sap.com/community/pi-and-soa-middleware/blog/2012/04/13/renaming-email-attachment-with-in...

Thank You,

Madhav

former_member181985
Active Contributor
0 Kudos

Second Solution:-

You can have PDF files with extensions .pdf, .xpdf. Source system should ensure this when it is writing to the file system. Now you can pick the files using below convention in sender file communication channel...

“.xml“=“.pdf“

“.xml“=“.xpdf“

e.g., payload.xml (main payload)

        payload.pdf (attachment1)

        payload.xpdf (attachment2) --> this is actually a pdf file only extension is changed.

Using a custom adapter module or in mapping phase you can change the second attachment name and it's extension and then re-attach.

e.g., payload.xml (main payload)

        payload1.pdf (attachment1) --> name changed

        payload2.pdf (attachment2) --> name changed



Message was edited by: Praveen Gujjeti