<?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 statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-statement/m-p/1047543#M88322</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;I cannot use offset since the char position is not always the same.&lt;/P&gt;&lt;P&gt;I'm not sure about the correct sintax...&lt;/P&gt;&lt;P&gt;I tried to as Alex suggested (use the field of the internal table to split), but it doesn't work...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"INTO expected after ENDLOOP." is the error message...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do I have to use comma in the list of target fields ?&lt;/P&gt;&lt;P&gt;Do I have to use colon before this list ?&lt;/P&gt;&lt;P&gt;my separator have to be between "" or '' (as in Alex's example)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Andreas, could you please provide me also the data declaration part in order to use your sample code?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 01 Dec 2005 12:39:23 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-12-01T12:39:23Z</dc:date>
    <item>
      <title>SPLIT statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-statement/m-p/1047538#M88317</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi my friends,&lt;/P&gt;&lt;P&gt;just a simple question for you expert ABAPers...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to pass info from an internal table (tb_sip) in which every line contains only one char field(250) to another internal table (tb_detsip) with specific fields (chars and numbers).&lt;/P&gt;&lt;P&gt;I'm trying to use this code:&lt;/P&gt;&lt;P&gt;LOOP AT tb_sip.&lt;/P&gt;&lt;P&gt;  SPLIT tb_sip AT ";" INTO tb_detsip-field1, &lt;/P&gt;&lt;P&gt;                           tb_detsip-field2,&lt;/P&gt;&lt;P&gt;                           (...).&lt;/P&gt;&lt;P&gt;APPEND tb_detsip.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clearly this is not correct (and clearly I'm not an ABAPer) !&lt;/P&gt;&lt;P&gt;Could you please provide some sample code ready-to-use ?&lt;/P&gt;&lt;P&gt;Thanks in advance to everyone!&lt;/P&gt;&lt;P&gt;Bye,&lt;/P&gt;&lt;P&gt;Roberto&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Dec 2005 12:21:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-statement/m-p/1047538#M88317</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-01T12:21:03Z</dc:date>
    </item>
    <item>
      <title>Re: SPLIT statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-statement/m-p/1047539#M88318</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; Use offset if charater position if fixed all time.&lt;/P&gt;&lt;P&gt; and then use MOVE-CORRESPONING Statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Amey&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Dec 2005 12:27:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-statement/m-p/1047539#M88318</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-01T12:27:24Z</dc:date>
    </item>
    <item>
      <title>Re: SPLIT statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-statement/m-p/1047540#M88319</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are u getting any wrong results...&lt;/P&gt;&lt;P&gt;but what ever you did is correct..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can you give some sample data..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Dec 2005 12:29:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-statement/m-p/1047540#M88319</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-01T12:29:00Z</dc:date>
    </item>
    <item>
      <title>Re: SPLIT statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-statement/m-p/1047541#M88320</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try to pass the name of your field in the iternal table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at  tb_sip&lt;/P&gt;&lt;P&gt;  SPLIT tb_sip-line AT ';' INTO tg_entrada-tipo&lt;/P&gt;&lt;P&gt;                                  tb_detsip-field1 &lt;/P&gt;&lt;P&gt;                                  tb_detsip-field2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  APPEND tg_detsip .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;Alexandre Nogueira&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Dec 2005 12:29:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-statement/m-p/1047541#M88320</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-01T12:29:49Z</dc:date>
    </item>
    <item>
      <title>Re: SPLIT statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-statement/m-p/1047542#M88321</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;&lt;/P&gt;&lt;P&gt;try that:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: BEGIN OF SPTAB OCCURS   0,
        line(1000), " or type string
      END OF SPTAB.
DATA: IDX LIKE SY-INDEX.
field-symbols  &amp;lt;FS1&amp;gt;.     

split tb_sip AT ';' INTO table sptab.

LOOP AT SPTAB.

IDX = IDX + 1.

