<?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: Dynamic Create Data (length) / file record transfer in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-create-data-length-file-record-transfer/m-p/1384980#M187529</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have used the workaround to implement a buffered file reader that assignes the record length dynamically.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
CLASS file_buffered_reader DEFINITION.

   PUBLIC SECTION.

      " Class assumes that the given filename is correct.
      " There is
      " no error handling when file cannot be opened.
      " The read function will return an empty record on
      " such an
      " attempt.
      METHODS CONSTRUCTOR IMPORTING i_filename   TYPE SAPB-SAPFILES
                                    i_isOpen     TYPE boole-boole.


      METHODS read        IMPORTING i_numBytes     TYPE I
                          EXPORTING e_xRecord      TYPE ANY
                                    e_EOF          TYPE boole-boole.


   PRIVATE SECTION.

      CONSTANTS: RECORDSIZE        TYPE I VALUE 4096.
      DATA: handle                 TYPE SAPB-SAPFILES,
            xBuffer(8192)          TYPE X,  " see constant RECORDSIZE
            xBuffer_fill           TYPE I,
            xBufferReadAhead(4096) TYPE X,
            eof                    TYPE boole-boole.

      METHODS xBuffer_read.

ENDCLASS.

CLASS file_buffered_reader IMPLEMENTATION.

   METHOD CONSTRUCTOR.

      CLEAR xBuffer.
      xBuffer_fill = 0.
      CLEAR xBufferReadAhead.
      CLEAR: eof.
      handle = i_filename.
      IF i_isOpen IS INITIAL.
         OPEN DATASET handle FOR INPUT IN BINARY MODE.
      ENDIF.

   ENDMETHOD.

   METHOD read.

      DATA: bytes_remaining    TYPE I,
            bytes_assigned     TYPE I.

      bytes_assigned  = 0.
      bytes_remaining = i_numBytes.

      WHILE bytes_remaining &amp;gt; 0.


         IF xBuffer_fill &amp;lt; RECORDSIZE.
            CALL METHOD xBuffer_read.
         ENDIF.

         DATA: max_or_buffer    TYPE I.
         IF bytes_remaining &amp;gt; xBuffer_fill.
            max_or_buffer = xBuffer_fill.
         ELSE.
            max_or_buffer = bytes_remaining.
         ENDIF.

         e_xRecord+bytes_assigned(max_or_buffer)
              = xBuffer+0(max_or_buffer).
         ADD max_or_buffer TO bytes_assigned.

         " Move buffer up
         DATA: buffer_remaining   TYPE I.
         buffer_remaining = xBuffer_fill - max_or_buffer.

         xBuffer+0(buffer_remaining)
                = xBuffer+max_or_buffer(buffer_remaining).
         xBuffer_fill = buffer_remaining.
         IF xBuffer_fill &amp;lt; 0.
            break-point.
         ENDIF.

         SUBTRACT bytes_assigned FROM bytes_remaining.

         " Check, if the record could be filled up
         IF eof = 'X'  AND bytes_remaining &amp;gt; xBuffer_fill.
            e_eof = 'X'.
            EXIT.
         ENDIF.


      ENDWHILE.


   ENDMETHOD.


   METHOD xBuffer_read.

      DATA: len   TYPE I.
      READ DATASET handle INTO xBufferReadAhead LENGTH len.
      IF sy-subrc &amp;lt;&amp;gt; 0.
         eof = 'X'.
      ENDIF.

      IF len &amp;gt; 0.
         xBuffer+xBuffer_fill(len) = xBufferReadAhead+0(len).
      ENDIF.
      ADD len TO xBuffer_fill.

   ENDMETHOD.

