<?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: How to store Rawstring to itab &amp; 'strlen' not working for Rawstring ? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-store-rawstring-to-itab-strlen-not-working-for-rawstring/m-p/899303#M54883</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Any clue to store rawstring to internal table ? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;strlen is not available for rawstring as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 27 May 2005 07:59:14 GMT</pubDate>
    <dc:creator>former_member54229</dc:creator>
    <dc:date>2005-05-27T07:59:14Z</dc:date>
    <item>
      <title>How to store Rawstring to itab &amp; 'strlen' not working for Rawstring ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-store-rawstring-to-itab-strlen-not-working-for-rawstring/m-p/899302#M54882</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Many thanks for your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you clarify Step3 &amp;amp; 4 (refer as below Raja's post) since 'strlen' is not working for xstring (rawstring)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And how to reverse the 'CONCATENATE' process to store xstring to itab ? Rawstring seems take maximum length of 10,880 char and we have to compress our big file at first.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a nice weekend!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Waylan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the step by step approach.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. read the raw string from the table.&lt;/P&gt;&lt;P&gt;2. unzip using&lt;/P&gt;&lt;P&gt;CALL METHOD cl_abap_gzip=&amp;gt;decompress_binary EXPORTING gzip_in = &amp;lt;compressed binary string &amp;gt; IMPORTING raw_out = &amp;lt;decompressed binary string&amp;gt;.&lt;/P&gt;&lt;P&gt;3. find the length of the xstring - strlen( &amp;lt;variable&amp;gt; )&lt;/P&gt;&lt;P&gt;4. move the decomressed xstring to a itab&lt;/P&gt;&lt;P&gt;5. use GUI_download , passing file size and setting the file type to BIN&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Raja&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 May 2005 02:48:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-store-rawstring-to-itab-strlen-not-working-for-rawstring/m-p/899302#M54882</guid>
      <dc:creator>former_member54229</dc:creator>
      <dc:date>2005-05-27T02:48:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to store Rawstring to itab &amp; 'strlen' not working for Rawstring ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-store-rawstring-to-itab-strlen-not-working-for-rawstring/m-p/899303#M54883</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Any clue to store rawstring to internal table ? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;strlen is not available for rawstring as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 May 2005 07:59:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-store-rawstring-to-itab-strlen-not-working-for-rawstring/m-p/899303#M54883</guid>
      <dc:creator>former_member54229</dc:creator>
      <dc:date>2005-05-27T07:59:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to store Rawstring to itab &amp; 'strlen' not working for Rawstring ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-store-rawstring-to-itab-strlen-not-working-for-rawstring/m-p/899304#M54884</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Waylan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you should use xstrlen in place of strlen to get the length of xstring.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By the way , you can check the program below that converts a text file --&amp;gt; xtring --&amp;gt;binary ---&amp;gt;text file again and then downloads on your PC as 'C:\stringtest.txt'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT  ZTEST_XSTRING                           .

TYPES : BEGIN OF ty_text,
          text_field(1000) TYPE C,
        END OF ty_text.

TYPES : BEGIN OF ty_binary,
          BINARY_field(1000) TYPE C,
        END OF ty_binary.

DATA : lv_xstring type XSTRING.
DATA : lt_binary type table of ty_binary with header line.
DATA : lt_text type table of ty_text with header line.
DATA : lt_text_out type table of ty_text with header line.

DATA : X_OUTFILE type string.

lt_text-text_field = 'Hello'.
append lt_text.

lt_text-text_field = 'Hi'.
append lt_text.

lt_text-text_field = 'How r u?'.
append lt_text.



CALL FUNCTION 'SCMS_TEXT_TO_XSTRING'
* EXPORTING
*   FIRST_LINE       = 0
*   LAST_LINE        = 0
*   MIMETYPE         = ' '
 IMPORTING
   BUFFER           =  lv_XSTRING
  TABLES
    TEXT_TAB         = lt_text
 EXCEPTIONS
   FAILED           = 1
   OTHERS           = 2
          .
IF SY-SUBRC &amp;lt;&amp;gt; 0.
  MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
          WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.


CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
  EXPORTING
    BUFFER                = lv_XSTRING
*   APPEND_TO_TABLE       = ' '
* IMPORTING
*   OUTPUT_LENGTH         =
  TABLES
    BINARY_TAB            = lt_binary
          .

CALL FUNCTION 'SCMS_BINARY_TO_TEXT'
  EXPORTING
    INPUT_LENGTH          = 100
*             FIRST_LINE            = 0
*             LAST_LINE             = 0
*             APPEND_TO_TABLE       = ' '
*             MIMETYPE              = ' '
    WRAP_LINES            = 'X'
*           IMPORTING
*             OUTPUT_LENGTH         =
  TABLES
    BINARY_TAB            = lt_binary
    TEXT_TAB              = lt_text_out
*           EXCEPTIONS
*             FAILED                = 1
*             OTHERS                = 2
          .
IF SY-SUBRC &amp;lt;&amp;gt; 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.


X_OUTFILE = 'C:stringtest.txt'.

