<?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 Read data sets from Internal Table between indexes in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-data-sets-from-internal-table-between-indexes/m-p/12382105#M1994212</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
  &lt;P&gt;With the new ABAP 7.5 statements, is there a quick way to read sets of data from 1 internal table to another?&lt;/P&gt;
  &lt;P&gt;For example: Your first table has 100 000 entries. I want to break that up in to 10 sets of data. So I want to read index 1 - 10 000, process it, and then the next 10 000, process it, etc etc. Is there a way to do that with the VALUE # statement? So basically i don't want to loop through the whole table building a new one with the loop statement but rather use the VALUE statement.&lt;/P&gt;
  &lt;P&gt;Kind Regards&lt;/P&gt;
  &lt;P&gt;Deon&lt;/P&gt;</description>
    <pubDate>Mon, 01 Mar 2021 17:24:09 GMT</pubDate>
    <dc:creator>Deon_van_Zyl</dc:creator>
    <dc:date>2021-03-01T17:24:09Z</dc:date>
    <item>
      <title>Read data sets from Internal Table between indexes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-data-sets-from-internal-table-between-indexes/m-p/12382105#M1994212</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
  &lt;P&gt;With the new ABAP 7.5 statements, is there a quick way to read sets of data from 1 internal table to another?&lt;/P&gt;
  &lt;P&gt;For example: Your first table has 100 000 entries. I want to break that up in to 10 sets of data. So I want to read index 1 - 10 000, process it, and then the next 10 000, process it, etc etc. Is there a way to do that with the VALUE # statement? So basically i don't want to loop through the whole table building a new one with the loop statement but rather use the VALUE statement.&lt;/P&gt;
  &lt;P&gt;Kind Regards&lt;/P&gt;
  &lt;P&gt;Deon&lt;/P&gt;</description>
      <pubDate>Mon, 01 Mar 2021 17:24:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-data-sets-from-internal-table-between-indexes/m-p/12382105#M1994212</guid>
      <dc:creator>Deon_van_Zyl</dc:creator>
      <dc:date>2021-03-01T17:24:09Z</dc:date>
    </item>
    <item>
      <title>Re: Read data sets from Internal Table between indexes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-data-sets-from-internal-table-between-indexes/m-p/12382106#M1994213</link>
      <description>&lt;P&gt;Something like that?&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA itab1 TYPE string_table.
DATA itab2 TYPE string_table.
itab1 = VALUE #( ( |France| ) ( |Germany| ) ( |India| ) ).
itab2 = VALUE #(
    LET package_size = 2 IN
    FOR i = 1 THEN i + package_size WHILE i &amp;lt;= lines( itab1 )
    FOR &amp;lt;line&amp;gt; IN itab1 FROM i TO i + package_size - 1
    ( |Package start { i }: { &amp;lt;line&amp;gt; }| ) ).
ASSERT itab2 = VALUE string_table(
    ( |Package start 1: France| )
    ( |Package start 1: Germany| )
    ( |Package start 3: India| ) ).
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 01 Mar 2021 17:43:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-data-sets-from-internal-table-between-indexes/m-p/12382106#M1994213</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2021-03-01T17:43:55Z</dc:date>
    </item>
    <item>
      <title>Re: Read data sets from Internal Table between indexes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-data-sets-from-internal-table-between-indexes/m-p/12382107#M1994214</link>
      <description>&lt;P&gt;Hmmm. I read again your question, but I don't get it in fact. &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Could you write the pseudo algorithm please?&lt;/P&gt;</description>
      <pubDate>Mon, 01 Mar 2021 18:12:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-data-sets-from-internal-table-between-indexes/m-p/12382107#M1994214</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2021-03-01T18:12:01Z</dc:date>
    </item>
    <item>
      <title>Re: Read data sets from Internal Table between indexes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-data-sets-from-internal-table-between-indexes/m-p/12382108#M1994215</link>
      <description>&lt;P&gt;Hi  &lt;SPAN class="mention-scrubbed"&gt;sandra.rossi&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;Thanks for your response and sorry if my question was unclear. I have a huge table that needs to be processed by a program which is taking way to long. I am writing a wrapper program that should read read all the entries to be processed and then divide into sets of 5000 records at a time for which the program will schedule a job in the background.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT pernr FROM zhr_autobook INTO TABLE @DATA(lt_autobook)
           WHERE extr_date BETWEEN @p_begda AND @p_endda AND
                 cancel NE @abap_true AND
                 booked NE @abap_true AND
                 error  NE @abap_true.
