<?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: Problem convert string to table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-convert-string-to-table/m-p/7998504#M1606438</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What do the dumps say?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 31 May 2011 18:58:13 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-05-31T18:58:13Z</dc:date>
    <item>
      <title>Problem convert string to table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-convert-string-to-table/m-p/7998503#M1606437</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a long string in &lt;STRONG&gt;BASE64&lt;/STRONG&gt;, using the FM &lt;STRONG&gt;SSFC_BASE64_DECODE&lt;/STRONG&gt;, I'm able to decode the base64 string to a normal string.&lt;/P&gt;&lt;P&gt;Now, the problem is that i need to convert that long string into a table and then save it as .pdf in the local pc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried using the FM &lt;STRONG&gt;CONVERT_STRING_TO_TABLE&lt;/STRONG&gt; but it gives me a dump. This is the code that i have. The w_result is the string in base64 that i get from a webservice.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: w_result TYPE string, 
        fic_binario TYPE xstring.
DATA: string_binario TYPE string.

  DATA: BEGIN OF lines OCCURS 100,
  tdline(1024) TYPE x.
  DATA: END OF lines.

  CALL FUNCTION 'SSFC_BASE64_DECODE'
    EXPORTING
      b64data = w_result
    IMPORTING
      bindata = fic_binario.

  string_binario = fic_binario.

* Dump
  CALL FUNCTION 'CONVERT_STRING_TO_TABLE'
    EXPORTING
      i_string         = string_binario
      i_tabline_length = 1024
    TABLES
      et_table         = lines.

* Also i tried this: DUMP as well

  DATA: lv_divisor TYPE i,
  lv_resto TYPE i,
  lv_longitud TYPE i,
  lv_indice TYPE i.

  DO.

    lv_longitud = STRLEN( string_binario ).

    lv_divisor = lv_longitud DIV 256.
    lv_resto = lv_longitud DIV 256.

    lv_indice = 256 * sy-index.

    lines-tdline = string_binario+lv_indice(256).

    APPEND lines.
    CLEAR lines.

    IF lv_divisor IS INITIAL.

      EXIT.

    ENDIF.

  ENDDO.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can i convert that string that I get from the FM &lt;STRONG&gt;SSFC_BASE64_DECODE&lt;/STRONG&gt; to a table??? so then i can download it to a local pc????&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 May 2011 18:54:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-convert-string-to-table/m-p/7998503#M1606437</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-05-31T18:54:41Z</dc:date>
    </item>
    <item>
      <title>Re: Problem convert string to table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-convert-string-to-table/m-p/7998504#M1606438</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What do the dumps say?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 May 2011 18:58:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-convert-string-to-table/m-p/7998504#M1606438</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-05-31T18:58:13Z</dc:date>
    </item>
    <item>
      <title>Re: Problem convert string to table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-convert-string-to-table/m-p/7998505#M1606439</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rob the dump says:&lt;/P&gt;&lt;P&gt; The statement                                                           &lt;/P&gt;&lt;P&gt; "MOVE src TO dst"                                                    &lt;/P&gt;&lt;P&gt; requires that the operands "dst" and "src" are convertible.             &lt;/P&gt;&lt;P&gt; Since this statement is in a Unicode program, the special conversion    &lt;/P&gt;&lt;P&gt; rules for Unicode programs apply.                                       &lt;/P&gt;&lt;P&gt; In this case, these rules were violated.                                &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Err.tmpo.ejec.         UC_OBJECTS_NOT_CONVERTIBLE                &lt;/P&gt;&lt;P&gt;Fecha y hora           31.05.2011 14:57:44                       &lt;/P&gt;&lt;P&gt; Texto breve                                                     &lt;/P&gt;&lt;P&gt;     Data objects in Unicode programs cannot be converted.       &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
   1 FUNCTION CONVERT_STRING_TO_TABLE.                      
   2 *"-----------------------------------------------------
   3 *"*"Local interface:                                   
   4 *"  IMPORTING                                          
   5 *"     REFERENCE(I_STRING) TYPE  STRING                
   6 *"     VALUE(I_TABLINE_LENGTH) TYPE  I                 
   7 *"  TABLES                                             
   8 *"      ET_TABLE TYPE  TABLE                           
   9 *"-----------------------------------------------------
  10                                                        
  11   data: l_length      type i,                          
  12         l_offset      type i,                          
  13         l_full_lines  type i,                          
  14         l_last_length type i.                          
  15                                                        
  16 * get string length                                    
  17   l_length = strlen( i_string ).                       
  18 * get number of full lines                             
  19   l_full_lines  = l_length div i_tabline_length.       
  20 * get length of last line                              
  21   l_last_length = l_length mod i_tabline_length.       
  22                                                        
  23 * append full lines to output table                    
  24   do l_full_lines times.                               
