‎2007 Oct 16 8:21 AM
Hi All,
Can anybody guide me how to Unzip a .zip file using ABAP program... Appreciate your immediate reply...
actually, my scenario is to check whether zip file is created in appl.server or not.., and if zip file created then i need to check whether its blank file or any content exist inside the file...
Thanks in advance
Bhasker
‎2007 Oct 16 8:30 AM
hi
good
parameters: command(236) lower case.
data: std_lines(255) occurs 0 with header line.
call function 'RFC_REMOTE_PIPE'
destination 'SERVER_EXEC'
exporting
command = command
read = 'X'
tables
pipedata = std_lines
exceptions
communication_failure = 1
system_failure = 2.
You should put your Unix command in the command parameter. "gunzip /yourfilepath/yourfilename" works on my Unix system. Once you determine the proper Unix command, you should be set. This technique is also nice because it provides you with echos back from Unix in table std_lines. For more complex Unix activity, you may want to consider throwing together a Unix script, and calling that via this code.
reward point if helpful.
thanks
mrutyun^
‎2007 Oct 16 8:47 AM
Hi Mrutynjaya,
I already used above method but couldnt get any result... no error message SY-SUBRC = 0, stnd_line table was empty... can you guess whats the reason??
and when i use :
OPEN DATASET filename FOR INPUT FILTER 'uncompress' IN TEXT MODE ENCODING DEFAULT.
i got abap run-time error Pipe closed....
and when i used:
call 'SYSTEM' id 'COMMAND' field unixcom
id 'TAB' field tabl[].
i am getting only filename in my internal table tabl[]...
please advise.... Thanks
‎2007 Oct 16 9:43 AM