cancel
Showing results for 
Search instead for 
Did you mean: 

Picking multiple files and send it to one zip file

swapna_patha
Explorer
0 Kudos

Hi All,

Actuall scenario: Idoc to file ( with zipped file containing other vechiles)

So my idea is to split the it into 2 scenarios IDOC to File and File to Zipped File

The issue is with 2nd scenario: File to Zipped File

Using PayloadZipBean module at receiver and additional file setting at sender, I am able to Zip Multiple files at sender to one zip file at receiver side but number of files are fixed by using Additional file option.

If the files are less then the specified then channels is throwing error. I want to pick files dynamically ‘n’ number of files present in the channel and zip them all. Could you please assist if any of you have already worked in this type of scenarios or any idea how to do this.

Thanks in advance.

Regards,

Swapna.

Accepted Solutions (1)

Accepted Solutions (1)

manoj_khavatkopp
Active Contributor
0 Kudos

Hi Swapna,

Try to maintain namepart value as *.xml and yes off-course it throws error if additional files are not there because you have mentioned trigger.optional as NO.

Br,

Manoj

swapna_patha
Explorer
0 Kudos

Hi Manoj, Yeah it worked if i changed the Optional parameter to YES but i have 1000's of file coming in, i have tried putting * but only 1 file (main payload) is coming not any other files. Is there any other way to pick dynamically all the files in the AL11 path, instead of maintaing the file names in Additional files. Regards, Swapna.

manoj_khavatkopp
Active Contributor
0 Kudos

Do u have any common naming convention with all those n files or is it just the extension .xml??

swapna_patha
Explorer
0 Kudos

Hi Manoj, I can i have something in common for files like Test*.XML. Regards, Swapna.

manoj_khavatkopp
Active Contributor
0 Kudos

I guess dynamic maintaining the extra files as in  file list is not possible ! so you can write a script which zips multiple files in to one file ,and then pick that one single zipped file.

swapna_patha
Explorer
0 Kudos

Hi Manoj, Could you please post the script for zipping of files.

Answers (3)

Answers (3)

swapna_patha
Explorer
0 Kudos

Tried using the Link : http://scn.sap.com/people/suraj.sr/blog/2009/07/21/zip-multiple-files

Use the following OS Commands: cmd /C "jar cvfM \\machine-name\foldername\zippedfolder\test.zip -C \\machine-name\foldername\files2zip ."

Files which need to be zipped is kept in location : \\machine-name\foldername\files2zip

Zipped file will be created in location \\machine-name\foldername\zippedfolder\zip and will have name test.zip.

Getting wraning.....

Please assist

former_member186851
Active Contributor
0 Kudos

Refer the below discussion and try Swapna

swapna_patha
Explorer
0 Kudos

Hi All, The issue is still pending, could anyone please assist. Regards, Swapna.

nikhil_bose
Active Contributor
0 Kudos

It is not supported by PI - additional files must be specified and can't be dynamic. Best way is to zip those files in the sender system itself and PI reads single zip.

regards,

Nikhil

former_member186851
Active Contributor
0 Kudos

Hello Swapna,

Instead of giving additional files why don't maintain something link Trig* in the file name.

swapna_patha
Explorer
0 Kudos

Hi Rahuraman, Tried this but not worked , it doesn't even picked the files. Just changed the file name to Tring*. Any other changes i need do. Regards, Swapna.

former_member186851
Active Contributor
0 Kudos

Try giving * Swapna.