<?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 Into Table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-into-table/m-p/4898060#M1143965</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA : gt_fee TYPE standard table of tt_fee.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and try to use &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data: wa_fee type gt_fee.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 15 Dec 2008 18:48:29 GMT</pubDate>
    <dc:creator>former_member156446</dc:creator>
    <dc:date>2008-12-15T18:48:29Z</dc:date>
    <item>
      <title>Split Into Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-into-table/m-p/4898058#M1143963</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;how can i append data into internal table when spliting a record ?&lt;/P&gt;&lt;P&gt;The following code gets me an error : gt_fee has no header line, if i do not append only the las line stays inside the itab. &lt;/P&gt;&lt;P&gt;I tried doing it with a work area but couldn't make it work&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TYPES : BEGIN OF ts_fee,
          date	TYPE	zz_date	,
          id_prod	TYPE	zz_id_	,
          id_abonne	TYPE	bu_id_number	,
          code_postal	TYPE	post_code	,
          .......
  END OF ts_fee.
TYPES : tt_fee TYPE TABLE OF ts_fee.
DATA : gt_fee TYPE tt_fee.
DATA : wa_fee LIKE LINE OF gt_fee.

OPEN DATASET file FOR INPUT IN TEXT MODE ENCODING DEFAULT.

DO.
  READ DATASET file INTO ligne.
  IF sy-subrc = 0.
    SPLIT ligne AT ';' INTO table gt_fee.
    append gt_fee.
    ASSIGN gt_fee TO &amp;lt;fs_fee&amp;gt;.
  ELSE.
    EXIT.
  ENDIF.
ENDDO.
CLOSE DATASET file.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Matt on Dec 15, 2008 8:17 PM changed title&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Dec 2008 18:42:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-into-table/m-p/4898058#M1143963</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-15T18:42:13Z</dc:date>
    </item>
    <item>
      <title>Re: Split Into Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-into-table/m-p/4898059#M1143964</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this way&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DO.
  READ DATASET file INTO ligne.
  IF sy-subrc = 0.
    SPLIT ligne AT ';' INTO table gt_fee.
    append gt_fee to tt_fee. "&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt; ----
    ASSIGN gt_fee TO &amp;lt;fs_fee&amp;gt;.
  ELSE.
    EXIT.
  ENDIF.
ENDDO.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Dec 2008 18:47:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-into-table/m-p/4898059#M1143964</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2008-12-15T18:47:30Z</dc:date>
    </item>
    <item>
      <title>Re: Split Into Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-into-table/m-p/4898060#M1143965</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA : gt_fee TYPE standard table of tt_fee.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and try to use &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data: wa_fee type gt_fee.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Dec 2008 18:48:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-into-table/m-p/4898060#M1143965</guid>
      <dc:creator>former_member156446</dc:creator>
      <dc:date>2008-12-15T18:48:29Z</dc:date>
    </item>
    <item>
      <title>Re: Split Into Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-into-table/m-p/4898061#M1143966</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tables with header lines has been seen by SAP, in the last ten years, to be very bad programming practice - this is why it isn't allowed in Object Oriented contexts.  It seems to me that you are getting confused because you are used to tables with header lines.  Do yourself a favour and totally forget about tables with header lines.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TYPES : BEGIN OF ts_fee,
          date	TYPE	zz_date	,
          id_prod	TYPE	zz_id_	,
          id_abonne	TYPE	bu_id_number	,
          code_postal	TYPE	post_code	,
          .......
  END OF ts_fee.  " You've now defined a structure type

TYPES : tt_fee TYPE TABLE OF ts_fee. " You've now defined a type that is a table of your structure

DATA : gt_fee TYPE tt_fee. "  Now you have a variable that is a table
DATA : wa_fee LIKE LINE OF gt_fee. " Now you have a work area - its type is like  record of the table
 
OPEN DATASET file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
 
DO.
  READ DATASET file INTO ligne.
  IF sy-subrc = 0.
    SPLIT ligne AT ';' INTO table gt_fee. " You've split the ligne, so each field is a seperate RECORD of gt_fee
    append gt_fee.  " gt_fee is a TABLE, what are you wanting to append it to?
    ASSIGN gt_fee TO &amp;lt;fs_fee&amp;gt;.
  ELSE.
    EXIT.
  ENDIF.
ENDDO.
CLOSE DATASET file.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You must go and READ the F1 help on SPLIT ... AT ... INTO TABLE...  see what type the table should have.  It's really really important to know and understand at all times what the structure of your data is.  Try to visualise it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you've split "ligne" into a table, then you'll have to loop through that table to find out what the value of each field on that line is.  Before you continue with this problem, read the F1 Help, the ABAP HELP on SPLIT, and play around with the command.  Until you understand how it works, fully, don't try to fix your problem.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Dec 2008 19:27:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-into-table/m-p/4898061#M1143966</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2008-12-15T19:27:53Z</dc:date>
    </item>
    <item>
      <title>Re: Split Into Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-into-table/m-p/4898062#M1143967</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, &lt;/P&gt;&lt;P&gt;i allready looked at the F1 Help but while testing the split instruction i understood that it was spliting my line in several table lines and not columns as i thought&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Dec 2008 15:47:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-into-table/m-p/4898062#M1143967</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-16T15:47:48Z</dc:date>
    </item>
  </channel>
</rss>