&amp;gt;&amp;gt;&amp;gt;&amp;gt;     et_table = i_string+l_offset(i_tabline_length).    
  26     append et_table.                                   
  27     l_offset = l_offset + i_tabline_length.            
  28   enddo.                                               
  29                                                        
  30 * append last line to output table                     
  31   et_table = i_string+l_offset(l_last_length).         
  32   append et_table.                                     
  33                                                        
  34 ENDFUNCTION.                                           

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is a 5,000 character posting limit to individual posts. Put the other dump in anoter response please.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After the SY-TABIX = 615&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I dont know why it looks very bad format, no idea, I tried to write it again, but it looks the same-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Rob Burbank on May 31, 2011 3:05 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 May 2011 19:02:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-convert-string-to-table/m-p/7998505#M1606439</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-05-31T19:02:52Z</dc:date>
    </item>
    <item>
      <title>Re: Problem convert string to table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-convert-string-to-table/m-p/7998506#M1606440</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How is the variable you are passing to TABLE defined?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 May 2011 19:09:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-convert-string-to-table/m-p/7998506#M1606440</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-05-31T19:09:13Z</dc:date>
    </item>
    <item>
      <title>Re: Problem convert string to table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-convert-string-to-table/m-p/7998507#M1606441</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;the variable string_binario contains the value after i decode the string in base64. Until there, it seems to be ok. That variable is a string that containes the info, that must be convert in a table and then download to a local pc in .pdf&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  DATA: BEGIN OF lines OCCURS 100,
  tdline(1024) TYPE x.
  DATA: END OF lines.

  DATA: string_binario TYPE string.

  CALL FUNCTION 'CONVERT_STRING_TO_TABLE'
    EXPORTING
      i_string         = string_binario
      i_tabline_length = 1024
    TABLES
      et_table         = lines.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;other option is&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  DATA: lv_divisor TYPE i,
  lv_resto TYPE i,
  lv_longitud TYPE i,
  lv_indice TYPE i.

  DO.

    lv_longitud = STRLEN( string_binario ).

    lv_divisor = lv_longitud DIV 256.
    lv_resto = lv_longitud DIV 256.

    lv_indice = 256 * sy-index.

    lines-tdline = string_binario+lv_indice(255).

    APPEND lines.
    CLEAR lines.

    IF lv_divisor IS INITIAL.

      EXIT.

    ENDIF.

  ENDDO.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but this option also gives me a dump.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 May 2011 19:14:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-convert-string-to-table/m-p/7998507#M1606441</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-05-31T19:14:07Z</dc:date>
    </item>
    <item>
      <title>Re: Problem convert string to table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-convert-string-to-table/m-p/7998508#M1606442</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;the dumps that gives me the second option is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Errores tiempo ejec.   STRING_OFFSET_LENGTH_TOO_LARGE       &lt;/P&gt;&lt;P&gt;Excepción              CX_SY_RANGE_OUT_OF_BOUNDS            &lt;/P&gt;&lt;P&gt;Fecha y hora           31.05.2011 15:00:17                                                                                &lt;/P&gt;&lt;P&gt;Texto breve                                                &lt;/P&gt;&lt;P&gt;     Illegal access to a string (offset+length too large)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  An exception occurred that is explained in detail below.                         &lt;/P&gt;&lt;P&gt;  The exception, which is assigned to class 'CX_SY_RANGE_OUT_OF_BOUNDS', was not   &lt;/P&gt;&lt;P&gt;   caught and                                                                      &lt;/P&gt;&lt;P&gt;  therefore caused a runtime error.                                                &lt;/P&gt;&lt;P&gt;  The reason for the exception is:                                                 &lt;/P&gt;&lt;P&gt;  In the running program "ZTEST003", part of a string was about to be accessed     &lt;/P&gt;&lt;P&gt;  via offset and length.                                                           &lt;/P&gt;&lt;P&gt;  However, the total of offset (157696) and length (255) exceeded the current      &lt;/P&gt;&lt;P&gt;   length of the string (157874).                                                  &lt;/P&gt;&lt;P&gt;  This kind of access is illegal.                                                  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the dump is getting after the sy-tabix = 615&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 May 2011 19:15:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-convert-string-to-table/m-p/7998508#M1606442</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-05-31T19:15:51Z</dc:date>
    </item>
    <item>
      <title>Re: Problem convert string to table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-convert-string-to-table/m-p/7998509#M1606443</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Change:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;tdline(1024) TYPE x.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;to&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;tdline TYPE string&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 May 2011 19:22:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-convert-string-to-table/m-p/7998509#M1606443</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-05-31T19:22:21Z</dc:date>
    </item>
    <item>
      <title>Re: Problem convert string to table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-convert-string-to-table/m-p/7998510#M1606444</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;if i change that, and using the FM * CONVERT_STRING_TO_TABLE*&lt;/P&gt;&lt;P&gt;it gives me a dump:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Err.tmpo.ejec.         OBJECTS_MOVE_NOT_SUPPORTED          &lt;/P&gt;&lt;P&gt;Fecha y hora           31.05.2011 15:22:47                                                                           &lt;/P&gt;&lt;P&gt; Texto breve                                               &lt;/P&gt;&lt;P&gt;     Conversion of type "g" to type "v" not supported.     &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     You attempted to move one data object to another.                        &lt;/P&gt;&lt;P&gt;     This is not possible here because the conversion of a data object        &lt;/P&gt;&lt;P&gt;     of type "g" to type "v" is not supported.                                                                                &lt;/P&gt;&lt;P&gt;Posición desencadenante de error tiempo ejecución                            &lt;/P&gt;&lt;P&gt;     Programa                                SAPLHR_GB_EF_OUTG                &lt;/P&gt;&lt;P&gt;     Include                                 LHR_GB_EF_OUTGU02                &lt;/P&gt;&lt;P&gt;     Línea                                   25                               &lt;/P&gt;&lt;P&gt;     Tp.módulo                               (FUNCTION)                       &lt;/P&gt;&lt;P&gt;     Nombre módulo                           CONVERT_STRING_TO_TABLE          &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm going to check with the another option to see how it works....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I used the second option and it pass without dumps.&lt;/P&gt;&lt;P&gt;but i can't open the file&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = 'C:Fichero100.pdf'
