<?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: code for reading particular  fields from the file placed in application in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-for-reading-particular-fields-from-the-file-placed-in-application/m-p/3615478#M870954</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 this code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data : filename(250) type c value '/usr/sap/tmp/ASHOKTEST11.TXT'.
start-of-selection.
open dataset filename for input in text mode encoding default.
do.
if sy-subrc &amp;lt;&amp;gt; 0.
exit.
endif.
read dataset filename into itab.
append itab.
enddo.
loop at itab.
write: itab-lifnr.
endloop.

close dataset filename.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;S.Nehru.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 25 Mar 2008 12:13:44 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-03-25T12:13:44Z</dc:date>
    <item>
      <title>code for reading particular  fields from the file placed in application</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-for-reading-particular-fields-from-the-file-placed-in-application/m-p/3615476#M870952</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;code for reading particular  fields from the file placed in application server in to the internal table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Mar 2008 11:57:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-for-reading-particular-fields-from-the-file-placed-in-application/m-p/3615476#M870952</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-25T11:57:20Z</dc:date>
    </item>
    <item>
      <title>Re: code for reading particular  fields from the file placed in application</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-for-reading-particular-fields-from-the-file-placed-in-application/m-p/3615477#M870953</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;Use the GUI_UPLOAD FM to upload the File into ur Internal Table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; DATA : FILE_TABLE TYPE FILE_TABLE OCCURS 0,&lt;/P&gt;&lt;P&gt;         fwa TYPE FILE_TABLE,&lt;/P&gt;&lt;P&gt;         FILENAME TYPE STRING,&lt;/P&gt;&lt;P&gt;         RC TYPE I.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL METHOD CL_GUI_FRONTEND_SERVICES=&amp;gt;FILE_OPEN_DIALOG&lt;/P&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;P&gt;    WINDOW_TITLE            = 'Open File'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   DEFAULT_EXTENSION       =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   DEFAULT_FILENAME        =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   FILE_FILTER             =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   INITIAL_DIRECTORY       =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   MULTISELECTION          =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   WITH_ENCODING           =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CHANGING&lt;/P&gt;&lt;P&gt;    FILE_TABLE              = FILE_TABLE&lt;/P&gt;&lt;P&gt;    RC                      = RC&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   USER_ACTION             =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   FILE_ENCODING           =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  EXCEPTIONS&lt;/P&gt;&lt;P&gt;    FILE_OPEN_DIALOG_FAILED = 1&lt;/P&gt;&lt;P&gt;    CNTL_ERROR              = 2&lt;/P&gt;&lt;P&gt;    ERROR_NO_GUI            = 3&lt;/P&gt;&lt;P&gt;    NOT_SUPPORTED_BY_GUI    = 4&lt;/P&gt;&lt;P&gt;    others                  = 5&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; 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;READ TABLE FILE_TABLE INDEX 1 into fwa.&lt;/P&gt;&lt;P&gt;FILENAME = fwa-FILENAME.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CALL FUNCTION 'GUI_UPLOAD'&lt;/P&gt;&lt;P&gt;         EXPORTING&lt;/P&gt;&lt;P&gt;              filename                = filename&lt;/P&gt;&lt;P&gt;              FILETYPE                = 'DAT'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       IMPORTING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;            FILELENGTH              =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;         TABLES&lt;/P&gt;&lt;P&gt;              data_tab                = itab&lt;/P&gt;&lt;P&gt;         EXCEPTIONS&lt;/P&gt;&lt;P&gt;              file_open_error         = 1&lt;/P&gt;&lt;P&gt;              file_read_error         = 2&lt;/P&gt;&lt;P&gt;              no_batch                = 3&lt;/P&gt;&lt;P&gt;              gui_refuse_filetransfer = 4&lt;/P&gt;&lt;P&gt;              invalid_type            = 5&lt;/P&gt;&lt;P&gt;              OTHERS                  = 6 .&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; 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;Regards,&lt;/P&gt;&lt;P&gt;Balakumar.G&lt;/P&gt;&lt;P&gt;Reward Points if helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Mar 2008 12:05:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-for-reading-particular-fields-from-the-file-placed-in-application/m-p/3615477#M870953</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-25T12:05:53Z</dc:date>
    </item>
    <item>
      <title>Re: code for reading particular  fields from the file placed in application</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-for-reading-particular-fields-from-the-file-placed-in-application/m-p/3615478#M870954</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 this code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data : filename(250) type c value '/usr/sap/tmp/ASHOKTEST11.TXT'.
start-of-selection.
open dataset filename for input in text mode encoding default.
do.
if sy-subrc &amp;lt;&amp;gt; 0.
exit.
endif.
read dataset filename into itab.
append itab.
enddo.
loop at itab.
write: itab-lifnr.
endloop.

close dataset filename.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;S.Nehru.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Mar 2008 12:13:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-for-reading-particular-fields-from-the-file-placed-in-application/m-p/3615478#M870954</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-25T12:13:44Z</dc:date>
    </item>
    <item>
      <title>Re: code for reading particular  fields from the file placed in application</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-for-reading-particular-fields-from-the-file-placed-in-application/m-p/3615479#M870955</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Bharath,&lt;/P&gt;&lt;P&gt;               files in application server are called DATASETs.&lt;/P&gt;&lt;P&gt;for reading/writing data into a dataset we can use &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OPEN DATASET file &lt;/P&gt;&lt;P&gt;          FOR INPUT &lt;/P&gt;&lt;P&gt;          IN BINARY MODE. &lt;/P&gt;&lt;P&gt;DO. &lt;/P&gt;&lt;P&gt;  READ DATASET file &lt;/P&gt;&lt;P&gt;  INTO &amp;lt;itab&amp;gt; with key itab-fieldname='fld val' &lt;/P&gt;&lt;P&gt;  ENDDO. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLOSE DATASET file. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward if helpfull.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Lakshman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Mar 2008 12:30:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-for-reading-particular-fields-from-the-file-placed-in-application/m-p/3615479#M870955</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-25T12:30:38Z</dc:date>
    </item>
  </channel>
</rss>

