cancel
Showing results for 
Search instead for 
Did you mean: 

SFTP - pick multiple files and zip them through SAP CPI

Former Member
0 Kudos

Hi Team,

We have a requirement to pick 2 different files which contains same name but with different extensions (Ex: abc.xml & abc.pdf) from Source directory through SFTP and place the zip folder of those two files in the target directory.

We would need to achieve this requirement through SAP CPI. Could any one please provide your suggestions.

Note: Source directory may contains 'n' number of files. out of all the files we need to pick

.xml & .pdf files of same file name.

Ex:

abc.xml

DEF.pdf

abc.pdf

DEF.xml

Regards,

Sandhya.

Accepted Solutions (0)

Answers (3)

Answers (3)

Sriprasadsbhat
Active Contributor
0 Kudos

Hello Sandhya,

Please find the below documentation wrt to Custom Adapter development in SAP CPI.

https://help.sap.com/viewer/368c481cd6954bdfa5d0435479fd4eaf/Cloud/en-US/7392cc44de7c4450a65b8cd8f10...

https://blogs.sap.com/2016/05/05/draft/

https://blogs.sap.com/2017/08/15/creating-a-sap-cloud-platform-integration-hci-adapter-from-an-exist...

Also there are handful of blogs in SCN,please search.

Regards,

Sriprasad Shivaram Bhat

Former Member
0 Kudos

Hi Deva,

Thanks for the reply.

We should not expect any changes from source side. So we need to handle in picking the combination of .xml & .pdf files of same file name in CPI.

By doing merging ( as per the blog provided by you) the requirement will not be satisfied as I should pick .xml & .pdf files of same name from source folder and both files should be zipped in a single folder.

Do we have any information on custom adapter module implementation / Script at adapter level in CPI.

Please suggest.

Regards,

Sandhya..

former_member230091
Participant
0 Kudos

Hi Sandhya,

Hope we can't collect all the files in a single message of SAP HCI.

The reason behind is if you poll files from SFTP, each file would be processed as a separate message in SAP HCI.

So it would be better if you ask SFTP team to ZIP all relevant files and keep it as a ZIP file in SFTP directory.

Then easily you can process the ZIP file to target system.

You can go for below approach, if SFTP team is not able to combine and create the ZIP file.

If you need to poll only few no.of files from SFTP and combine them (in SAP HCI), you can try with the approach mentioned in the below blog (Check Sriprasad Shivaram Bhat's answer)

https://answers.sap.com/questions/34838/can-we-configure-multiple-sender-systems-to-fetch.html

You could try with one main integration process and many local integration processes to poll different files from same SFTP directory and combine them in SAP HCI

I am not sure whether we can create ZIP file with multiple files. (So far tried only for single file).

Regards,

Deva