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

Similar Messages

  • I am getting problem with internal table & work area declaration.

    I am working with 'makt' table ..with the table makt i need to work with styles attributes ..so i declared like this
    TYPES : BEGIN OF ty_makt,
             matnr TYPE makt-matnr,
             spras TYPE makt-spras,
             maktx TYPE makt-maktx,
             maktg TYPE makt-maktg,
             celltab TYPE lvc_t_styl,
           END OF ty_makt.
    DATA : i_makt TYPE TABLE OF ty_makt.
    DATA : wa_makt TYPE ty_makt .
        But end of program i need to update dbtable "makt"...i am getting problem with internal table & work area declaration.
    i think makt table fields mapping and internal table/work area mapping is not correct. so please help me to get out from this.

    Hi Nagasankar,
    TYPES : BEGIN OF TY_MATNR,
                  MATNR TYPE MAKT-MATNR,
                  SPRAS TYPE MAKT-SPRAS,
                  MAKTX TYPE MAKT-MAKTX,
                  MAKTX TYPE MAKT-MAKTG,
                  CELLTAB TYPE LVC_T_STYL,  " Its Working perfectly fine..
                 END OF TY_MAKT.
    DATA: IT_MAKT TYPE STANDARD TABLE OF TY_MAKT,
              WA_MAKT TYPE TY_MAKT.
    Its working perfectly fine. if still you are facing any issue post your complete code.
    Thanks,
    Sandeep

  • 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 &lt;n&gt;.
    IF sy-subrc EQ 0.
    *&quot; Process the n records
    ENDIF.
    ENDSELECT.
    regards,
    Prabhu
    Reward if helpful

  • Import , Export problem in Internal table

    Hi all,
    I am using ver 4.6C.
    I have 2 programs  namely X an Y.
    X is main program  and Y is having some Internal table with data. I want to use Y internal table in X program.
    In X program.
    I used SUBmit to call Y program . After Submit  I used Import as follows.
    Import Itab from memory id 'ABC'.
    In y program  used Export as follows
    Export itab from memory id 'ABC'.
    When I put break-point and check ITAB in X program it is empty.
    Anyone help me or send code will be appreciated.
    Thanks
    Rathnam

    Hi Stalin,
    i did it the following way:
    CONSTANTS: memid_zfo0consu_upl(13) TYPE c VALUE 'ZFO0CONSU_UPL'.
    TYPES: BEGIN OF t_zfo0consu_upl,
             zfo0consu type /bic/oizfo0consu.
    TYPES: END OF t_zfo0consu_upl.
    DATA: it_zfo0consu_upl     TYPE STANDARD TABLE OF t_zfo0consu_upl
                                                   WITH DEFAULT KEY.
    *&...Gesellschaft exportieren
            EXPORT zfo0consu_upl = it_zfo0consu_upl TO MEMORY ID
                                                  memid_zfo0consu_upl.
    and then the import.
      CONSTANTS: memid_zfo0consu_upl(13) TYPE c VALUE 'ZFO0CONSU_UPL'.
      DATA: BEGIN OF it_zfo0consu_upl OCCURS 0,
               zfo0consu_upl TYPE /bic/oizfo0consu.
      DATA: END   OF it_zfo0consu_upl.
    *&...Import der Upzuloadenden Gesellschaft
      IMPORT zfo0consu_upl = it_zfo0consu_upl
                              FROM MEMORY ID memid_zfo0consu_upl.
    <b>Reward if useful.</b>
    Kind regards
    Henner

  • Problem with internal table initialisation in EBP system

    Hi
    I work in EBP system, and i made a specific work in LBBP_POCF0o program. It is in the displaying items of a purchase order.
    This is what i done:
    LOOP AT t_screen_items WHERE del_ind NE 'X'.
            w_old_total = w_old_total + t_screen_items-value.
            CLEAR:t_screen_items.
    ENDLOOP.
    loop at gt_item where del_ind ne 'X'.
          w_new_total = w_new_total +
              ( gt_item-GROSS_PRICE * gt_item-quantity ).
          clear: gt_item.
    endloop.
        if w_new_total GT w_old_total.   
           MESSAGE I001(ZBBP_PO) WITH
             'elle possède un montant supérieur'
             ' à celui déterminé intialement.'
             'Veuillez modifier la commande.'.
           MOVE 'X' TO w_checksum_flag.
        endif.
    My problem is that if i use the elevator at the screen, the system is looping only at the first element visible on the screen, so the "LOOP AT t_screen_items" is wrong. i don't understand why the sytem doesn't count all the elements of the internal table t_screen_items...
    Thank you for your help.

    Well, i will try to be more clearly...
    My problem is very suprising..In the purchase order screen, if there's more than 10 items, there's an elevator (or ascencor) to permit displaying the items which are hidden. And so, when i use the elevator, and when i want to see the details of the item, the "loop at t_item_screens" only begins at the first item visible. For exemple, if i have 13 items, i want to see the 11th item, i have to use the elevator, and then in the "loop at t_item_screens", the loop will do only 3 times the loop, it will begin only from the 11th item... The loop won't begin at the first element.... I really don't understand.
    Sorry if i'm not clearly... Anyway, thank you for your help.

  • Problem with Internal table

    HI,
    I need to DMBE2 value as with respective of Month, Year and Inception date.
    I need the output to be like
    HKONT  BLART PRCTR DMBE2(Month) DMBE2 (Year) DMBE3 (Year)
    Below is my code
    DATA : BEGIN OF gt_lkorr OCCURS 0,
              hkont LIKE bsis-hkont,
              prctr LIKE bsis-prctr,
              bewar LIKE bsis-bewar,
              dmbe2 LIKE bsis-dmbe2,
              belnr LIKE bsis-belnr,
              budat LIKE bsis-budat,
              monat LIKE bsis-monat,
              gjahr LIKE bsis-gjahr,
              blart LIKE bsis-blart,
              shkzg like bsis-shkzg,
           END OF gt_lkorr.
    *DATA : wa_lkorr LIKE gt_lkorr OCCURS 0 WITH HEADER LINE.
    DATA : BEGIN OF wa_lkorr OCCURS 0,
              hkont LIKE bsis-hkont,
              prctr LIKE bsis-prctr,
              bewar LIKE bsis-bewar,
              dmbe2 LIKE bsis-dmbe2,
              belnr LIKE bsis-belnr,
              budat LIKE bsis-budat,
              monat LIKE bsis-monat,
              gjahr LIKE bsis-gjahr,
              blart LIKE bsis-blart,
             dmbe2_2 LIKE bsis-dmbe2,
             dmbe2_3 LIKE bsis-dmbe2,
           END OF wa_lkorr.
    DATA : gt_final_lkorr LIKE wa_lkorr OCCURS 0 WITH HEADER LINE.
    FORM f_get_t030hb_tr.
      SELECT hkont lkorr FROM t030hb INTO CORRESPONDING FIELDS OF
                          TABLE gt_tr_t030hb
                          WHERE ktopl = 'KCOA'
                          AND   bwber = 'TR'
                          AND hkont IN so_hkont.
      IF gp_pprct IS INITIAL.
        SELECT hkont prctr bewar dmbe2 belnr budat monat gjahr blart
                           FROM bsis INTO CORRESPONDING
                           FIELDS OF TABLE gt_lkorr FOR ALL ENTRIES
                           IN gt_tr_t030hb
                           WHERE bukrs IN so_bukrs
                           AND gjahr IN so_gjahr
                           AND prctr IN so_prctr
                           AND hkont = gt_tr_t030hb-lkorr
                           AND vbund IN so_vbund.
      ELSE.
        LOOP AT gt_prctr.
          SELECT hkont prctr bewar dmbe2 belnr budat monat gjahr blart
                             FROM bsis INTO CORRESPONDING
                             FIELDS OF TABLE gt_lkorr FOR ALL ENTRIES
                             IN gt_tr_t030hb
                             WHERE bukrs IN so_bukrs
                             AND gjahr   IN so_gjahr
                             AND prctr = gt_prctr-prctr
                             AND hkont = gt_tr_t030hb-lkorr
                             AND vbund IN so_vbund.
        ENDLOOP.
      ENDIF.
      DELETE ADJACENT DUPLICATES FROM gt_lkorr COMPARING ALL FIELDS.
    ENDFORM.                    "f_get_t030hb_tr
    *&      Form  f_get_yearwise_data
          text
    FORM f_get_yearwise_data.
      DATA : lv_period LIKE t009b-poper.
      DATA : lv_year LIKE bsis-gjahr,
             lv_dmbe2 LIKE bsis-dmbe2.
      LOOP AT gt_lkorr.
        CALL FUNCTION 'DATE_TO_PERIOD_CONVERT'
          EXPORTING
            i_date               = sy-datum
             I_MONMIT             = 00
            i_periv              = 'K4'
         IMPORTING
           e_buper              = lv_period
             E_GJAHR              =
        EXCEPTIONS
          input_false          = 1
          t009_notfound        = 2
          t009b_notfound       = 3
          OTHERS               = 4
        IF gt_lkorr-monat EQ lv_period.
            wa_lkorr-hkont = gt_lkorr-hkont.
            wa_lkorr-prctr = gt_lkorr-prctr.
            wa_lkorr-bewar = gt_lkorr-bewar.
            wa_lkorr-dmbe2 = gt_lkorr-dmbe2.
            wa_lkorr-blart = gt_lkorr-blart.
            if gt_lkorr-shkzg = 'H'.
              wa_lkorr-dmbe2 = - wa_lkorr-dmbe2.
            endif.
          COLLECT wa_lkorr.
        endif.
    ENDLOOP.
          LOOP AT wa_lkorr INTO gt_final_lkorr.
            write  : / gt_final_lkorr-hkont,
                     gt_final_lkorr-prctr,
                     gt_final_lkorr-bewar,
                     gt_final_lkorr-dmbe2,
                     gt_final_lkorr-blart.
          ENDLOOP.
    write : ' Inception to date'.
      LOOP AT gt_lkorr.
        CALL FUNCTION 'DATE_TO_PERIOD_CONVERT'
          EXPORTING
            i_date               = sy-datum
             I_MONMIT             = 00
            i_periv              = 'K4'
         IMPORTING
          e_buper              = lv_period
              e_gjahr              = lv_year
        EXCEPTIONS
          input_false          = 1
          t009_notfound        = 2
          t009b_notfound       = 3
          OTHERS               = 4
        IF gt_lkorr-gjahr EQ lv_year.
            wa_lkorr-hkont = gt_lkorr-hkont.
            wa_lkorr-prctr = gt_lkorr-prctr.
            wa_lkorr-bewar = gt_lkorr-bewar.
            wa_lkorr-dmbe2 = gt_lkorr-dmbe2.
            wa_lkorr-blart = gt_lkorr-blart.
            if gt_lkorr-shkzg = 'H'.
              wa_lkorr-dmbe2 = - wa_lkorr-dmbe2.
            endif.
          COLLECT wa_lkorr.
        endif.
    ENDLOOP.
          LOOP AT wa_lkorr into gt_final_lkorr.
            WRITE : / gt_final_lkorr-hkont,
                      gt_final_lkorr-prctr,
                      gt_final_lkorr-bewar,
                      gt_final_lkorr-dmbe2,
                      gt_final_lkorr-blart.
             move : wa_lkorr-dmbe2_2 to gt_final_lkorr-dmbe2_2.
             modify gt_final_lkorr.
             clear gt_final_lkorr.
          ENDLOOP.
    loop at gt_lkorr.
            wa_lkorr-hkont = gt_lkorr-hkont.
            wa_lkorr-prctr = gt_lkorr-prctr.
            wa_lkorr-bewar = gt_lkorr-bewar.
            wa_lkorr-dmbe2 = gt_lkorr-dmbe2.
            wa_lkorr-blart = gt_lkorr-blart.
            if gt_lkorr-shkzg = 'H'.
              wa_lkorr-dmbe2 = - wa_lkorr-dmbe2.
            endif.
          COLLECT wa_lkorr.
    ENDLOOP.
          LOOP AT wa_lkorr into gt_final_lkorr.
            WRITE : / gt_final_lkorr-hkont,
                      gt_final_lkorr-prctr,
                      gt_final_lkorr-bewar,
                      gt_final_lkorr-dmbe2,
                      gt_final_lkorr-blart.
          ENDLOOP.
    Please let me know how to do it?
    Thanks,
    Pavan.

    I think you need to insert a field in your wa_lkorr internal table for key which you should populate as M for month data, Y2 for Year data and Y3 for dmbe3 data.
    So when you want to display they are three different records.

  • No extended memory for the internal table

    Hi all,  I created one filed in the selection screen with f4 help, this is the code i writtenAT SELECTION-SCREEN ON VALUE-REQUEST FOR PA_BKTXT.
    SELECT  BKTXT  INTO TABLE T_BKTXT from mkpf.
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
      EXPORTING
      DDIC_STRUCTURE         = ' '
        RETFIELD               =  'BKTXT'
      PVALKEY                = ' '
       DYNPPROG               = SY-CPROG
       DYNPNR                 = SY-DYNNR
       DYNPROFIELD            = 'PA_BKTXT'
      STEPL                  = 0
    WINDOW_TITLE           = ' '
      VALUE                  = ' '
       VALUE_ORG              = 'S'
      MULTIPLE_CHOICE        = ' '
      DISPLAY                = ' '
      CALLBACK_PROGRAM       = ' '
      CALLBACK_FORM          = ' '
      MARK_TAB               =
    IMPORTING
      USER_RESET             =
      TABLES
        VALUE_TAB              = T_BKTXT
      FIELD_TAB              =
      RETURN_TAB             =
      DYNPFLD_MAPPING        =
    EXCEPTIONS
      PARAMETER_ERROR        = 1
      NO_VALUES_FOUND        = 2
       OTHERS                 = 3.
    IF SY-SUBRC <> 0.
    REFRESH T_BKTXT.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    <b>and the internal table i declared is</b>  DATA: BEGIN OF T_BKTXT OCCURS 0,
      PA_BKTXT type MKPF-BKTXT,
      END OF T_BKTXT. please let me know how to solve this issue.

    Hi  friend  ... please see this 
    Here is the example program for the F4 impelemting to the Selection Parameter ..
    REPORT demo_dynpro_f4_help_module .
    TYPES: BEGIN OF values,
             carrid TYPE spfli-carrid,
             connid TYPE spfli-connid,
           END OF values.
    DATA: carrier(3) TYPE c,
          connection(4) TYPE c.
    DATA: progname TYPE sy-repid,
          dynnum   TYPE sy-dynnr,
          dynpro_values TYPE TABLE OF dynpread,
          field_value LIKE LINE OF dynpro_values,
          values_tab TYPE TABLE OF values.
    CALL SCREEN 100.
    MODULE init OUTPUT.
      progname = sy-repid.
      dynnum   = sy-dynnr.
      CLEAR: field_value, dynpro_values.
      field_value-fieldname = 'CARRIER'.
      APPEND field_value TO dynpro_values.
    ENDMODULE.
    MODULE cancel INPUT.
      LEAVE PROGRAM.
    ENDMODULE.
    MODULE value_carrier INPUT.
      CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
           EXPORTING
                tabname     = 'DEMOF4HELP'
                fieldname   = 'CARRIER1'
                dynpprog    = progname
                dynpnr      = dynnum
                dynprofield = 'CARRIER'.
    ENDMODULE.
    MODULE value_connection INPUT.
      CALL FUNCTION 'DYNP_VALUES_READ'
           EXPORTING
                dyname             = progname
                dynumb             = dynnum
                translate_to_upper = 'X'
           TABLES
                dynpfields         = dynpro_values.
      READ TABLE dynpro_values INDEX 1 INTO field_value.
      SELECT  carrid connid
        FROM  spfli
        INTO  CORRESPONDING FIELDS OF TABLE values_tab
        WHERE carrid = field_value-fieldvalue.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
           EXPORTING
                retfield    = 'CONNID'
                dynpprog    = progname
                dynpnr      = dynnum
                dynprofield = 'CONNECTION'
                value_org   = 'S'
           TABLES
                value_tab   = values_tab.
    ENDMODULE.
    reward points if it is usefull ...
    Girish

  • Data fetching problem in internal table

    Hi All,
    I have two internal table which are of type as shown below.
    itab1 is of following type:
    regno(255) type c,
    uid type c
    itab2 is of following type
    regno type regno,
    uid type userid,
    address type add,
    phno type phn.
    Datas in itab2 are as follows:
    100       01       india              3454534
    200       01       china             34553543
    300       02       us                  6464654
    400       02       uk                   45654
    Itab1 is populated using the uid field as key as shown below.
    regno                          uid
    100 200                           01
    300 400                           02
    100 200 are values in field regno
    01  is uid.
    What we have done is collected all the regno which belong to the same uid for sending a single mail to the uid person with both the regno. We are able to achieve this. For this finally we loop into itab1 and fetch the uid and send mail to him.
    Now an extra requirement is to send the details of a regno (address and phno) along with the mail. The prob is in our final internal table we have a character field which will have all the regno for a uid (may be upto 20). Each regno will be of length 3.
    I have to loop into tab1 and read tab2 to achieve this using uid as key. But regno will for a uid will be combined. I have fetch each regno say 100 first and get the details and then 200 and then get the details and send a mail to uid 01. Then 300 and 400 details and then a mail to uid 02.
    Please explain how to get individual regno when i loop into tab1 and read tab2 so that i can fetch the details.
    Any suggestion will be very helpful

    Hi Aslam,
    As per my understanding...
    In itab1, instead of maintaining all the reg no in the same field(like 100 200 300 ....) againist uid 01
    maintain multiple records like
    regno  udi
    100      01
    200      01
    300      01 etc
    (in this case the combination of regno & uid becomes the key.)
    now while ur sending mail to the people, just loop the recors of itab1
    in the same loop u can just write a read statement to get the remainig details(address, phone no etc..) of that regno from itab2.
    Hope this helps you, revert back if still u hav any problm.

  • Problem in Internal table Record Splitting

    Hi All,
    Plz look into my below requirement and me know your Suggestions.
    My Internal tables :
    1.*Internal table for Infotype 2002 (Attendances)
    DATA : BEGIN OF T_PA2002 OCCURS 0,
           PERNR LIKE PA2002-PERNR,
           BEGDA LIKE PA2002-BEGDA,
           ENDDA LIKE PA2002-ENDDA,
           BEGUZ LIKE PA2002-BEGUZ,
           ENDUZ LIKE PA2002-ENDUZ,
           SUBTY LIKE PA2002-SUBTY,
           END OF T_PA2002.
    1.*Internal table for Infotype 9003 (Custom Attendances)
    DATA : BEGIN OF T_PA9003HRABS OCCURS 0,
           PERNR LIKE PA9003-PERNR,
           BEGDA LIKE PA9003-BEGDA,
           ENDDA LIKE PA9003-ENDDA,
           SHIFT LIKE PA9003-SHIFT,
           OTHOURS LIKE PA9003-OTHOURS,
           BEGUZ LIKE PA2002-BEGUZ,
           ENDUZ LIKE PA2002-ENDUZ,
           NSA LIKE PA9003-NSA,     
           MA  LIKE PA9003-MA,     
           CA  LIKE PA9003-CA,
           END OF T_PA9003HRABS.
    Requirement :
    1.  Internal table T_PA2002
        PERNR     BEGDA          ENDDA          BEGUZ          ENDUZ
         5          27.12.2006     27.12.2006     10:00:00     14:30:00
    2.  Internal table T_PA9003HRABS
        PERNR     BEGDA          ENDDA          BEGUZ          ENDUZ          HRABS     OTHOURS     MA     CA     WA
         5          27.12.2006     27.12.2006     08:00:00     14:30:00     2     2     
    Iam doing comparision between T_PA2002 and T_PA9003HRABS.
    Iam doing some caluculation to get Hourly absence,OT Hours and else ( Fields)
    So my Hourly absence on 27.12.2006 was 2Hours.
    So i need to split my Final table as below how to do that....( It is like In infotypes COPY option i.e 1 record to 3 Record )
    I need the Output like this...
    3.  Final Internal table T_PA9003HRABS
        PERNR     BEGDA          ENDDA          BEGUZ          ENDUZ          HRABS     OTHOURS     MA     CA     WA
         5          25.12.2006     26.12.2006     08:00:00     14:30:00     0     0     
         5          27.12.2006     27.12.2006     08:00:00     14:30:00     2     2     
         5          25.12.2006     26.12.2006     08:00:00     14:30:00     0     0     
    Points will be rewarded.
    Thanks,
    Suresh.U

    you could:
    sort T_PA2002 by pernr.
    sort T_PA9003HRABS by pernr.
    loop at T_PA2002
    read table T_PA9003HRABS with key
    pernr = T_PA2002-pernr
    begda = T_PA2002-begda
    binary search.
    ***here you can specify how you calculate
    ***your absences and apply them to your
    ***final internal table.
    endloop.
    hope this helps.
    Warren

  • Problem in internal table calculation

    i have internal table values as follows ( for eg.)
    person          month                  amount1                amount2
    A                   jan                     rs.500(1)                       rs.1000 (3)
    A                  feb                       rs.500   (2)                   rs.1000
    B                  jan                       rs.1000(1)                 rs.2000(4)
    B                  feb                       rs.1500(2)                 rs.2000
    B                  mar                       rs.1000(3)                rs.1000
    i need to total the values - total = 123+4 and populate to another table as
    person          amount
    A                   123 so the value will be 2000
    B                   123+4 the value will be 5500.
    i have written the code using AT NEW AND AT END OF... but i need to work it with IF condition... so plz help me in this regard...
    <removed_by_moderator>
    thank you
    Edited by: Julius Bussche on Sep 5, 2008 7:55 PM

    Hi,
    Use the logic.
    person month amount1 amount2
    A jan rs.500(1) rs.1000 (3)
    A feb rs.500 (2) rs.1000
    B jan rs.1000(1) rs.2000(4)
    B feb rs.1500(2) rs.2000
    B mar rs.1000(3) rs.1000
    Sort it on person.
    take temporary variables for Person.
    g_1 and g_2.
    g_var is for the amount.
    loop on itab.
    MOve itab-peson to g_1.
    g_index  = sY-tabix + 1.
    read itab into wa index g_index.
    if sy-subrc eq 0 and wa-person = itab-person.
      g_var = amount 1 + amount2 + g_var.
    elseif sy-subrc eq 0 and wa-person NE itab-person.
      append a new record.
    clear: g_var.
    else.
      append a new record with the data
    clear: g_var.
    endif.
    endloop.
    Regards,
    Venkatesh

  • Problem with internal table declaration in function gui_upload

    hi friends,
    can u tell me how should i define internal table when i use this function?
    i get error that in oo my declaration not good.
    thanks,
    dana.

    see this example:-
    DATA: BEGIN OF itab OCCURS 0,
            tdname   TYPE mara-matnr,
            tdline1  TYPE tline-tdline,
            tdline2  TYPE tline-tdline,
            tdline3  TYPE tline-tdline,
            tdline4  TYPE tline-tdline,
            tdline5  TYPE tline-tdline,
                  END OF itab.
    DATA: BEGIN OF itab_error OCCURS 0,
            tdname  TYPE mara-matnr,
            error   TYPE string,
          END OF itab_error.
    DATA: lines    TYPE STANDARD TABLE OF tline WITH HEADER LINE.
    DATA: temp     TYPE string.
    DATA: tdspras  TYPE thead-tdspras.
    DATA: tdname   TYPE thead-tdname.
    DATA: tdobject TYPE thead-tdobject.
    DATA: tdid     TYPE thead-tdid.
    DATA :flag     TYPE c.
    At Selection Screen Event
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p1.
      CALL FUNCTION 'F4_FILENAME'
        IMPORTING
          file_name = p1.
    At Start of Selection Event
    START-OF-SELECTION.
      PERFORM upload_data.
      PERFORM upload_text.
    *&      Form  upload_data
          text
    -->  p1        text
    <--  p2        text
    FORM upload_data .
      temp = p1.
    **& Upload Data from Excel
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename            = temp
          filetype            = 'ASC'
          has_field_separator = 'X'
        TABLES
          data_tab            = itab.
    ENDFORM.                    " upload_data
    *&      Form  upload_text
          text
    -->  p1        text
    <--  p2        text
    FORM upload_text .
      tdspras  = 'EN'.
      tdid = 'BEST'.
      tdobject = 'MATERIAL'.
      LOOP AT itab.
        REFRESH lines.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
          EXPORTING
            input  = itab-tdname
          IMPORTING
            output = itab-tdname.
        TRANSLATE itab-tdname TO UPPER CASE.
        tdname = itab-tdname.
        PERFORM check_material.
        lines-tdline = itab-tdline1.
        APPEND lines.
        CLEAR lines.
        lines-tdline = itab-tdline2.
        APPEND lines.
        CLEAR lines.
        lines-tdline = itab-tdline3.
        APPEND lines.
        CLEAR lines.
        lines-tdline = itab-tdline4.
        APPEND lines.
        CLEAR lines.
        lines-tdline = itab-tdline5.
        APPEND lines.
        CLEAR lines.
        CALL FUNCTION 'CREATE_TEXT'
          EXPORTING
            fid       = tdid
            flanguage = tdspras
            fname     = tdname
            fobject   = tdobject
          TABLES
            flines    = lines.
      ENDLOOP.
      IF itab_error[] IS NOT INITIAL.
        WRITE : / 'PO Text For Following Material is not Uploaded'.
        WRITE : / .
        WRITE : / 'Material', '              Error'.
        LOOP AT itab_error.
          WRITE : / itab_error-tdname, '   ',  itab_error-error.
        ENDLOOP.
      ELSE.
        MESSAGE s001(38) WITH 'Data Uploaded Succcesfully'.
      ENDIF.
    ENDFORM.                    " upload_text
    *&      Form  check_material
          text
    -->  p1        text
    <--  p2        text
    FORM check_material .
      DATA : w_matnr TYPE mara-matnr.
      SELECT SINGLE matnr
      INTO w_matnr
      FROM mara
      WHERE matnr = itab-tdname.
      IF sy-subrc = 0.
        flag = 'X'.
      ELSE.
        MOVE-CORRESPONDING itab TO itab_error.
        itab_error-error = 'Material does not exist'.
        APPEND itab_error.
      ENDIF.
    ENDFORM.                    " check_material

  • Memory space issue in internal table

    Hi ,
    My report is dumping because there is no memory space availabe for extending the memory of an internal table, after it gets filled with about 2500000 lakh records.
    the dump analysis is as follows :-
    Error analysis
    The internal table (with the internal identifier "IT_317") could not be
    enlarged any further. To enable error handling, the internal table had
    to be deleted before this error log was formatted. Consequently, if you
    navigate back from this error log to the ABAP Debugger, the table will
    be displayed there with 0 lines.
    When the program was terminated, the internal table concerned returned
    the following information:
    Line width: 1700
    Number of lines: 106904
    Allocated lines: 106904
    New no. of requested lines: 8 (in 1 blocks)
    How to correct the error
    The amount of storage space (in bytes) filled at termination time was:
    Roll area...................... 7272944
    Extended memory (EM)........... 603339264
    Assigned memory (HEAP)......... 396390176
    Short area..................... " "
    Paging area.................... 40960
    Maximum address space.......... 529887568
    You may able to find an interim solution to the problem
    in the SAP note system. If you have access to the note system yourself,
    use the following search criteria:
    Please suggest what can be done.
    Regards,
    Vikas Arya

    Hi,
    This solution might not sound good. But give a thought.
    While appending data u may take more than one internal table.
    Append first 10lakh records to 1st table, Second 10 lakhs to second table etc.
    But from where are u getting the source data? It should be present in some internal table correct?
    Probably u can use dynamic internal tables concept.
    Also check ur code carefully. After the place of appending if u are not going to use any internal tables then use FREE itab
    statement to free the memory allocated.
    Also reduce the global declarations as much as possible
    Thanks,
    Vinod.

  • Report output from memory to internal table (corresponding fields)

    How can we pick any standard report output such as
    RM07DOCS on to memory and from memory to an internal
    table.Here by internal table ,i do not mean of type c
    containing complete report but data should go from output to corresponding fields of internal table structure of whom is defined as same of the output.

    SUBMIT rfbila00 AND RETURN
         EXPORTING LIST TO MEMORY
        WITH sd_ktopl-low = ' '
         WITH sd_bukrs IN  s_bukrs
         WITH sd_prctr IN s_prctr
         WITH bilavers =  p_fsv
         WITH bilaspra =  'EN'
         WITH bilbjahr =   p_fyear
         WITH b-monate IN s_per
         WITH bilvjahr = v_cfyear
         WITH v-monate = l_per
         WITH bilagvar = P_LAYOUT
         WITH bilagrid = 'X'
         WITH bilabkon = '2'
         WITH bilagkon = '3'
         WITH bilasumm = '0'
         WITH bilavart = '1'
         WITH bilaskal = '3/0'.
      CALL FUNCTION 'LIST_FROM_MEMORY'
        TABLES
          listobject = t_list
        EXCEPTIONS
          not_found  = 1.
      REFRESH t_ascii.
      CALL FUNCTION 'LIST_TO_ASCI'
        TABLES
          listasci           = t_ascii " list converted to ASCII
          listobject         = t_list
        EXCEPTIONS
          empty_list         = 1
          list_index_invalid = 2
          OTHERS             = 3.
    u will get the output in t_list...u have to split as per ur requir......
    this will help u.....
    Reward IF...........
    Regards
    Anbu

  • Creation of view and use it as internal table

    dear community,
                   My questions is taht i am write a select quary in that data is very huge so that it cant inserted in to internal table(memory size of internal table) so i thing that i create aview same as data base table and when write the select quary use packsize and transfer recoerd ds in that view and use this view in my program
    is above logic can work or not
    also is size of view is greater than internal table memory size.

    Writing the large volume to another table(which a view is just a view of a table or group of tables) is not going to solve the problem.  You still have to select the data from the view(or table).  Like I said in your other threads, you need to read by package size, and do something with that subset, whether it is summaring, or writeing to another system via RFC.
    Regards,
    Rich Heilman

  • Select into internal table

    Hello abap-gurus,
    I have a small problem when doing a select into an internal table. As i select and append into an internal table, the program dumps as there is not enough memory for the internal table. The SAP-table i'm selecting from is simply too big. So I'm wondering if there is a way to stop or set the max lines in the internal table to say 10000 rows? I would appreciate any example.. the statement looks like this:
    SELECT * INTO l_bdcpv
    FROM  bdcpv
    WHERE not process = 'X'
    AND   mestype = 'ISM_MATMAS'.
    APPEND l_bdcpv TO i_bdcpv.
    ENDSELECT.
    Best regards Ballo

    HI,
    DATA: I_BDPCV LIKE BDPCV OCCURS 0 WITH HEADER LINE.
    SELECT * FROM BDPCV INTO I_BDPCV UP TO 100 ROWS WHERE PROCESS NE 'X' AND MESTYPE = 'ISM_MATMAS'.
    APPEND I_BDPCV.
    ENDSELECT.
    Regards
    CNU

Maybe you are looking for