<?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: Split Internal Table into Multiple Internal Tables Dynamically based on No of Records in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-internal-table-into-multiple-internal-tables-dynamically-based-on-no/m-p/399325#M10116</link>
    <description>&lt;P&gt;Hi Fabian,&lt;/P&gt;&lt;P&gt;could you please let us know how to decode the lt_small_tables since it now has references.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Subba&lt;/P&gt;</description>
    <pubDate>Wed, 01 Jun 2022 10:15:06 GMT</pubDate>
    <dc:creator>vsubbakrishna</dc:creator>
    <dc:date>2022-06-01T10:15:06Z</dc:date>
    <item>
      <title>Split Internal Table into Multiple Internal Tables Dynamically based on No of Records</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-internal-table-into-multiple-internal-tables-dynamically-based-on-no/m-p/399318#M10109</link>
      <description>&lt;P&gt;I want to split Internal Table into multiple Internal Tables as the Main Internal Tables contains huge no of records due to which the system generates a dump.&lt;/P&gt;&lt;P&gt;If the no of records are less it easily processes the Records.&lt;/P&gt;&lt;P&gt;For Eg&lt;/P&gt;&lt;P&gt;ITAB1 = 100000 Records. Split this table into multiple internal tables&lt;/P&gt;&lt;P&gt;TAB1 = 50000 Records&lt;/P&gt;&lt;P&gt;TAB2  = 50000 Records.&lt;/P&gt;&lt;P&gt;I dont want to follow the hardcoding logic of writing and checking sy-tabix = 50000, append into TAB1 or TAB2.&lt;/P&gt;&lt;P&gt;Can this be done using dynamic logic. Like the system identifies it has reached the size limit and automatically fills up another internal table.&lt;/P&gt;&lt;P&gt;Hope my requirement is clear.&lt;/P&gt;&lt;P&gt;Please guide me in resolving this issue.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jan 2017 19:04:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-internal-table-into-multiple-internal-tables-dynamically-based-on-no/m-p/399318#M10109</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2017-01-04T19:04:52Z</dc:date>
    </item>
    <item>
      <title>Re: Split Internal Table into Multiple Internal Tables Dynamically based on No of Records</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-internal-table-into-multiple-internal-tables-dynamically-based-on-no/m-p/399319#M10110</link>
      <description>&lt;P&gt;I guess the first question is what in the world are you wanting to read into an internal table that could be that large to begin with (and not better suited for another toolset that handles "big data" for instance). Are you absolutely sure you should be pulling that much data??!?!&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jan 2017 19:07:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-internal-table-into-multiple-internal-tables-dynamically-based-on-no/m-p/399319#M10110</guid>
      <dc:creator>ChrisSolomon</dc:creator>
      <dc:date>2017-01-04T19:07:15Z</dc:date>
    </item>
    <item>
      <title>Re: Split Internal Table into Multiple Internal Tables Dynamically based on No of Records</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-internal-table-into-multiple-internal-tables-dynamically-based-on-no/m-p/399320#M10111</link>
      <description>&lt;P&gt;As Christopher said I doubt this approach is the correct way and also wouldn't the dump already be generated if your first table exceeds the limit?&lt;/P&gt;&lt;P&gt;I gave it a try anyways:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TYPES: BEGIN OF lty_line,
         column1 TYPE i,
         column2 TYPE c LENGTH 4,
       END OF lty_line.
CONSTANTS: lc_test_data_amount TYPE i VALUE 100000,
           lc_split_at_amount  TYPE i VALUE 10000.
DATA: lt_big_table    TYPE STANDARD TABLE OF lty_line,
      lv_string       TYPE string,
      lt_small_tables TYPE STANDARD TABLE OF REF TO data,
      lr_small_table  TYPE REF TO data.
FIELD-SYMBOLS: &amp;lt;lg_target&amp;gt; TYPE STANDARD TABLE.

" Generate test data
DO lc_test_data_amount TIMES.
  CALL FUNCTION 'GENERAL_GET_RANDOM_STRING'
    EXPORTING
      number_chars  = 4    " Specifies the number of generated chars
    IMPORTING
      random_string = lv_string.    " Generated string
  APPEND VALUE #( column1 = sy-index
                  column2 = CONV #( lv_string ) ) TO lt_big_table.
ENDDO.
CLEAR lv_string.

" Split
DATA(lo_descr) = CAST cl_abap_tabledescr(
                   cl_abap_typedescr=&amp;gt;describe_by_data( lt_big_table )
                 ).
LOOP AT lt_big_table ASSIGNING FIELD-SYMBOL(&amp;lt;ls_line&amp;gt;).
  IF ( sy-tabix - 1 ) MOD lc_split_at_amount = 0.
    CREATE DATA lr_small_table TYPE HANDLE lo_descr.
    ASSERT lr_small_table IS BOUND.
    APPEND lr_small_table TO lt_small_tables.
    ASSIGN lr_small_table-&amp;gt;* TO &amp;lt;lg_target&amp;gt;.
    ASSERT &amp;lt;lg_target&amp;gt; IS ASSIGNED.
  ENDIF.
  APPEND &amp;lt;ls_line&amp;gt; TO &amp;lt;lg_target&amp;gt;.