CALL FUNCTION 'GUI_DOWNLOAD'
  EXPORTING
    FILENAME                = X_OUTFILE
    FILETYPE                = 'ASC'
  TABLES
    DATA_TAB                = lt_text_out
  EXCEPTIONS
    FILE_WRITE_ERROR        = 1
    NO_BATCH                = 2
    GUI_REFUSE_FILETRANSFER = 3
    INVALID_TYPE            = 4
    NO_AUTHORITY            = 5
    UNKNOWN_ERROR           = 6
    HEADER_NOT_ALLOWED      = 7
    SEPARATOR_NOT_ALLOWED   = 8
    FILESIZE_NOT_ALLOWED    = 9
    HEADER_TOO_LONG         = 10
    DP_ERROR_CREATE         = 11
    DP_ERROR_SEND           = 12
    DP_ERROR_WRITE          = 13
    UNKNOWN_DP_ERROR        = 14
    ACCESS_DENIED           = 15
    DP_OUT_OF_MEMORY        = 16
    DISK_FULL               = 17
    DP_TIMEOUT              = 18
    FILE_NOT_FOUND          = 19
    DATAPROVIDER_EXCEPTION  = 20
    CONTROL_FLUSH_ERROR     = 21
    OTHERS                  = 22.
* Status of download
CASE SY-subrc.
  WHEN 0.
    MESSAGE I002(AQ) WITH
    'www.rmtiwari.com webviewer:Code converted to HTML and downloaded as
 ' X_OUTFILE.

  WHEN OTHERS.
*        Upload unsuccessful - error message
    MESSAGE ID SY-MSGID TYPE 'E' NUMBER SY-MSGNO
       WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDCASE.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 May 2005 16:03:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-store-rawstring-to-itab-strlen-not-working-for-rawstring/m-p/899304#M54884</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-05-27T16:03:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to store Rawstring to itab &amp; 'strlen' not working for Rawstring ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-store-rawstring-to-itab-strlen-not-working-for-rawstring/m-p/899305#M54885</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;Sorry, it was weekend (thursdaty and friday), thus couldnt reply on time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to compute the xstring length.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use xstrlen ( xstring ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;itab for storing the xstring.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of bin_tab ,&lt;/P&gt;&lt;P&gt;      val type xstring ,&lt;/P&gt;&lt;P&gt;      end of bin_tab .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now move the raw value which you read from the DB table into this table and use gui_download with file type 'BIN'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this is clear.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Raja&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 May 2005 04:59:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-store-rawstring-to-itab-strlen-not-working-for-rawstring/m-p/899305#M54885</guid>
      <dc:creator>athavanraja</dc:creator>
      <dc:date>2005-05-28T04:59:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to store Rawstring to itab &amp; 'strlen' not working for Rawstring ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-store-rawstring-to-itab-strlen-not-working-for-rawstring/m-p/899306#M54886</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't think it will work that way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can't download Hexa value as a Binary. You need to first convert it to Binary.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check my previous posting.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ram&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 May 2005 07:22:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-store-rawstring-to-itab-strlen-not-working-for-rawstring/m-p/899306#M54886</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-05-28T07:22:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to store Rawstring to itab &amp; 'strlen' not working for Rawstring ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-store-rawstring-to-itab-strlen-not-working-for-rawstring/m-p/899307#M54887</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;this is a follow up of a earlier thread, where the upload of binary string was discussed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="40941"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Raja&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 May 2005 07:30:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-store-rawstring-to-itab-strlen-not-working-for-rawstring/m-p/899307#M54887</guid>
      <dc:creator>athavanraja</dc:creator>
      <dc:date>2005-05-28T07:30:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to store Rawstring to itab &amp; 'strlen' not working for Rawstring ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-store-rawstring-to-itab-strlen-not-working-for-rawstring/m-p/899308#M54888</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oops...&lt;/P&gt;&lt;P&gt;So you guys are discussing this for quite some time and I just jumped into it...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ok..in that case it might work &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry, but not sure. I mean, the itab that you declared has a xstring ( Hexa String ) as the component. And then it is being downloaded as Binary.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does that work?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Ram&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 May 2005 08:31:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-store-rawstring-to-itab-strlen-not-working-for-rawstring/m-p/899308#M54888</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-05-28T08:31:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to store Rawstring to itab &amp; 'strlen' not working for Rawstring ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-store-rawstring-to-itab-strlen-not-working-for-rawstring/m-p/899309#M54889</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your timely response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We already solved it ourselves. Xstring works perfectly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Waylan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 May 2005 01:56:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-store-rawstring-to-itab-strlen-not-working-for-rawstring/m-p/899309#M54889</guid>
      <dc:creator>former_member54229</dc:creator>
      <dc:date>2005-05-30T01:56:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to store Rawstring to itab &amp; 'strlen' not working for Rawstring ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-store-rawstring-to-itab-strlen-not-working-for-rawstring/m-p/899310#M54890</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you mark the thread as answered and close it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Raja&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 May 2005 04:42:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-store-rawstring-to-itab-strlen-not-working-for-rawstring/m-p/899310#M54890</guid>
      <dc:creator>athavanraja</dc:creator>
      <dc:date>2005-05-30T04:42:07Z</dc:date>
    </item>
  </channel>
</rss>