ASSIGN COMPONENT IDX OF STRUCTURE tb_detsip TO &amp;lt;FS1&amp;gt;.
If sy-subrc = 0.
&amp;lt;FS1&amp;gt; = SPTAB-line.
Endif.
Endloop.
append tb_detsip.
clear idx.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards Andreas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Dec 2005 12:32:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-statement/m-p/1047542#M88321</guid>
      <dc:creator>andreas_mann3</dc:creator>
      <dc:date>2005-12-01T12:32:55Z</dc:date>
    </item>
    <item>
      <title>Re: SPLIT statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-statement/m-p/1047543#M88322</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;I cannot use offset since the char position is not always the same.&lt;/P&gt;&lt;P&gt;I'm not sure about the correct sintax...&lt;/P&gt;&lt;P&gt;I tried to as Alex suggested (use the field of the internal table to split), but it doesn't work...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"INTO expected after ENDLOOP." is the error message...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do I have to use comma in the list of target fields ?&lt;/P&gt;&lt;P&gt;Do I have to use colon before this list ?&lt;/P&gt;&lt;P&gt;my separator have to be between "" or '' (as in Alex's example)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Andreas, could you please provide me also the data declaration part in order to use your sample code?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Dec 2005 12:39:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-statement/m-p/1047543#M88322</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-01T12:39:23Z</dc:date>
    </item>
    <item>
      <title>Re: SPLIT statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-statement/m-p/1047544#M88323</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Roberto,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1 one way using split and field symbols.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. just try this code (copy and paste)&lt;/P&gt;&lt;P&gt;   and see the value of table MYITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : str(256) TYPE c.&lt;/P&gt;&lt;P&gt;DATA : BEGIN OF myitab OCCURS 0,&lt;/P&gt;&lt;P&gt;       matnr LIKE mara-matnr,&lt;/P&gt;&lt;P&gt;       pernr LIKE p0001-pernr,&lt;/P&gt;&lt;P&gt;       bukrs LIKE t001-bukrs,&lt;/P&gt;&lt;P&gt;       END OF myitab.&lt;/P&gt;&lt;P&gt;DATA : BEGIN OF mysplit OCCURS 0,&lt;/P&gt;&lt;P&gt;       myfield(10) TYPE c,&lt;/P&gt;&lt;P&gt;       END OF mysplit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS : &amp;lt;w&amp;gt; TYPE ANY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="--------" /&gt;&lt;P&gt;str = 'abc;00056;ghi'.&lt;/P&gt;&lt;P&gt;SPLIT str AT ';' INTO  TABLE mysplit.&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---------------" /&gt;&lt;P&gt;LOOP AT mysplit.&lt;/P&gt;&lt;P&gt;  ASSIGN COMPONENT sy-tabix OF STRUCTURE myitab TO &amp;lt;w&amp;gt;.&lt;/P&gt;&lt;P&gt;  IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;    &amp;lt;w&amp;gt; = mysplit.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;break-point.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Amit M.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Dec 2005 12:51:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-statement/m-p/1047544#M88323</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-01T12:51:42Z</dc:date>
    </item>
    <item>
      <title>Re: SPLIT statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-statement/m-p/1047545#M88324</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just with some correction, but here is the right code (Andreas'suggestion) !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT tb_sip.&lt;/P&gt;&lt;P&gt;    SPLIT tb_sip-all AT ';' INTO TABLE tb_split.&lt;/P&gt;&lt;P&gt;    LOOP AT tb_split.&lt;/P&gt;&lt;P&gt;      idx = idx + 1.&lt;/P&gt;&lt;P&gt;      ASSIGN COMPONENT idx OF STRUCTURE tb_detsip TO &amp;lt;fs1&amp;gt;.&lt;/P&gt;&lt;P&gt;      IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;        &amp;lt;fs1&amp;gt; = tb_split-line.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;    ENDLOOP.&lt;/P&gt;&lt;P&gt;    APPEND tb_detsip.&lt;/P&gt;&lt;P&gt;    CLEAR idx.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks to all !!!&lt;/P&gt;&lt;P&gt;Bye,&lt;/P&gt;&lt;P&gt;Roberto&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Dec 2005 15:46:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-statement/m-p/1047545#M88324</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-01T15:46:46Z</dc:date>
    </item>
  </channel>
</rss>

