Memory full for Internal table

Hi all,
I have an intenal table where I need to pass millions of records. I am getting short dump due to the memory full. The message is 'the maximum no of bytes passed is exceeded'.
To avoid this, I have used the Hash table, but still got the same error. If I execute the same program with less period, the program is getting exected, because the no.of records which we are passing is less. the problem comes during selecting many millions of records from the database table to internal table.
Please advice ASAP.
Thanks,
Venu

Hi Venu,
In this case you could use the PACKAGE SIZE addition in the SELECT query to process in limited amount of data, thus avoiding the memory overloads.
Eg:
SELECT *
FROM &table&;
INTO TABLE itab
PACKAGE SIZE <n>.
IF sy-subrc EQ 0.
*" Process the n records
ENDIF.
ENDSELECT.
regards,
Prabhu
Reward if helpful

Similar Messages

  • Why using workarea for internal table is better in performance

    Please tell me
    why using workarea for internal table is better in performance

    Hi Vineet ,
      Why would we choose to use an internal table without a header line when it is easier to code one  with a header line?
    it has following reason.
    1)Separate Internal Table Work Area:
         The work area (staging area) defined for the internal table   is not limited to use with just one internal table.
    take ex-
    Suppose you want two internal tables for EMPLOYEE – one to contain all records and one to contain only those records where country = ‘USA’.  You could create both of these internal tables without header lines and use only one work area to load data into both of them. You would append all records from the work area into the first internal table.  You would conditionally append the ‘USA’ records from the same work area into the second internal table.
    2)  Performance Issues:  Using an internal table without a header line is more efficient than one  with a header line
    3) Nested Internal Tables:  If you want to include an internal table within a structure or another   internal table, you must use one without a header line.
    If this one is helpful ,then rewards me
    Regards
    Shambhu

  • System Variable For Internal table count

    Can anybody tell me what the system variable for internal table count?
    I just wants to know how many recoreds are there in my internal table ?
    Regards,
    pandu.

    Hi ,
    DESCRIBE TABLE <itab> [LINES <l>] [OCCURS <n>] [KIND <k>].
    If you use the LINES parameter, the number of filled lines is written to the variable <lin>. If parameter, the you use the OCCURS value of the INITIAL SIZE of the table is returned to the variable <n>. If you use the KIND parameter, the table type is returned to the variable <k>: ‘T’ for standard table, ‘S’ for sorted table, and ‘H’ for hashed table.
    using variable
    SY-TFILL
    After the statements DESCRIBE TABLE, LOOP AT, and READ TABLE, SY-TFILL contains the number of lines in the relevant internal table.
    http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3798358411d1829f0000e829fbfe/content.htm
    <REMOVED BY MODERATOR>
    Edited by: Alvaro Tejada Galindo on Feb 21, 2008 4:53 PM

  • Aggregate functions for internal table.

    Hi Gurus,
    I'm just wondering whether we can use aggregate functions for internal table. I wanted to know the max value for a particular column in my internal table. How can I achieve this easily and quickly.
    Thanks,
    David.

    sort the table on which you want the maximum value and read it. Please find below example code.
    TYPES : BEGIN OF ty_mvke,
            matnr TYPE mvke-matnr,
            vkorg TYPE mvke-vkorg,
            vtweg TYPE mvke-vtweg,
           AUMNG type mvke-AUMNG,
            END OF ty_mvke.
    DATA : wa_mvke TYPE ty_mvke,
           it_mvke TYPE STANDARD TABLE OF ty_mvke.
    data : temp_AUMNG type AUMNG.
    START-OF-SELECTION.
      SELECT matnr vkorg vtweg AUMNG FROM mvke INTO
            table it_mvke.
    sort it_mvke by AUMNG.
    read TABLE it_mvke into wa_mvke INDEX 1.
    if sy-subrc = 0.
    move wa_mvke-AUMNG to temp_AUMNG.
    write : temp_AUMNG.
    endif.
    Thanks,
    Sreekala.

  • Maximum record limit for internal table

    hello all,
    can any one tell me what is the maximum limit of internal table. i would like to add all records from bseg to internal table. so i can improve processing time.
    thanks,
    raj

    hi,
    Before Release 4.0A, ABAP stored the content of internal tables in a combination of main memory and file space. This means that the maximum size of all internal tables of all programs running on such an application server at one time is about 2 GB. With Release 4.0A or greater, this size decreases to about 500 MB. (Note that those values aren't fixed, but this is a good guide. This minimum of 500 MB is the lowest limit of the real value, which varies among different operating systems and even among different releases of the same operating system.)
    It may sound strange that a newer release has a higher restriction on capacity. But it's a consequence of the fact that the contents of internal tables move from a reserved file to shared memory. When you process internal tables this way in Release 4.0A or greater, you pay for much better performance with a smaller potential size.
    Regards,
    Sourabh

  • Memory problems in internal table

    Hi,
    I am facing an issue with the internal table memory.
    I am selecting something from the database and putting it in internal table but the load is so much that it is giving me memory errors as the data may go into millions.
    So what we have decided is to cut down the data in the internal table. we have defined a variable which will contain suppose 30000 data.
    so what i mean to do is to take the records from the databas based on the value in the variable. By that way i will be taking only 30000 data each time.
    But the issue is that first time it will take 1 to 30000 records if i give upto 30000 rows in the select query.. but then how will i take 30001 to 60000 the next time.. by that i mean how will i keep incrementing in the select query.
    Thanks in advance.
    Amit Kurup

    Hi
    I've never used these stataments but perhaps they are usefull for you:
    See the help for OPEN/CLOSE/FETCH CURSOR
    DATA: C TYPE CURSOR,
          WA TYPE <TABLE>.
    DATA: ITAB LIKE STANDARD TABLE OF <TABLE>.
    OPEN CURSOR C FOR
      SELECT * FROM <TABLE> WHERE .......
    DO.
    FETCH NEXT CURSOR C TO WA.
    IF SY-SUBRC <> 0.
      CLOSE CURSOR C.
      EXIT.
    ENDIF.
    APPEND WA TO ITAB.
    IF COUNT = 30000.
    DO SOMETHING
    COUNT = 0.
    REFRESH ITAB.
    ENDIF.
    COUNT = COUNT + 1.
    ENDDO. 
    Max

  • Sy-tabix for internal table in smartform

    Hi friends,
    How to capture the sy-tabix value for the entries in an internal table which has been looped into the loop of table node of a smartform?? I need to print something immedaitely after the end of the table
    For every record the value of sy-tabix is showing 1 !!
    Advance Thanks
    Aadarsh

    Hi Aadarsh,
    Give ur sy-tabix at the end of the loop.
    loop at itab.
    //table node populations.
    endloop.
    give a seperate loop for this.
    loop at itab.
    sy-tabix.
    endloop
    get the total no and print it after the table.
    If u r using do loop then give sy-index.
    Hope tihs helps u,
    Regards,
    Nagarajan.
    Message was edited by: Nagarajan Kumarappan

  • Field catalog for internal table in ALV

    In my program the internal table consists many fields from various tables and structure doesn't belong to a single data table.
    In order to get output in ALV grid following FM has been used
    REUSE_ALV_GRID_DISPLAY
    for field catalog the fields are defined specifically.
      l_fieldcat-fieldname  = 'VBELN'.
      l_fieldcat-outputlen  = 10.
      l_fieldcat-seltext_l  = 'Billing doc'.
      l_fieldcat-no_zero = 'X'.
      l_fieldcat-hotspot = 'X'.
      append l_fieldcat to p_fieldtab.
    ..............and so on for all the fields.
    Just wanted to know is there any other method to display all the fields of this internal table automatically so each field is not specified specifically.
    anya

    Hi
    Try this instead:
    *& Form  create_fieldcatalog
    * Create a field catalogue from any internal table
    *      -->PT_TABLE     Internal table
    *      -->PT_FIELDCAT  Field Catalogue
    FORM  create_fieldcatalog
           USING     pt_table     TYPE ANY TABLE
           CHANGING  pt_fieldcat  TYPE lvc_t_fcat.
      DATA:
        lr_tabdescr TYPE REF TO cl_abap_structdescr
      , lr_data     TYPE REF TO data
      , lt_dfies    TYPE ddfields
      , ls_dfies    TYPE dfies
      , ls_fieldcat TYPE lvc_s_fcat
      CLEAR pt_fieldcat.
      CREATE DATA lr_data LIKE LINE OF pt_table.
      lr_tabdescr ?= cl_abap_structdescr=>describe_by_data_ref( lr_data ).
      lt_dfies = cl_salv_data_descr=>read_structdescr( lr_tabdescr ).
      LOOP AT lt_dfies
      INTO    ls_dfies.
        CLEAR ls_fieldcat.
        MOVE-CORRESPONDING ls_dfies TO ls_fieldcat.
        APPEND ls_fieldcat TO pt_fieldcat.
      ENDLOOP.
    ENDFORM.                    "create_fieldcatalog

  • Query statement for internal table

    is it possible to use a select statement to select data from an internal table? if yes, can anyone show me the codes to it? thx

    Hi Daphne,
    You use SELECT statement to read data from database table but not from Internal table.
    For reading data from Internal table, you have to use READ statement.
    Syntax:
    READ TABLE itab { table_key
                    | free_key
                    | index } result.
    Effect of using read statement:
    This statement reads a row from internal table itab. You have to specify the row by either naming values table_key for the table key, a free condition free_key or an index index. The latter choice is possible only for index tables. The output result result determines when and where the row contents are read.
    If the row to be read is not uniquely specified, the first suitable row is read. In the case of index tables, this row has the lowest table index of all matching rows.
    Reward if usefull
    thanks
    swaroop

  • Using aggregation in ABAP code for internal table

    I have written following code to get cumulative amount on a date but i have to hit database for each record.
    Can't I use some function similar to SUM for doing the same thing on internal table??It would increase my performance.
    code is:
        SELECT SUM( DEB_CRE_LC ) FROM /BIC/AZFIAR_O500
         INTO LV_BALMONTH   WHERE   DEBITOR = LV_DEBITOR AND
        CALMONTH GE LV_STARTMONTH AND CALMONTH  LE LV_LASTCALMON.
    I want to put  ZFIAR data to internal table and read and do SUM thing..is it possible?? withotut usiong loop.
    regards,
    rakesh

    Hi Rajesh,
    types : begin of ty_tab,
                date type dats,
                DEB_CRE_LC   type .....     " delare type & is the filed need to summerized
                end of ty_tab,
    data: itab type standard table of ty_tab.
    SELECT date
                  SUM( DEB_CRE_LC )  as DEB_CRE_LC  FROM /BIC/AZFIAR_O500
                  INTO corresponding fields of itab
                  where CALMONTH GE LV_STARTMONTH AND CALMONTH LE LV_LASTCALMON
                  group by date.   " date is the field available in your ODS/transparent table
    simulate the above code in your program...
    Hope this will work..

  • How to parse XML for internal table

    hi guys, I would like to know how to parse xml for an internal table. I explain myself.
    Let's say you have a purchase order form where you have header data & items data. In my interactive form, the user can change the purchase order quantity at the item level. When I received back the pdf completed by mail, I need to parse the xml and get the po qty that has been entered.
    This is how I do to get header data from my form
    lr_ixml_node = lr_ixml_document->find_from_name( name = ''EBELN ).
    lv_ebeln = lr_ixml_node->get_value( ).
    How do we do to get the table body??
    Should I used the same method (find_from_name) and passing the depth parameter inside a do/enddo?
    thanks
    Alexandre Giguere

    Alexandre,
    Here is an example. Suppose your internal table is called 'ITEMS'.
    lr_node = lr_document->find_from_name('ITEMS').
    lv_num_of_children = lr_node->num_children( ).
    lr_nodechild = lr_node->get_first_child( ).
    do lv_num_of_children times.
        lv_num_of_attributes = lr_nodechild->num_children( ).
        lr_childchild = lr_nodechild->get_first_child( ).
       do lv_num_of_attributes times.
          lv_value = lr_childchild->get_value( ).
          case sy-index.
             when 1.
               wa_item-field1 = lv_value
             when 2.
               wa_item-field2 = lv_value.
          endcase.
          lr_childchild = lr_childchild->get_next( ).
       enddo.
       append wa_item to lt_item.
       lr_nodechild = lr_nodechild->get_next( ).
    enddo.

  • Steps for: Internal table - convert to PDF - Sotre PDF files on UNIX Server

    Hi Experts,
                      My requirement is to Split an internal table into multiple tables and generate a PDF for each of them.Then I have to place these files on a unix server directory. How can I achieve this?
    This seems like a very high level requirement description .Please let me know if the solution needs some more details.
    Thanks In Advance
    Abhishek
    Edited by: Yatin Vishwas Parab on Oct 23, 2009 1:53 PM

    Hi,
    1) The logic for splitting a internal table into multiple tables should lie with you .
    2) write each of the split internal table to spool and convert them to PDF using the FM 'CONVERT_ABAPSPOOLJOB_2_PDF'. This has been discussed many times and you can find relevant threads by searching.
    3) For storing the PDF in application server, use OPEN DATASET statement in binary mode and transfer the data. Even this has been discussed quite a few times before and you can search for relevant threads
    Vikranth

  • Need a logic for Internal table processing

    Hi,
    I have a requirement...an internal table contains three fields material no, bin no, and Quantity
    Mat. No    |         Bin No        |              Quantity
    a              |              x1         |                   10
    a              |              x1         |                   10
    a              |              x2         |                   20
    b              |              x3         |                   10 
    c              |              x3         |                   20
    c              |              x4         |                   30
    c              |              x4         |                   40
    In this I need to append the records to new internal table say itab1 where multiple entries exist for some material no like mat no 'a' and 'c'  and
    if the material no. exist only once in the table, it has to be moved to another new internal table say itab2.
    Pls suggest some logic that does not have performance issues.
    Thanks in advance
    Saravana

    Hi there,
    a solution in brief...
    data: wa_itab1_a like itab1,
             wa_itab2_b like itab1,
             lv_tabix       type sytabix.
    sort itab1 by matnr.
    loop at itab1.
      wa_itab1_a = itab1.
      at new matnr.
        lv_tabix = sy-tabix + 1.
        clear wa_itab2_b.
        READ TABLE itab1 into wa_itab2_b
                            INDEX lv_tabix.
        if wa_itab2_b-matnr ne wa_itab1_a-matnr.
          append wa_itab1_a to itab2.
          delete itab1 where matnr = wa_itab1_a-matnr.
        endif.
      endat.
    endloop.
    Regards
    George Zervas
    Edited by: gzervas on Oct 20, 2010 12:08 PM

  • Defining attribute for internal table within class builder?

    Hello there,
    I use an function module that provides me an internal table which has the reference type of the DDIC object zml_output. Furthermore I call this function module within a global class that should keep the result of the function module into the attribute lt_result, that is declared as private and typed with
    lt_result TYPE zml_output.
    Even the definition of that attribute causes the following error message:
    "lt_result" is not an internal table.
    I don't have any clue how to type lt_result differently. Actually I would need the following type of typing "TYPE TABLE OF" but that does not exist within the class builder.
    Thanks for your help in advanced!
    Robert

    Hi Konstantinidis ...
    Of course I can provide it to you. The code of my methode load_data reads as follows:
    method LOAD_DATA.
        CALL FUNCTION 'ZDATAGET'
        EXPORTING
          iv_dat    = iv_dat
          iv_time1  = iv_time1
          iv_delta  = iv_delta
        TABLES
          et_result = lt_result.
    endmethod.
    Especially the lt_result causes the mentioned error message
    The compiler seems to expect something "TABLE" like for attribute lt_result. But whatever I tried it doesn't seem to work out.
    Many thanks for help...

  • Data allocation for internal table rows Dynamically

    Hi Friends
    I have requirement like below:
    I have one internal table with 400 amounts columns, I will get the value from another program
    that indicates to which column I have to add the values. I dont want to write the case statement
    because I need to write 400 WHEN statements.
    Is there any alternative way dynamically I can choose the internal table column and assign the value which
    I am getting from external program.
    Please help on this as soon as possible.
    Points will be rewarded
    Thanks
    Praveen

    Hi Praveen,
    you may use the ASSIGN COMPONENT ... OF STRUCTURE ... statement.
    It allows to assign the field by name or by sequence.
    Assume you columns have names like amount_001 to amount_999 and are fields of structure ls_amounts. The do as decribed here roughly:
    data:
      lv_fieldseq type NUMC_3,
      lv_fieldname type fieldname,
      lv_amount type (???).
    fieldsymbols:
      <amount> type any.
    * fetch amount and field sequence from external data into  lv_amount and lv_fieldseq
    concatenate 'AMOUNT_' lv_fieldseq into lv_fieldname.
    * <amount> is something like a pointer
    assign component (lv_fieldname) of structure ls_amounts to <amount>.
    add lv_amount  to <amount>. 
    if you are sure you have the correct position of the amount field in the structure stored in variable lv_position, you may use
    assign component lv_position of structure ls_amounts to <amount>.
    I prefer the ASSIGN (fieldname) for reasons of more transparency and less danger in case of structural changes.
    Regards,
    Clemens
    Regards,
    Clemens

Maybe you are looking for