<?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 application server file length to internal table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/application-server-file-length-to-internal-table/m-p/6033669#M1349775</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i am having a flat file in the appliaction server and it is 350 characters length stored for each line.&lt;/P&gt;&lt;P&gt;i mean like purchase order,matner,material text, kunnr,customer address etc, this all will be 365 chars including spaces.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have decalred the file path like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;file(150) type c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so in file i store the physical path.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now i used the statement to read the data into by itab , which has all the fields of applicaion server file .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do &lt;/P&gt;&lt;P&gt;Read dataset file into waitab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF sy-subrc &amp;lt;&amp;gt; 0.&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 waitab TO itab.&lt;/P&gt;&lt;P&gt;    CLEAR waitab.&lt;/P&gt;&lt;P&gt;  ENDDO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1)My doubt is that&lt;/P&gt;&lt;P&gt;experts&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i am simply using Read dataset file into waitab. and i did not mentioned the lenght of the file anywhere in the program? Will the system move all the 365 chars into waitab?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or do i need to mention the lenght of the file?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2)Suppose my file is like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1212222  2283838 2839293  383839283 38e439 3u39393 3839839 383993 2837383  38739378  3u873983&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now my itab will be&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filed1(10),file2(7),field3(8),field4(7),filed5(8).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so in this case the first 10 chars of the file will be placed in field1,&lt;/P&gt;&lt;P&gt;next 7chars will be placed in field2, is it including spaces?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here my file lenght is more than the itab, in this case what will happen?Beacuse my need is to have file first line into one record of itab , second line into another record , etc?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 06 Aug 2009 01:38:16 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-08-06T01:38:16Z</dc:date>
    <item>
      <title>application server file length to internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/application-server-file-length-to-internal-table/m-p/6033669#M1349775</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i am having a flat file in the appliaction server and it is 350 characters length stored for each line.&lt;/P&gt;&lt;P&gt;i mean like purchase order,matner,material text, kunnr,customer address etc, this all will be 365 chars including spaces.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have decalred the file path like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;file(150) type c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so in file i store the physical path.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now i used the statement to read the data into by itab , which has all the fields of applicaion server file .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do &lt;/P&gt;&lt;P&gt;Read dataset file into waitab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF sy-subrc &amp;lt;&amp;gt; 0.&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 waitab TO itab.&lt;/P&gt;&lt;P&gt;    CLEAR waitab.&lt;/P&gt;&lt;P&gt;  ENDDO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1)My doubt is that&lt;/P&gt;&lt;P&gt;experts&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i am simply using Read dataset file into waitab. and i did not mentioned the lenght of the file anywhere in the program? Will the system move all the 365 chars into waitab?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or do i need to mention the lenght of the file?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2)Suppose my file is like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1212222  2283838 2839293  383839283 38e439 3u39393 3839839 383993 2837383  38739378  3u873983&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now my itab will be&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filed1(10),file2(7),field3(8),field4(7),filed5(8).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so in this case the first 10 chars of the file will be placed in field1,&lt;/P&gt;&lt;P&gt;next 7chars will be placed in field2, is it including spaces?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here my file lenght is more than the itab, in this case what will happen?Beacuse my need is to have file first line into one record of itab , second line into another record , etc?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Aug 2009 01:38:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/application-server-file-length-to-internal-table/m-p/6033669#M1349775</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-06T01:38:16Z</dc:date>
    </item>
    <item>
      <title>Re: application server file length to internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/application-server-file-length-to-internal-table/m-p/6033670#M1349776</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN __default_attr="blue" __jive_macro_name="color"&gt;Hi,
&amp;lt;li&amp;gt;Try this way. This sample program is used to download TAB delimited file from application server.
&lt;PRE&gt;&lt;CODE&gt;
REPORT ztest_program.
DATA: BEGIN OF it_t001 OCCURS 0,
        bukrs TYPE t001-bukrs,
        butxt TYPE t001-butxt,
        ort01 TYPE t001-ort01,
        land1 TYPE t001-land1,
        waers TYPE t001-waers,
        spras TYPE t001-spras,
        ktopl TYPE t001-ktopl,
        waabw TYPE t001-waabw,
      END OF it_t001.
DATA: BEGIN OF it_app_file OCCURS 0,
        data TYPE string,
      END OF it_app_file.
CLASS cl_abap_char_utilities DEFINITION LOAD.
CONSTANTS:hor_tab  TYPE c VALUE cl_abap_char_utilities=&amp;gt;horizontal_tab.
PARAMETERS : p_file(150) TYPE c.
START-OF-SELECTION.
  "Open file for reading
  OPEN DATASET p_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
  IF sy-subrc EQ 0.
    DO.
      READ DATASET p_file INTO it_app_file-data.
      IF it_app_file IS INITIAL.
        "If file ends or if does not have data
        EXIT.
      ELSE.
        "Splitting TAB delimited data into into internal table
        SPLIT it_app_file-data AT hor_tab INTO it_t001-bukrs
                                               it_t001-butxt
                                               it_t001-ort01
                                               it_t001-land1
                                               it_t001-waers
                                               it_t001-spras
                                               it_t001-ktopl
                                               it_t001-waabw.
        APPEND it_t001.
        CLEAR  it_t001.
      ENDIF.
    ENDDO.
  ENDIF.
  "close file
  CLOSE DATASET p_file.
  LOOP AT it_t001.
    WRITE:/ it_t001-bukrs,
            it_t001-butxt,
            it_t001-ort01,
            it_t001-land1,
            it_t001-waers,
            it_t001-spras,
            it_t001-ktopl,
            it_t001-waabw.
  ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;
