<?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 reading data from application server in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/reading-data-from-application-server/m-p/3444454#M827220</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to read a file from application server. Record length of that file is 306. I have uploaded the file using tocde: CG3Z successfully. i'm able to view complete record in al11.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but when im trying to read that file into a string of length: 306, failing to do so.. im able to read the record upto length: 125. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  data:  l_str(306)  type c,&lt;/P&gt;&lt;P&gt;         l_mesg(100) type c,&lt;/P&gt;&lt;P&gt;         l_count     type i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*-- To Open File for Reading&lt;/P&gt;&lt;P&gt;  open dataset g_path for input in text mode encoding default.&lt;/P&gt;&lt;P&gt;  if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    message e000 with 'File does not exist'(008) g_path.&lt;/P&gt;&lt;P&gt;    g_error = c_x.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;  if g_error = space.&lt;/P&gt;&lt;P&gt;*--   Loop thru the UNIX file adding each record&lt;/P&gt;&lt;P&gt;    do.&lt;/P&gt;&lt;P&gt;      read dataset g_path into l_str.&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;&lt;/P&gt;&lt;P&gt;can anyone suggest me as how to read complete record...&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>Tue, 19 Feb 2008 08:52:02 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-02-19T08:52:02Z</dc:date>
    <item>
      <title>reading data from application server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reading-data-from-application-server/m-p/3444454#M827220</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to read a file from application server. Record length of that file is 306. I have uploaded the file using tocde: CG3Z successfully. i'm able to view complete record in al11.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but when im trying to read that file into a string of length: 306, failing to do so.. im able to read the record upto length: 125. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  data:  l_str(306)  type c,&lt;/P&gt;&lt;P&gt;         l_mesg(100) type c,&lt;/P&gt;&lt;P&gt;         l_count     type i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*-- To Open File for Reading&lt;/P&gt;&lt;P&gt;  open dataset g_path for input in text mode encoding default.&lt;/P&gt;&lt;P&gt;  if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    message e000 with 'File does not exist'(008) g_path.&lt;/P&gt;&lt;P&gt;    g_error = c_x.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;  if g_error = space.&lt;/P&gt;&lt;P&gt;*--   Loop thru the UNIX file adding each record&lt;/P&gt;&lt;P&gt;    do.&lt;/P&gt;&lt;P&gt;      read dataset g_path into l_str.&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;&lt;/P&gt;&lt;P&gt;can anyone suggest me as how to read complete record...&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>Tue, 19 Feb 2008 08:52:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reading-data-from-application-server/m-p/3444454#M827220</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-19T08:52:02Z</dc:date>
    </item>
    <item>
      <title>Re: reading data from application server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reading-data-from-application-server/m-p/3444455#M827221</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this. There is a Possiblity to assign the length of the record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
Effect 
The actual length of the data objet read is plaed in the field len after the read access. len must be defined as a variable. A syntax error will occur if you define it as a constant. 



Example
DATA: 
  len      TYPE i, 
  text(30) TYPE c VALUE 'Beethoven', 
  dir(30)  TYPE c VALUE '/usr/test.dat'. 

OPEN DATASET dir IN TEXT MODE. 
TRANSFER text TO dir. 
CLOSE DATASET dir. 
OPEN DATASET  dir IN TEXT MODE. 
READ DATASET dir INTO text LENGTH len. 
CLOSE DATASET dir. 
WRITE: / text, len. 



len now contains the value 9. 

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Vasanth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Feb 2008 09:00:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reading-data-from-application-server/m-p/3444455#M827221</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-19T09:00:12Z</dc:date>
    </item>
  </channel>
</rss>

