<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: sftp file compression in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sftp-file-compression/m-p/4447387#M1054733</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kiran,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your code. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My requirement is to retain the code and just require to add the switch -C in somewhere else to achieve the compression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is my current way to append the -C at the back of the batch mode code is correct?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 01 Oct 2008 05:16:49 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-10-01T05:16:49Z</dc:date>
    <item>
      <title>sftp file compression</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sftp-file-compression/m-p/4447385#M1054731</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Im using SFTP batch mode to read a series of commands from an input batchfile instead of stdin.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example :&lt;/P&gt;&lt;P&gt;sftp -b batchfile user@host&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Right now, I need to enable the compression for the file before sending to SFTP server.&lt;/P&gt;&lt;P&gt;I need to add in the switch -C in my Abap program. How to I achieve that?&lt;/P&gt;&lt;P&gt;Add the switch at the back of the code as below?? Please advise.Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sftp -b batchfile user@host &lt;STRONG&gt;-C&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Blue Sky on Oct 1, 2008 6:54 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Sep 2008 10:51:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sftp-file-compression/m-p/4447385#M1054731</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-16T10:51:23Z</dc:date>
    </item>
    <item>
      <title>Re: sftp file compression</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sftp-file-compression/m-p/4447386#M1054732</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I might not be giving u the final solution, but I can help you with compression of the file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the below code can be made use of, inorder to compress a file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
TYPES:
t_xline(2048) TYPE x, "BINARY FILES

BEGIN OF t_line,
line(1024) TYPE c,
END OF t_line. "CONTENT

DATA:
size type i.

DATA:
data_tab TYPE STANDARD TABLE OF t_xline,
text_tab TYPE STANDARD TABLE OF t_line.

DATA:
input_x type xstring, "BINARY CONTENT INPUT
output_x type xstring. "BINARY OUTPUT OUTPUT

data : CL_ZIP type ref to CL_ABAP_ZIP .


DATA:
name type string.

name = 'c:\error.doc'. "&amp;lt;-- Insert full path of application server

CALL METHOD CL_GUI_FRONTEND_SERVICES=&amp;gt;GUI_UPLOAD
EXPORTING
FILENAME = name
FILETYPE = 'BIN'
IMPORTING
FILELENGTH = size
CHANGING
DATA_TAB = data_tab.


CALL FUNCTION 'SCMS_BINARY_TO_XSTRING'
EXPORTING
INPUT_LENGTH = size
IMPORTING
BUFFER = input_x
TABLES
BINARY_TAB = data_tab.

CREATE OBJECT cl_zip.

cl_zip-&amp;gt;ADD(
EXPORTING
NAME = name
CONTENT = input_x
)
.

cl_zip-&amp;gt;SAVE(
RECEIVING
ZIP = output_x
)
.

REFRESH data_tab.

CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
EXPORTING
BUFFER = output_x
IMPORTING
OUTPUT_LENGTH = size
TABLES
BINARY_TAB = data_tab
.
DATA:
lw_output_path TYPE string.

lw_output_path = 'c:\myfile.zip'. " specify the application server path where u want to create zip file.


CALL METHOD CL_GUI_FRONTEND_SERVICES=&amp;gt;GUI_DOWNLOAD
EXPORTING
BIN_FILESIZE = size
FILENAME = lw_output_path
FILETYPE = 'BIN'
CHANGING
DATA_TAB = data_tab
.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kiran&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Oct 2008 05:02:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sftp-file-compression/m-p/4447386#M1054732</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-01T05:02:07Z</dc:date>
    </item>
    <item>
      <title>Re: sftp file compression</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sftp-file-compression/m-p/4447387#M1054733</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kiran,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your code. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My requirement is to retain the code and just require to add the switch -C in somewhere else to achieve the compression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is my current way to append the -C at the back of the batch mode code is correct?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Oct 2008 05:16:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sftp-file-compression/m-p/4447387#M1054733</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-01T05:16:49Z</dc:date>
    </item>
  </channel>
</rss>

