cancel
Showing results for 
Search instead for 
Did you mean: 

Unzip Module

r_s_kulkarni11
Participant
0 Kudos

Hello All,

My scenario is as below -

To pull the Zip file from SFTP server and then keep it on NFS server after unzipping it.

The zip file contains 2 files one is xml file and another one is pdf file.

I need to have them separately on NFS when I unzip them.

As of now suppose I pull one abc.zip file containing 1.xml and 1.pdf file from SFTP server, after unzipping I am able to see only abc.zip file (unzipped) on NFS server.

Could you please let us know the things required?

Regards,

Rahul

Accepted Solutions (1)

Accepted Solutions (1)

anupam_ghosh2
Active Contributor
0 Kudos

Hi Rahul,

                  I hope you went through this thread Unzip files in PI 7.11 | SCN

Regards

Anupam

former_member186851
Active Contributor
0 Kudos

Rahul.

Additionally you can refer the below links as well

r_s_kulkarni11
Participant
0 Kudos

Hi,

By applying the PayloadSwapBean now the XML file is visible but how about the other PDF file?

Additionally my requirement is that - I will have one zip file on SFTP server which will contain n xml and n pdf files so once those are unzipped I should be able to see all the files separately on NFS.

former_member186851
Active Contributor
0 Kudos

Rahul,

you wish to do any transformation in PDF or just pass through?

r_s_kulkarni11
Participant
0 Kudos

Hi,

I just want to keep the PDFs as is and I will be processing XMLs further as Idocs

bhavesh_kantilal
Active Contributor
0 Kudos

Refer to my responses in this thread.

A similar requirement but with different adapters but my response holds true.

http://scn.sap.com/thread/3888572

Regards

Bhavesh

former_member186851
Active Contributor
0 Kudos

Hello Rahul,

Use payload ZIP bean mentioned in the first link,It will just unzip all the documents.Don;t use payload swap bean as you wish to have the files in NFS.

r_s_kulkarni11
Participant
0 Kudos

Hello Raghuraman,

In that case I am getting the unzipped single file and content is messed up.

I need to have on NFS two seperate files one is pdf and another is XML.

This is just one test case, in actual it may be a case that I will have 1 zipped file and after unzipping there could be 30 pdfs and 30 xmls.

former_member186851
Active Contributor
0 Kudos

Hello Rahul,

Check the below link

https://scn.sap.com/thread/1994395

Will try to find more on this.

Answers (4)

Answers (4)

r_s_kulkarni11
Participant
0 Kudos

Hello All,

Issue resolved, basis guys altered a script a bit and it is now working as expected.

Thanks for the help.

Regards,

Rahul

RaghuVamseedhar
Active Contributor
0 Kudos

Rahul,

Please use this solution, when number of files in zip are fixed.

r_s_kulkarni11
Participant
0 Kudos

Hello All,

One thing noticed, when script is getting executed, the zip file getting disappeared but the new unzipped files are not getting created.

sateesh437
Participant
0 Kudos

Hello Rahul,

You need to run the Script after message processing then you will have zip file as well.

Before you executing the script from PI/PO, execute the same script in putty to check the commands are working properly or not.

Regards,

Sateesh.

sateesh437
Participant
0 Kudos

Hello Rahul,

Try to use OS system Commands for unzip & Sorting. It may ease your work.

Regards,

Sateesh.

r_s_kulkarni11
Participant
0 Kudos

Hello Sateesh,

Yes I tried with the unzip command, the command is getting executed but I am not able to see the unzipped file.

Below is the command I have written.

#!/bin/bash

#

SOURCEDIR=/interface/id091/test/

TARGETDIR=/interface/id091/test/in

FILENAME=*.zip

#

cd $SOURCEDIR

chmod 777 $FILENAME

unzip * -d $TARGETDIR

rm -f $FILENAME

#

exit 0

Could you please let me know what is the issue here?

former_member186851
Active Contributor
0 Kudos

Hello Rahul,

Are you getting any error using payload zip module?

r_s_kulkarni11
Participant
0 Kudos

Hi Raghuraman,

As discussed earlier, when I use Payload zip module I am not able to get 2 separate files on NFS, and in unzipped file content is somewhat distorted. Basically my source file will be one zip and it will contain n number of PDF and XML files, so I need to have them on NFS as a separate entity each.

former_member186851
Active Contributor
0 Kudos

Rahul,

Refer the below discussion(same requirement as yours I believe).

File to File scenario : Unzip a File using OS c... | SCN