TABLES
DATA_TAB = lines .
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the acrobat says that the file is damage...&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 May 2011 19:28:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-convert-string-to-table/m-p/7998510#M1606444</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-05-31T19:28:13Z</dc:date>
    </item>
    <item>
      <title>Re: Problem convert string to table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-convert-string-to-table/m-p/7998511#M1606445</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;mistake&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the same, it doesnt work.&lt;/P&gt;&lt;P&gt;sorry, but i did what u said and it didnt work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 May 2011 19:30:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-convert-string-to-table/m-p/7998511#M1606445</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-05-31T19:30:33Z</dc:date>
    </item>
    <item>
      <title>Re: Problem convert string to table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-convert-string-to-table/m-p/7998512#M1606446</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if i use the second option, the dumps says:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; An exception occurred that is explained in detail below.                          &lt;/P&gt;&lt;P&gt; The exception, which is assigned to class 'CX_SY_RANGE_OUT_OF_BOUNDS', was not    &lt;/P&gt;&lt;P&gt;  caught and                                                                       &lt;/P&gt;&lt;P&gt; therefore caused a runtime error.                                                 &lt;/P&gt;&lt;P&gt; The reason for the exception is:                                                  &lt;/P&gt;&lt;P&gt; In the running program "ZTEST003", part of a string was about to be accessed      &lt;/P&gt;&lt;P&gt; via offset and length.                                                            &lt;/P&gt;&lt;P&gt; However, the total of offset (157696) and length (256) exceeded the current       &lt;/P&gt;&lt;P&gt;  length of the string (157874).                                                   &lt;/P&gt;&lt;P&gt; This kind of access is illegal.                                                   &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;using the tdline type string. same as the another tdline(1024) type x.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 May 2011 19:32:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-convert-string-to-table/m-p/7998512#M1606446</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-05-31T19:32:01Z</dc:date>
    </item>
    <item>
      <title>Re: Problem convert string to table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-convert-string-to-table/m-p/7998513#M1606447</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;the variable string_binario has sth like this : 255044462D312E330D0A25F6E4FCDF0D0A312030206F626A0D0A3C3C0D0A2F54797065202F436174616C6F670D0A2F50616765732032203020520D0A3E3E0D0A656E646F626A0D0A332030.............&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but i can't get it full, even i debbug the program, i can't get the whole value of the variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 May 2011 19:45:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-convert-string-to-table/m-p/7998513#M1606447</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-05-31T19:45:10Z</dc:date>
    </item>
    <item>
      <title>Re: Problem convert string to table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-convert-string-to-table/m-p/7998514#M1606448</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;    Write like the below :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA: lv_divisor TYPE i,&lt;/P&gt;&lt;P&gt;  lv_resto TYPE i,&lt;/P&gt;&lt;P&gt;  lv_longitud TYPE i,&lt;/P&gt;&lt;P&gt;  lv_temp_length type i,&lt;/P&gt;&lt;P&gt;lv_remaining type i,&lt;/P&gt;&lt;P&gt;  lv_indice TYPE i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  lv_longitud = STRLEN( string_binario ).&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  DO.&lt;/P&gt;&lt;P&gt;   &lt;/P&gt;&lt;P&gt;    clear : lv_temp_length.&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;    lv_indice = 256 * sy-index.&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;    lv_temp_length =  lv_indice + 256.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    if lv_temp_length &amp;lt; lv_longitud.&lt;/P&gt;&lt;P&gt;      lines-tdline = string_binario+lv_indice(256).&lt;/P&gt;&lt;P&gt;    else.&lt;/P&gt;&lt;P&gt;      lv_remaining = lv_temp_length - lv_longitud.&lt;/P&gt;&lt;P&gt;      lines-tdline = string_binario+lv_indice(lv_remaining).&lt;/P&gt;&lt;P&gt;          APPEND lines.&lt;/P&gt;&lt;P&gt;    CLEAR lines.&lt;/P&gt;&lt;P&gt;      exit.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;    APPEND lines.&lt;/P&gt;&lt;P&gt;    CLEAR lines.&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;  ENDDO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Srini.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jun 2011 04:25:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-convert-string-to-table/m-p/7998514#M1606448</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-01T04:25:05Z</dc:date>
    </item>
    <item>
      <title>Re: Problem convert string to table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-convert-string-to-table/m-p/7998515#M1606449</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Miguel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once you have the binary in the XSTRING, you could convert that into a table and download using GUI_DOWNLOAD.&lt;/P&gt;&lt;P&gt;Check with the below code, no need to put it in a string just to use the FM "CONVERT&lt;STRONG&gt;STRING&lt;/STRONG&gt;TO&lt;STRONG&gt;TABLE&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  DATA: li_contents         TYPE TABLE OF sdokcntbin,
        lw_contents         TYPE sdokcntbin,
        l_file_length       TYPE i,
        l_flag              TYPE c,
        l_off               TYPE i,
        l_len               TYPE i.

  TRY.
      l_len = XSTRLEN( fic_binario ).
      l_file_length = l_len.

      WHILE l_flag IS INITIAL.

        IF l_len LE 1022.
          lw_contents-line = fic_binario+l_off(l_len).
          l_flag = 'X'.
        ELSE.
          lw_contents-line = fic_binario+l_off(1022).
          l_off = l_off + 1022.
          l_len = l_len - 1022.
        ENDIF.

        APPEND lw_contents TO li_contents.

      ENDWHILE.

