Skip to Content
0

SFTP - pick multiple files and zip them through SAP CPI

Apr 02 at 08:35 AM

222

avatar image

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.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Devaraj R Apr 02 at 07:33 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Apr 05 at 06:38 AM
0

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..

Share
10 |10000 characters needed characters left characters exceeded
Sriprasad Shivaram Bhat
Apr 17 at 01:00 PM
0

Hello Sandhya,

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

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

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-existing-camel-component/

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

Regards,

Sriprasad Shivaram Bhat

Share
10 |10000 characters needed characters left characters exceeded