<?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: read data from application server in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-data-from-application-server/m-p/3392758#M814673</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Ananad&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Perhaps there are tricks available to upload such an Excel sheet directly into SAP. However, I would recommend to use a &lt;STRONG&gt;.csv file&lt;/STRONG&gt; instead since it will simplify the task rigorously.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Define an internal table with the line structure of your record, i.e.:&lt;/P&gt;&lt;P&gt;pri,pric,prit,vfro,vto,frbl &amp;amp; pamt&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Define a second itab of table type TRUXS_T_TEXT_DATA (NOTE: requires TYPE-POOL: TRUXS).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steps:&lt;/P&gt;&lt;P&gt;1. Read your .csv file into the unstructured itab (2nd itab)&lt;/P&gt;&lt;P&gt;2. Convert unstructured records into structured record (1st itab)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: gt_data_raw   TYPE TRUXS_T_TEXT_DATA,
          gd_data_raw  LIKE LINE OF gt_data_raw,
          gt_data         TYPE STANDARD TABLE OF z_my_structure.  " could be type definition as well


OPEN DATASET gd_csvfile FOR INPUT IN TEXT MODE ENCODING DEFAULT.
CHECK ( sy-subrc = 0 ).

REFRESH: gt_data_raw.
DO.
  READ DATASET gd_csvfile INTO gd_data_raw.
  IF ( syst-subrc NE 0 ).
    EXIT.
  ENDIF.

  APPEND gd_data_raw TO gt_data_raw.
ENDDO.

CLOSE DATASET gd_csvfile.

 CALL FUNCTION 'TEXT_CONVERT_CSV_TO_SAP'
   EXPORTING
     i_tab_raw_data = gt_data_raw  " unstructured record
   TABLES
      i_tab_converted_data = gt_data. " structured record
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 08 Feb 2008 04:43:54 GMT</pubDate>
    <dc:creator>uwe_schieferstein</dc:creator>
    <dc:date>2008-02-08T04:43:54Z</dc:date>
    <item>
      <title>read data from application server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-data-from-application-server/m-p/3392757#M814672</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gurus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have to read an excel sheet from application server into internal table.the excel sheet has 7 fields.out of the 7 fields four fields have multiple data entries.how to read all into a single internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;E.g.&lt;/P&gt;&lt;P&gt;let us suppose the fields are &lt;/P&gt;&lt;P&gt;pri,pric,prit,vfro,vto,frbl &amp;amp; pamt.&lt;/P&gt;&lt;P&gt;out of these in vfro,vto,frbl &amp;amp; pamt the data is repeated for the same set of data in pri,pric,prit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So can you tell me how to populate the iternal table with syntax and the same example?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All replies will be rewarded.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Feb 2008 04:19:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-data-from-application-server/m-p/3392757#M814672</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-08T04:19:57Z</dc:date>
    </item>
    <item>
      <title>Re: read data from application server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-data-from-application-server/m-p/3392758#M814673</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Ananad&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Perhaps there are tricks available to upload such an Excel sheet directly into SAP. However, I would recommend to use a &lt;STRONG&gt;.csv file&lt;/STRONG&gt; instead since it will simplify the task rigorously.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Define an internal table with the line structure of your record, i.e.:&lt;/P&gt;&lt;P&gt;pri,pric,prit,vfro,vto,frbl &amp;amp; pamt&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Define a second itab of table type TRUXS_T_TEXT_DATA (NOTE: requires TYPE-POOL: TRUXS).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steps:&lt;/P&gt;&lt;P&gt;1. Read your .csv file into the unstructured itab (2nd itab)&lt;/P&gt;&lt;P&gt;2. Convert unstructured records into structured record (1st itab)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: gt_data_raw   TYPE TRUXS_T_TEXT_DATA,
          gd_data_raw  LIKE LINE OF gt_data_raw,
          gt_data         TYPE STANDARD TABLE OF z_my_structure.  " could be type definition as well


OPEN DATASET gd_csvfile FOR INPUT IN TEXT MODE ENCODING DEFAULT.
CHECK ( sy-subrc = 0 ).

REFRESH: gt_data_raw.
DO.
  READ DATASET gd_csvfile INTO gd_data_raw.
  IF ( syst-subrc NE 0 ).
    EXIT.
  ENDIF.

  APPEND gd_data_raw TO gt_data_raw.
ENDDO.

CLOSE DATASET gd_csvfile.

 CALL FUNCTION 'TEXT_CONVERT_CSV_TO_SAP'
   EXPORTING
     i_tab_raw_data = gt_data_raw  " unstructured record
   TABLES
      i_tab_converted_data = gt_data. " structured record
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Feb 2008 04:43:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-data-from-application-server/m-p/3392758#M814673</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2008-02-08T04:43:54Z</dc:date>
    </item>
    <item>
      <title>Re: read data from application server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-data-from-application-server/m-p/3392759#M814674</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;Can you give a reply for the same question but if the file is from the presentation serrver?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will reward points.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Feb 2008 04:54:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-data-from-application-server/m-p/3392759#M814674</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-08T04:54:38Z</dc:date>
    </item>
    <item>
      <title>Re: read data from application server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-data-from-application-server/m-p/3392760#M814675</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Anand&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Simply provide a filename ( &lt;STRONG&gt;I_FILENAME&lt;/STRONG&gt; ) instead of the itab containing the raw data.&lt;/P&gt;&lt;P&gt;For a sample have a look at &lt;SPAN __jive_macro_name="thread" id="417158"&gt;&lt;/SPAN&gt;&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;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Feb 2008 05:49:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-data-from-application-server/m-p/3392760#M814675</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2008-02-08T05:49:40Z</dc:date>
    </item>
  </channel>
</rss>