* Download the ITAB li_contents[].
endtry.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: When you are downloading with GUI_DOWNLOAD, you &lt;STRONG&gt;might&lt;/STRONG&gt; (not that you should) need to use a corresponding codepage.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Reasons for the short dump you are getting,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"MOVE src TO dst"&lt;/P&gt;&lt;P&gt;requires that the operands "dst" and "src" are convertible. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF lines OCCURS 100,&lt;/P&gt;&lt;P&gt;  tdline(1024) TYPE x.&lt;/P&gt;&lt;P&gt;  DATA: END OF lines.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have defined the lines table as that of raw, while internally the convert to string FM expects a string/char type table, change the above data definition to &lt;STRONG&gt;C&lt;/STRONG&gt; instead of &lt;STRONG&gt;X&lt;/STRONG&gt; and the FM will work fine, but the data will not be valid to be opened as a PDF anymore i guess.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Errores tiempo ejec. STRING_OFFSET_LENGTH_TOO_LARGE&lt;/P&gt;&lt;P&gt;Excepción CX_SY_RANGE_OUT_OF_BOUNDS &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think the above dump is because of the below line, here you have hardcoded the offset value, which will work fine till the last subset of the string is reached, and if the last subset happens to be less than 255 characters, the offset becomes too large.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;lines-tdline = string_binario+lv_indice(255).&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Chen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Chen K V on Jun 1, 2011 1:48 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Chen K V on Jun 1, 2011 1:53 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jun 2011 07:54:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-convert-string-to-table/m-p/7998515#M1606449</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-01T07:54:01Z</dc:date>
    </item>
    <item>
      <title>Re: Problem convert string to table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-convert-string-to-table/m-p/7998516#M1606450</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did what u said and it works, thanks very much.&lt;/P&gt;&lt;P&gt;Also, i use &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        filename = 'C:\Fichero100.pdf'
        filetype = 'BIN'
      TABLES
        data_tab = li_contents.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;without filetype = 'BIN' the .PDF file doesnt work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I dont know why, the website doesnt show me the option to give points....any clue???&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm going to have it, just the website doesnt show me that...when i figuret out, i will do it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks to all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jun 2011 13:27:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-convert-string-to-table/m-p/7998516#M1606450</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-01T13:27:35Z</dc:date>
    </item>
  </channel>
</rss>