ENDLOOP.

UNASSIGN: &amp;lt;lg_target&amp;gt;, &amp;lt;ls_line&amp;gt;.
FREE lr_small_table.

BREAK-POINT. " lt_small_tables contains references to the split tables
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 04 Jan 2017 20:22:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-internal-table-into-multiple-internal-tables-dynamically-based-on-no/m-p/399320#M10111</guid>
      <dc:creator>fabianlupa</dc:creator>
      <dc:date>2017-01-04T20:22:45Z</dc:date>
    </item>
    <item>
      <title>Re: Split Internal Table into Multiple Internal Tables Dynamically based on No of Records</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-internal-table-into-multiple-internal-tables-dynamically-based-on-no/m-p/399321#M10112</link>
      <description>&lt;P&gt;I believe that is his question....ie. can he "detect dynamically" right &lt;STRONG&gt;before&lt;/STRONG&gt; an internal table size would exceed and cause a dump and thus, "spill over" into a new, additional, other internal table and continue to do the same on that new internal table as needed (possibly creating more and more other "spill over" tables too).&lt;/P&gt;&lt;P&gt;So  in your example.....he does not know/want a "hardcode" data limit or table size....but by the way, very nice code there!&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jan 2017 20:32:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-internal-table-into-multiple-internal-tables-dynamically-based-on-no/m-p/399321#M10112</guid>
      <dc:creator>ChrisSolomon</dc:creator>
      <dc:date>2017-01-04T20:32:33Z</dc:date>
    </item>
    <item>
      <title>Re: Split Internal Table into Multiple Internal Tables Dynamically based on No of Records</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-internal-table-into-multiple-internal-tables-dynamically-based-on-no/m-p/399322#M10113</link>
      <description>&lt;P&gt;Thanks! I doubt it's possible then or at least I don't think there is a (documented) way to get the memory allocation limit for a data object from the runtime environment.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jan 2017 21:04:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-internal-table-into-multiple-internal-tables-dynamically-based-on-no/m-p/399322#M10113</guid>
      <dc:creator>fabianlupa</dc:creator>
      <dc:date>2017-01-04T21:04:52Z</dc:date>
    </item>
    <item>
      <title>Re: Split Internal Table into Multiple Internal Tables Dynamically based on No of Records</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-internal-table-into-multiple-internal-tables-dynamically-based-on-no/m-p/399323#M10114</link>
      <description>&lt;P&gt;Could the limit be derived from one of the environment variables (t-code RZ11)?&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2017 15:02:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-internal-table-into-multiple-internal-tables-dynamically-based-on-no/m-p/399323#M10114</guid>
      <dc:creator>raghug</dc:creator>
      <dc:date>2017-01-05T15:02:22Z</dc:date>
    </item>
    <item>
      <title>Re: Split Internal Table into Multiple Internal Tables Dynamically based on No of Records</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-internal-table-into-multiple-internal-tables-dynamically-based-on-no/m-p/399324#M10115</link>
      <description>&lt;P&gt;You could try getting a size from there and compare it using something like this I guess:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA(lv_max_size) = ???.
DESCRIBE FIELD: lt_tab      LENGTH DATA(lv_size_current) IN BYTE MODE,
                ls_new_line LENGTH DATA(lv_size_additional) IN BYTE MODE.
IF ( lv_size_current + lv_size_additional ) &amp;gt; lv_max_size.
  " On to the next itab...
ENDIF&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;But I doubt the behavior is "well defined" (in ABAP) and is probably release, hardware and / or workload dependent. Looking through the documentation there is even wording like "usually" in place so I doubt that approach is worth pursuing.&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/abapdocu_751/en/index.htm?file=abenmemory_consumption.htm"&gt;http://help.sap.com/abapdocu_751/en/index.htm?file=abenmemory_consumption.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2017 20:49:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-internal-table-into-multiple-internal-tables-dynamically-based-on-no/m-p/399324#M10115</guid>
      <dc:creator>fabianlupa</dc:creator>
      <dc:date>2017-01-05T20:49:24Z</dc:date>
    </item>
    <item>
      <title>Re: Split Internal Table into Multiple Internal Tables Dynamically based on No of Records</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-internal-table-into-multiple-internal-tables-dynamically-based-on-no/m-p/399325#M10116</link>
      <description>&lt;P&gt;Hi Fabian,&lt;/P&gt;&lt;P&gt;could you please let us know how to decode the lt_small_tables since it now has references.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Subba&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jun 2022 10:15:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-internal-table-into-multiple-internal-tables-dynamically-based-on-no/m-p/399325#M10116</guid>
      <dc:creator>vsubbakrishna</dc:creator>
      <dc:date>2022-06-01T10:15:06Z</dc:date>
    </item>
  </channel>
</rss>

