2007 Jun 22 11:39 AM
Hi all,
have anyone a tool (in abap) to extract tar-files in SAP?
regards
Andreas
2008 Apr 16 3:29 PM
2008 Apr 16 3:29 PM
2008 May 02 10:39 AM
Hello,
you will find below a report that will untar file p_file to directory p_tardir
REPORT zchaouki_0001 .
*----------------------------------------------------------------------*
* PARAMETERS / SELECTION SCREEN *
*----------------------------------------------------------------------*
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME
TITLE text-b01.
PARAMETERS : p_file TYPE pathextern DEFAULT '/tmp/test/toto.tar',
p_tardir TYPE pathextern DEFAULT '/tmp/'.
SELECTION-SCREEN END OF BLOCK b1.
START-OF-SELECTION.
* Unzipp files of archive p_file in directory p_tardir
PERFORM unzip_file USING: p_file p_tardir.
END-OF-SELECTION.
*&---------------------------------------------------------------------*
*& Form unzip_file
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->WPV_FILE Directory + filename text
* -->WPV_DIR_TARGET Directory
*----------------------------------------------------------------------*
FORM unzip_file USING wpv_file TYPE pathextern
wpv_dir_target TYPE pathextern.
DATA :
wlt_system_list TYPE msssqlcode OCCURS 0 WITH HEADER LINE,
wlv_cmd_unix TYPE line1000.
* UNIX command
CONCATENATE 'cd' wpv_dir_target ';'
'tar xvf' wpv_file
INTO wlv_cmd_unix SEPARATED BY space.
CALL 'SYSTEM' ID 'COMMAND' FIELD wlv_cmd_unix
ID 'TAB' FIELD wlt_system_list-*sys*.
ENDFORM. " unzip_fileEdited by: Chaouki AKIR on Oct 11, 2009 1:27 AM