cancel
Showing results for 
Search instead for 
Did you mean: 

Unzipping multiple files into one folder using OS command

Former Member
0 Kudos

Hello all,

I am new to PI. My requirement is unzipping multiple files into a target directory lets say D:/Unzipped on a different server.

I went through a few discussions and forums , where I could find that I can do that using OS commands.

http://wiki.sdn.sap.com/wiki/display/XI/SAP+XI+File+Adapter+OS+Command+Line+Feature

Though I am not able to follow this.

I found in one of the blogs using 7z.

My question is :

Where do we need to put the 7Z.exe and the batch file in SAP PI server to make this run.

Or

Is there any other way of doing this.Would be very helpful if you can elaborate the steps.

Please suggest.

Regards.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Thanks a lot all

Michal, Please clarify me on this. i tried 7z in my local machine. In my local machine i had to put the 7z.exe and bat file in the same folder where my unzipped files are kept. Only then i could unzip them as desired. The same we have to do in PI also.

If I put the BAT file in SAp folder  , how would it access the files to be unzipped and does the 7z.exe also need to be put in the same folder as the BAT file? IS 7.exe already present in SAP pI.

Please help me understanding the concept.

regards,

baskar_gopalakrishnan2
Active Contributor
0 Kudos

>IS 7.exe already present in SAP pI.

No.  If you run windows then you have to download 7 for windows and similarly seperate version for unix. You can execute this by setting the path in any environment. So that you can run the exec anywhere.  Othewise have the file in the same folder. Take help from system administrators.

Former Member
0 Kudos

Thanks,

I would like to know one more thing,

It is working with 7z , but will this work with winzip command line as well , as the business doesnt support 7z. They want files in .zip format only.

Regards,

baskar_gopalakrishnan2
Active Contributor
0 Kudos

winzip is for the windows version. If you need for unix there are plenty of tools available. Some tools will be preloaded with the OS installation. You can try unzip or tar command.  You might search online or take help from system admins. A sample website link is

http://www.cyberciti.biz/faq/linux-howto-unzip-files-in-root-directory/

Former Member
0 Kudos

Better use the PayloadZipBean (in a module chain). It has zip and unzip functionality, and avoids having to use OS commands and external tools (which is always bad for maintenance and security).

You can use this bean for example in a file receiver channel. PI then unzips the zip message to the directory you specify.

CSY

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

>>>Where do we need to put the 7Z.exe and the batch file in SAP PI server to make this run.

assuming that your PI server runs on windows you can put the bat file anywhere as long as PI server has access to that (you can put it in the SAP folders of PI)

Regards,

Michal Krawczyk

Former Member
0 Kudos

Thanks,

I would like to know one more thing,

It is working with 7z , but will this work with winzip command line as well , as the business doesnt support 7z. They want files in .zip format only.

Regards,

Former Member
0 Kudos

Clarification needed. Do you have multiple ZIP files received into PI to be unzipped or do you receive a ZIP file with multiple compressed files inside it.