ENDCLASS.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 13 Jul 2006 13:01:32 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-07-13T13:01:32Z</dc:date>
    <item>
      <title>Dynamic Create Data (length) / file record transfer</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-create-data-length-file-record-transfer/m-p/1384969#M187518</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I need a data variable at runtime (of type X) where I do not know the length at compile time. It is like&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
   DATA: length              TYPE I VALUE 33.
   DATA: xDataStream(length) TYPE X.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Of course this example doesn't really work, though I looked through&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
   CREATE DATA
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;but this doesn't help. I can write that it will be of TYPE X (or any other) but I can't specifiy the length at runtime.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The cause is, and I would like to combine this with the question related to it:&lt;/P&gt;&lt;P&gt;I have a physical file that has any number of given records and a header that gives the record length, e.g.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
30
&amp;lt;record-1 length 30&amp;gt;
&amp;lt;record-2 length 30&amp;gt;
...
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I would like to read from this file record-by-record. But when using the simple&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
   ...
   READ DATASET file INTO record.
   ...
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;the runtime system will transfer as much bytes as the record is defined. So if you had a&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
   DATA: record(30)   TYPE X.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;it works fine but statically.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do not wish to read the record byte-wise. This is not sexy enough, like:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
   DATA: byte               TYPE X,
         recordLength       TYPE I,
         recordBuffer(1024) TYPE X. " Some maximum length

   PERFORM read_header CHANGING recordLength.
   ...
   DO recordLength TIMES.
      DATA: i TYPE I.
      i = sy-index - 1.
      READ DATASET file INTO byte.
      recordBuffer+i(1) = byte.
   ENDDO.
   ...
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;This would perform a system call for each byte of the file and I want to avoid this due to performance issue. Well, you could create a recordBuffer, reading it block-wise and cut-out your own records from the buffer, but I was thinking if anyone has a smart solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Florin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Jul 2006 22:19:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-create-data-length-file-record-transfer/m-p/1384969#M187518</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-12T22:19:22Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Create Data (length) / file record transfer</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-create-data-length-file-record-transfer/m-p/1384970#M187519</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Florian,&lt;/P&gt;&lt;P&gt;normally XString should do, on older releases an internal table is a common solution.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;  Klaus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jul 2006 02:54:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-create-data-length-file-record-transfer/m-p/1384970#M187519</guid>
      <dc:creator>former_member183804</dc:creator>
      <dc:date>2006-07-13T02:54:44Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Create Data (length) / file record transfer</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-create-data-length-file-record-transfer/m-p/1384971#M187520</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is reading the file into an internal table of type string not going to work for you?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data: itab type table of string with header line.


.....


   READ DATASET file INTO itab.
....

append itab.&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;RIch Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jul 2006 02:59:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-create-data-length-file-record-transfer/m-p/1384971#M187520</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-07-13T02:59:02Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Create Data (length) / file record transfer</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-create-data-length-file-record-transfer/m-p/1384972#M187521</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Klaus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;an XString grows dynamically on size but I need a fixed size of a variable that is set at runtime.&lt;/P&gt;&lt;P&gt;I cannot use an internal table for the READ DATASET as well (if you look at the second part of the question).&lt;/P&gt;&lt;P&gt;Hmmm..&lt;/P&gt;&lt;P&gt;Thx &amp;amp; best regards,&lt;/P&gt;&lt;P&gt;Florin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jul 2006 08:27:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-create-data-length-file-record-transfer/m-p/1384972#M187521</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-13T08:27:19Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Create Data (length) / file record transfer</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-create-data-length-file-record-transfer/m-p/1384973#M187522</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rich,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;no, because I have mentioned that the amount of bytes that is to be transferred in the READ DATASET statement is defined at runtime. I'm also using the BINARY MODE, so when does the String end when I read the file?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;btw: The itab doesn't has a header-line and the read dataset statement should yield a syntax error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Florin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jul 2006 08:29:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-create-data-length-file-record-transfer/m-p/1384973#M187522</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-13T08:29:31Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Create Data (length) / file record transfer</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-create-data-length-file-record-transfer/m-p/1384974#M187523</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Florin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;creating data requires a full type specification. As x/c require a length specification they can not be used for create data. On 7.00 onwards you may use the RTTS (CL_ABAP_TYPE_DESCR .. ) to create first a type handle and then a data item.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I do not fully understand why xString is not suitable. Can you give some additional hint?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the dataset implementation uses an internal buffer, so even reading it bytewise thus not mean that each byte is causing an OS call. So using an xString table with a resonable length of the records (say 256 bytes) should be fine from view of performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;  Klaus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jul 2006 08:41:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-create-data-length-file-record-transfer/m-p/1384974#M187523</guid>
      <dc:creator>former_member183804</dc:creator>
      <dc:date>2006-07-13T08:41:36Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Create Data (length) / file record transfer</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-create-data-length-file-record-transfer/m-p/1384975#M187524</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Klaus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;   
   DATA: xRecord   TYPE XSTRING.
   READ DATASET p_file INTO xRecord.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;... reads the complete file. My file could be like a couple of megabytes and I would like to avoid reading in into the memory in one go.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Florin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jul 2006 09:03:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-create-data-length-file-record-transfer/m-p/1384975#M187524</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-13T09:03:37Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Create Data (length) / file record transfer</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-create-data-length-file-record-transfer/m-p/1384976#M187525</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Florin,&lt;/P&gt;&lt;P&gt;in that case the extensions MAX LENGTH / ACTUAL LENGTH might be the solution.&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;  Klaus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jul 2006 09:48:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-create-data-length-file-record-transfer/m-p/1384976#M187525</guid>
      <dc:creator>former_member183804</dc:creator>
      <dc:date>2006-07-13T09:48:42Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Create Data (length) / file record transfer</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-create-data-length-file-record-transfer/m-p/1384977#M187526</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Klaus,&lt;/P&gt;&lt;P&gt;the statement READ DATASET does not have any additions beside LENGTH len that stores the read bytes into variable len.&lt;/P&gt;&lt;P&gt;What do you mean? Though I haven't found under the term XSTRING something that refers to the actual size there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Florin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jul 2006 10:02:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-create-data-length-file-record-transfer/m-p/1384977#M187526</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-13T10:02:02Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Create Data (length) / file record transfer</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-create-data-length-file-record-transfer/m-p/1384978#M187527</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I guess I am on a newer version (7.00)&lt;/P&gt;&lt;P&gt;Sorry&lt;/P&gt;&lt;P&gt;  Klaus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jul 2006 10:07:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-create-data-length-file-record-transfer/m-p/1384978#M187527</guid>
      <dc:creator>former_member183804</dc:creator>
      <dc:date>2006-07-13T10:07:43Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Create Data (length) / file record transfer</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-create-data-length-file-record-transfer/m-p/1384979#M187528</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Klaus,&lt;/P&gt;&lt;P&gt;thanks for this info. Good to know that his feature is available in newer version...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Florin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jul 2006 10:43:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-create-data-length-file-record-transfer/m-p/1384979#M187528</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-13T10:43:28Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Create Data (length) / file record transfer</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-create-data-length-file-record-transfer/m-p/1384980#M187529</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have used the workaround to implement a buffered file reader that assignes the record length dynamically.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
