cancel
Showing results for 
Search instead for 
Did you mean: 

Unzip file using operating system command in file/ftp receiver adapter

Former Member
0 Kudos

Hi,

I'm wonderdering how to unzip a zip-file in the receiver file/ftp adapter. I know it is possible to do it using the 'Operating system command' feature, but somehow the command I use seems to be ignored! (I'm using SP14, unix).

The command I entered is quite simple: unzip %F (also tried the %f, but i guess it doesn't really matter wich on I use).

Is it possible that I'm unzipping to another directory than the one i expect? the unzip should be performed to/in the current directory, and assumingly current directory is the one stated in the 'Target Directory', right?

Hope someone can clearify this issue for me.

Best regards,

Daniel

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Daniel,

It seems to me also, that the files are being unzipped to a different location than what you are expecting. The OS command might getting executed in some default location(i am trying to fnd that out)on the server and not in the target directory of the channel(It seems logical to me)....

If you have time...pls try this out & see whether this would help...

Have a shell script written with the following commands in them

cd <path to target directory>

unzip $1(filename from the channel)

and in the OS command in the Channel give....

<absolute path to the .sh file> %F

Thanks,

Renjith.

Former Member
0 Kudos

Hi Renjith,

The way you describe is exactly the way I'm currently doing it. This way, there's no problem doing it. It unzips it as it should without any problem.

Regards,

Daniel

STALANKI
Active Contributor
0 Kudos

One more way is to write a report in ABAP (schedule it for every 3 seconds) .

Use SM69 and SM49 for creating external commands and testing them.

May be you can test your commad there also.let me know if you get any error there..

MichalKrawczyk
Active Contributor
0 Kudos

hi Daniel,

have a look at those two weblogs:

/people/sameer.shadab/blog/2005/09/21/executing-unix-shell-script-using-operating-system-command-in-xi

/people/michal.krawczyk2/blog/2005/08/17/xi-operation-system-command--error-catching

maybe they will help you debug your scenario

Mine is about windows but have a look at it too

cause it shows "error catching"

Regards,

michal

Former Member
0 Kudos

Hi Michal,

I have already had a look at these to blogs, they where the ones that initially inspired me, to do it the way I'm trying:-)

Regards,

Daniel