<?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: Split internal table field at length. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-internal-table-field-at-length/m-p/12053095#M1968860</link>
    <description>&lt;P&gt; @&lt;A href="https://answers.sap.com/users/1091/sandra.rossi.html"&gt;Sandra Rossi&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Oh I'm sorry I didn't know that.&lt;/P&gt;&lt;P&gt;I just tried this and it worked for me so I made it best answer.&lt;/P&gt;</description>
    <pubDate>Wed, 04 Dec 2019 13:57:09 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2019-12-04T13:57:09Z</dc:date>
    <item>
      <title>Split internal table field at length.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-internal-table-field-at-length/m-p/12053088#M1968853</link>
      <description>&lt;P&gt;Hello friends,&lt;/P&gt;
  &lt;P&gt;I want to split a internal table field at the 10th charakter into two strings. (first string gets the first 10 charakters second gets the rest)&lt;/P&gt;
  &lt;P&gt;Is it possible to do this with SPLIT? &lt;/P&gt;
  &lt;P&gt;Or is there a function module for this?&lt;/P&gt;
  &lt;P&gt;All of this happens in a loop with a field-symbol.&lt;/P&gt;
  &lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2019 10:45:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-internal-table-field-at-length/m-p/12053088#M1968853</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2019-12-04T10:45:34Z</dc:date>
    </item>
    <item>
      <title>Re: Split internal table field at length.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-internal-table-field-at-length/m-p/12053089#M1968854</link>
      <description>&lt;P&gt;Hello &lt;SPAN class="mention-scrubbed"&gt;teaman&lt;/SPAN&gt;,&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CALL FUNCTION 'TEXT_SPLIT'   
EXPORTING  
	length =  "  Length for split 
	text =  "  Input 
	as_character = 
IMPORTING
	line =  "  Result  
	rest =  "  Remaining text  .  


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Igor&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2019 10:55:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-internal-table-field-at-length/m-p/12053089#M1968854</guid>
      <dc:creator>IN</dc:creator>
      <dc:date>2019-12-04T10:55:46Z</dc:date>
    </item>
    <item>
      <title>Re: Split internal table field at length.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-internal-table-field-at-length/m-p/12053090#M1968855</link>
      <description>&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;Try like below.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TRY.
    data(lv1) = substring( val = lv_longtext off = 0 len = 10 ).
    data(lv2) = substring( val = lv_longtext off = 0 len = strlen( lv_teststring ) ).
CATCH cx_sy_range_out_of_bounds INTO DATA(lx_too_long).
    data(lv_error_lx_too_long) = lx_too_long-&amp;gt;get_text( ).
ENDTRY.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 04 Dec 2019 11:31:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-internal-table-field-at-length/m-p/12053090#M1968855</guid>
      <dc:creator>cdprasanna</dc:creator>
      <dc:date>2019-12-04T11:31:41Z</dc:date>
    </item>
    <item>
      <title>Re: Split internal table field at length.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-internal-table-field-at-length/m-p/12053091#M1968856</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;types: begin of type_1,
         field type text20,
       end   of type_1,
       tt_type_1 type standard table of type_1 with key field,


       begin of type_2,
         field1 type text10,
         field2 type text10,
       end   of type_2,
       tt_type_2 type standard table of type_2 with key field1 field2.



data(lt_table_1) = value tt_type_1( ( field = '0123456789abcdefghjk' )
                                    ( field = '0123456789abcdefghjk' ) ).
data(lt_table_2) = value tt_type_2( for ls_table_1 in lt_table_1 ( field1 = ls_table_1+0(10)
                                                                   field2 = ls_table_1+10(10) ) ).




cl_demo_output=&amp;gt;write_data( lt_table_1 ).
cl_demo_output=&amp;gt;write_data( lt_table_2 ).
cl_demo_output=&amp;gt;display( ).
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1755553-annotation-2.png" /&gt;&lt;/P&gt;&lt;P&gt;the important part is &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data(lt_table_2) = value tt_type_2( for ls_table_1 in lt_table_1 ( field1 = ls_table_1+0(10)
                                                                   field2 = ls_table_1+10(10) ) ).&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 04 Dec 2019 11:56:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-internal-table-field-at-length/m-p/12053091#M1968856</guid>
      <dc:creator>FredericGirod</dc:creator>
      <dc:date>2019-12-04T11:56:45Z</dc:date>
    </item>
    <item>
      <title>Re: Split internal table field at length.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-internal-table-field-at-length/m-p/12053092#M1968857</link>
      <description>&lt;P&gt;Thank you very much.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2019 12:07:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-internal-table-field-at-length/m-p/12053092#M1968857</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2019-12-04T12:07:30Z</dc:date>
    </item>
    <item>
      <title>Re: Split internal table field at length.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-internal-table-field-at-length/m-p/12053093#M1968858</link>
      <description>&lt;P&gt;&lt;A href="https://answers.sap.com/users/856727/teaman.html"&gt;Nils Bla&lt;/A&gt;&lt;/P&gt;&lt;P&gt;There is simply the assignment operator or ABAP built-in functions (as proposed in the other answers) which are much faster than calling a function module.&lt;/P&gt;&lt;P&gt;I think it's not the best answer.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2019 12:43:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-internal-table-field-at-length/m-p/12053093#M1968858</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2019-12-04T12:43:18Z</dc:date>
    </item>
    <item>
      <title>Re: Split internal table field at length.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-internal-table-field-at-length/m-p/12053094#M1968859</link>
      <description>&lt;P&gt;&lt;SPAN class="mention-scrubbed"&gt;teaman&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;You are welcome.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2019 13:17:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-internal-table-field-at-length/m-p/12053094#M1968859</guid>
      <dc:creator>IN</dc:creator>
      <dc:date>2019-12-04T13:17:17Z</dc:date>
    </item>
    <item>
      <title>Re: Split internal table field at length.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-internal-table-field-at-length/m-p/12053095#M1968860</link>
      <description>&lt;P&gt; @&lt;A href="https://answers.sap.com/users/1091/sandra.rossi.html"&gt;Sandra Rossi&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Oh I'm sorry I didn't know that.&lt;/P&gt;&lt;P&gt;I just tried this and it worked for me so I made it best answer.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2019 13:57:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-internal-table-field-at-length/m-p/12053095#M1968860</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2019-12-04T13:57:09Z</dc:date>
    </item>
    <item>
      <title>Re: Split internal table field at length.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-internal-table-field-at-length/m-p/12053096#M1968861</link>
      <description>&lt;P&gt;the important is to find an answer, when you have several choose the one you better understand. (to be able to maintain it)&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2019 14:06:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-internal-table-field-at-length/m-p/12053096#M1968861</guid>
      <dc:creator>FredericGirod</dc:creator>
      <dc:date>2019-12-04T14:06:38Z</dc:date>
    </item>
    <item>
      <title>Re: Split internal table field at length.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-internal-table-field-at-length/m-p/12053097#M1968862</link>
      <description>&lt;A href="https://answers.sap.com/users/856727/teaman.html"&gt;Nils Bla&lt;/A&gt; Sorry about my inappropriate words, you can't know what is the "best answer" of course. Look at the other answers eventually. The number of votes may be of some importance too.</description>
      <pubDate>Wed, 04 Dec 2019 15:59:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-internal-table-field-at-length/m-p/12053097#M1968862</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2019-12-04T15:59:40Z</dc:date>
    </item>
  </channel>
</rss>