CLASS file_buffered_reader DEFINITION.

   PUBLIC SECTION.

      " Class assumes that the given filename is correct.
      " There is
      " no error handling when file cannot be opened.
      " The read function will return an empty record on
      " such an
      " attempt.
      METHODS CONSTRUCTOR IMPORTING i_filename   TYPE SAPB-SAPFILES
                                    i_isOpen     TYPE boole-boole.


      METHODS read        IMPORTING i_numBytes     TYPE I
                          EXPORTING e_xRecord      TYPE ANY
                                    e_EOF          TYPE boole-boole.


   PRIVATE SECTION.

      CONSTANTS: RECORDSIZE        TYPE I VALUE 4096.
      DATA: handle                 TYPE SAPB-SAPFILES,
            xBuffer(8192)          TYPE X,  " see constant RECORDSIZE
            xBuffer_fill           TYPE I,
            xBufferReadAhead(4096) TYPE X,
            eof                    TYPE boole-boole.

      METHODS xBuffer_read.

ENDCLASS.

CLASS file_buffered_reader IMPLEMENTATION.

   METHOD CONSTRUCTOR.

      CLEAR xBuffer.
      xBuffer_fill = 0.
      CLEAR xBufferReadAhead.
      CLEAR: eof.
      handle = i_filename.
      IF i_isOpen IS INITIAL.
         OPEN DATASET handle FOR INPUT IN BINARY MODE.
      ENDIF.

   ENDMETHOD.

   METHOD read.

      DATA: bytes_remaining    TYPE I,
            bytes_assigned     TYPE I.

      bytes_assigned  = 0.
      bytes_remaining = i_numBytes.

      WHILE bytes_remaining &amp;gt; 0.


         IF xBuffer_fill &amp;lt; RECORDSIZE.
            CALL METHOD xBuffer_read.
         ENDIF.

         DATA: max_or_buffer    TYPE I.
         IF bytes_remaining &amp;gt; xBuffer_fill.
            max_or_buffer = xBuffer_fill.
         ELSE.
            max_or_buffer = bytes_remaining.
         ENDIF.

         e_xRecord+bytes_assigned(max_or_buffer)
              = xBuffer+0(max_or_buffer).
         ADD max_or_buffer TO bytes_assigned.

         " Move buffer up
         DATA: buffer_remaining   TYPE I.
         buffer_remaining = xBuffer_fill - max_or_buffer.

         xBuffer+0(buffer_remaining)
                = xBuffer+max_or_buffer(buffer_remaining).
         xBuffer_fill = buffer_remaining.
         IF xBuffer_fill &amp;lt; 0.
            break-point.
         ENDIF.

         SUBTRACT bytes_assigned FROM bytes_remaining.

         " Check, if the record could be filled up
         IF eof = 'X'  AND bytes_remaining &amp;gt; xBuffer_fill.
            e_eof = 'X'.
            EXIT.
         ENDIF.


      ENDWHILE.


   ENDMETHOD.


   METHOD xBuffer_read.

      DATA: len   TYPE I.
      READ DATASET handle INTO xBufferReadAhead LENGTH len.
      IF sy-subrc &amp;lt;&amp;gt; 0.
         eof = 'X'.
      ENDIF.

      IF len &amp;gt; 0.
         xBuffer+xBuffer_fill(len) = xBufferReadAhead+0(len).
      ENDIF.
      ADD len TO xBuffer_fill.

   ENDMETHOD.

ENDCLASS.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jul 2006 13:01:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-create-data-length-file-record-transfer/m-p/1384980#M187529</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-13T13:01:32Z</dc:date>
    </item>
  </channel>
</rss>