&amp;lt;li&amp;gt;Let me know if you have any problem in doing.
Thanks
Venkat.O&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Aug 2009 02:39:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/application-server-file-length-to-internal-table/m-p/6033670#M1349776</guid>
      <dc:creator>venkat_o</dc:creator>
      <dc:date>2009-08-06T02:39:16Z</dc:date>
    </item>
    <item>
      <title>Re: application server file length to internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/application-server-file-length-to-internal-table/m-p/6033671#M1349777</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;any other reply for my questions experts&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Aug 2009 06:01:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/application-server-file-length-to-internal-table/m-p/6033671#M1349777</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-06T06:01:45Z</dc:date>
    </item>
    <item>
      <title>Re: application server file length to internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/application-server-file-length-to-internal-table/m-p/6033672#M1349778</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just follow the suggestion given by venkat.&lt;/P&gt;&lt;P&gt;Its looks fine for ur requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;U need to split file at delimiter and since ur field values are tab limited u need to use cl_abap_char_utilities=&amp;gt;horizantal_tab.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Aug 2009 06:05:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/application-server-file-length-to-internal-table/m-p/6033672#M1349778</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-06T06:05:44Z</dc:date>
    </item>
    <item>
      <title>Re: application server file length to internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/application-server-file-length-to-internal-table/m-p/6033673#M1349779</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;Refer to the given code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; DATA: lv_app_server_file TYPE string.&lt;/P&gt;&lt;P&gt;  lv_app_server_file = pa_afile.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;To read file from Application server&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  OPEN DATASET lv_app_server_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.&lt;/P&gt;&lt;P&gt;  DO.&lt;/P&gt;&lt;P&gt;    READ DATASET lv_app_server_file INTO wa_file_data.&lt;/P&gt;&lt;P&gt;    IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;      APPEND wa_file_data TO gi_file_data.&lt;/P&gt;&lt;P&gt;    ELSE.&lt;/P&gt;&lt;P&gt;      EXIT.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDDO.&lt;/P&gt;&lt;P&gt;  CLOSE DATASET lv_app_server_file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: lv_file_separator TYPE c.&lt;/P&gt;&lt;P&gt;  lv_file_separator = cl_abap_char_utilities=&amp;gt;horizontal_tab.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;To upload file in other formats(CSV, Tab delimited etc)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL FUNCTION 'TEXT_CONVERT_TEX_TO_SAP'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      i_field_seperator    = lv_file_separator&lt;/P&gt;&lt;P&gt;      i_tab_raw_data       = gi_file_data&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      i_tab_converted_data = gi_zhralcon_file&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      conversion_failed    = 1&lt;/P&gt;&lt;P&gt;      OTHERS               = 2.&lt;/P&gt;&lt;P&gt;  IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno&lt;/P&gt;&lt;P&gt;            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;  ENDIF.&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;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rajesh Kumar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Aug 2009 07:29:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/application-server-file-length-to-internal-table/m-p/6033673#M1349779</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-06T07:29:47Z</dc:date>
    </item>
    <item>
      <title>Re: application server file length to internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/application-server-file-length-to-internal-table/m-p/6033674#M1349780</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1)My doubt is that&lt;/P&gt;&lt;P&gt;experts&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i am simply using Read dataset file into waitab. and i did not mentioned the lenght of the file anywhere in the program? Will the system move all the 365 chars into waitab?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or do i need to mention the lenght of the file?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2)Suppose my file is like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1212222 2283838 2839293 383839283 38e439 3u39393 3839839 383993 2837383 38739378 3u873983&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now my itab will be&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filed1(10),file2(7),field3(8),field4(7),filed5(8).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so in this case the first 10 chars of the file will be placed in field1,&lt;/P&gt;&lt;P&gt;next 7chars will be placed in field2, is it including spaces?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here my file lenght is more than the itab, in this case what will happen?Beacuse my need is to have file first line into one record of itab , second line into another record , etc?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Aug 2009 02:13:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/application-server-file-length-to-internal-table/m-p/6033674#M1349780</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-07T02:13:02Z</dc:date>
    </item>
    <item>
      <title>Re: application server file length to internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/application-server-file-length-to-internal-table/m-p/6033675#M1349781</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;no need to mention any length... it will pick the first line in the data set based on the linefeed and carriage return it will recognise that the line is ended and pick the first row of data the whole row... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;better u declare you wa type string.... rather than  wa(150) type c.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Aug 2009 03:12:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/application-server-file-length-to-internal-table/m-p/6033675#M1349781</guid>
      <dc:creator>former_member156446</dc:creator>
      <dc:date>2009-08-07T03:12:53Z</dc:date>
    </item>
    <item>
      <title>Re: application server file length to internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/application-server-file-length-to-internal-table/m-p/6033676#M1349782</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;any other valuable suggestions for my questions experts&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Aug 2009 05:06:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/application-server-file-length-to-internal-table/m-p/6033676#M1349782</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-07T05:06:12Z</dc:date>
    </item>
  </channel>
</rss>