&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;lt_autobook will for instance have 50 000 records. I want to take sets of 5000 at a time, index 1 - 5000, then index 5001-10 000 etc.&lt;/P&gt;&lt;P&gt;I hope that makes sense &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Deon&lt;/P&gt;</description>
      <pubDate>Mon, 01 Mar 2021 19:34:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-data-sets-from-internal-table-between-indexes/m-p/12382108#M1994215</guid>
      <dc:creator>Deon_van_Zyl</dc:creator>
      <dc:date>2021-03-01T19:34:43Z</dc:date>
    </item>
    <item>
      <title>Re: Read data sets from Internal Table between indexes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-data-sets-from-internal-table-between-indexes/m-p/12382109#M1994216</link>
      <description>&lt;P&gt;So I guess that this could be sufficient, I think that a constructor expression has no interest (I use one but it's almost equivalent to APPEND LINES OF ...):&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;package_size = 5000.
start = 0.
WHILE start &amp;lt; lines( lt_autobook ).
  package = VALUE #( ( LINES OF lt_autobook FROM start TO start + package_size - 1 ) ).
  " JOB program ran using SUBMIT ... WITH package = package AND RETURN.
  start = start + package_size.
ENDWHILE.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;(NB: declare the internal table of the job program as a NO-DISPLAY parameter)&lt;/P&gt;</description>
      <pubDate>Mon, 01 Mar 2021 19:44:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-data-sets-from-internal-table-between-indexes/m-p/12382109#M1994216</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2021-03-01T19:44:03Z</dc:date>
    </item>
    <item>
      <title>Re: Read data sets from Internal Table between indexes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-data-sets-from-internal-table-between-indexes/m-p/12382110#M1994217</link>
      <description>&lt;P&gt;Hi  &lt;SPAN class="mention-scrubbed"&gt;sandra.rossi&lt;/SPAN&gt; ,&lt;/P&gt;&lt;P&gt;Thank you so much for this! It worked perfectly! My code was as follow:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;    "/--- Get All Bookings to be Processed ---/"
    SELECT pernr FROM zhr_autobook INTO TABLE lt_pernr
           WHERE extr_date BETWEEN p_begda AND p_endda AND
                 cancel NE abap_true AND
                 booked NE abap_true AND
                 error  NE abap_true.



    DATA(lv_package_size) = 5000.
    DATA(lv_start) = 1.

    "/--- Devide into Batches of 5000 records ---/"
    WHILE lv_start &amp;lt; lines( lt_pernr ).
      lv_batch = lv_batch + 1.
      lt_package = VALUE #( ( LINES OF lt_pernr FROM lv_start TO lv_start + lv_package_size - 1 ) ).
      DELETE ADJACENT DUPLICATES FROM lt_package COMPARING pernr.
      CALL METHOD create_jobs
        EXPORTING
          it_pernr  = lt_package
          iv_batch  = lv_batch
        CHANGING
          ct_out   = ct_out.
      lv_start = lv_start + lv_package_size.
    ENDWHILE.
&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 02 Mar 2021 13:51:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-data-sets-from-internal-table-between-indexes/m-p/12382110#M1994217</guid>
      <dc:creator>Deon_van_Zyl</dc:creator>
      <dc:date>2021-03-02T13:51:21Z</dc:date>
    </item>
    <item>
      <title>Re: Read data sets from Internal Table between indexes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-data-sets-from-internal-table-between-indexes/m-p/12382111#M1994218</link>
      <description>&lt;P&gt;&lt;EM&gt;Solution by  &lt;SPAN class="mention-scrubbed"&gt;sandra.rossi&lt;/SPAN&gt; &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;"/--- Get All Bookings to be Processed ---/"&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;SELECT pernr FROM zhr_autobook INTO TABLE lt_pernr&lt;BR /&gt;WHERE extr_date BETWEEN p_begda AND p_endda AND&lt;BR /&gt;cancel NE abap_true AND&lt;BR /&gt;booked NE abap_true AND&lt;BR /&gt;errorNE abap_true.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;DATA(lv_package_size) = 5000.&lt;BR /&gt;DATA(lv_start) = 1.&lt;BR /&gt;&lt;BR /&gt;&lt;EM&gt;"/--- Devide into Batches of 5000 records ---/"&lt;/EM&gt;&lt;BR /&gt;WHILE lv_start &amp;lt; lines( lt_pernr ).&lt;BR /&gt;lv_batch = lv_batch + 1.&lt;BR /&gt;lt_package = VALUE #( ( LINES OF lt_pernr FROM lv_start TO lv_start + lv_package_size - 1 ) ).&lt;BR /&gt;DELETE ADJACENT DUPLICATES FROM lt_package COMPARING pernr.&lt;BR /&gt;CALL METHOD create_jobs&lt;BR /&gt;EXPORTING&lt;BR /&gt;it_pernr= lt_package&lt;BR /&gt;iv_batch= lv_batch&lt;BR /&gt;CHANGING&lt;BR /&gt;ct_out = ct_out.&lt;BR /&gt;lv_start = lv_start + lv_package_size.&lt;BR /&gt;ENDWHILE.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Mar 2021 13:53:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-data-sets-from-internal-table-between-indexes/m-p/12382111#M1994218</guid>
      <dc:creator>Deon_van_Zyl</dc:creator>
      <dc:date>2021-03-02T13:53:12Z</dc:date>
    </item>
  </channel>
</rss>

