Occurs 0 term in internal tables

Hello frendz!!
occurs 0 term in internal tables .PLz tell me in details.
regards

Hi Sudha,
OCCURS <NUM>, where NUM is the number of records you expect to be accessing.
Also have  a look at url for more info
http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb3646358411d1829f0000e829fbfe/content.htm
Hope this helps
Thanks
Lakshman

Similar Messages

  • Short dump-internal table size issue

    Hi,
    I get the following message in the short dump analysis for a report.
    No storage space available for extending table "IT_920".
    You attempted to extend an internal table, but the required space was not available.
    Error Analysis:
    The internal table "IT_920" could not be enlarged further.             
    To extend the internal table, 9696 bytes of storage space was          
    needed, but none was available. At this point, the table "IT_920" has  
    1008240 entries.
    Its an old report and I saw the internal table declaration using the "OCCURS" clause in the internal table declaration.
    begin of itab occurs 100.
    end of itab.
    I tried the option of changing to "OCCURS 0", still issue persists.
    Any help would be highly appretiated
    CM

    Hello CMV,
    This is basic problem with SAP internal tables. For every internal table memory is alocated ( Max..256K)...once you cross the memory size/limit of the internal table it resuls in short dump.
    Only way to overcome this problem is handle limited number of records at a time.. 
    Please refer following sample code which will help you to avoid short dump while processing large number of records....
      SORT TAB_RESULT.
      DESCRIBE TABLE TAB_RESULT LINES W_RECORDS.
      W_LOW      = 1.
      W_UP       = 1000.
    *Spliting the records from tab_result1 by pakage of 1000 at a time
    *to avoid short dump in case of more records
      WHILE W_LOW <= W_RECORDS.
        R_PKUNWE-SIGN = 'I'.
        R_PKUNWE-OPTION = 'EQ'.
        R_WERKS-SIGN = 'I'.
        R_WERKS-OPTION = 'EQ'.
        LOOP AT TAB_RESULT FROM W_LOW TO W_UP.
          MOVE TAB_RESULT-PKUNWE TO R_PKUNWE-LOW.
          MOVE TAB_RESULT-WERKS  TO  R_WERKS-LOW.
          APPEND R_PKUNWE.
          APPEND R_WERKS.
        ENDLOOP.
    *fetch sold to party
         SELECT KUNNR NAME1
           FROM KNA1
           APPENDING CORRESPONDING FIELDS OF TABLE TAB_KNA1
           WHERE KUNNR IN R_PKUNWE.
    *fetch plant
      SELECT WERKS NAME1
             FROM T001W
             APPENDING CORRESPONDING FIELDS OF TABLE TAB_T001W
             WHERE WERKS IN R_WERKS.
       REFRESH: R_PKUNWE,
                R_WERKS.
        W_LOW = W_LOW + 1000.
        W_UP  = W_UP  + 1000.
      ENDWHILE.
    Hope this will help you to solve problem.
    Cheers,
    Nilesh

  • Search in internal table utility

    Hi Experts,
    As per my requirement we need a utlity i.e a  class or F.M  which search for a "Word" or "Phrase" in fields of internal table and display the internal table output  based on there ranking.
    For example:
    Search term in internal table is:          Novartis  Global  
    My Internal table has records like this:
    ITAB
    FIELD1                                FIELD2                                   FIELD3                  LINE
    Novartis Global                   xyz                                        Global                    1
    ABC                                  Novartis                                   DXY                       2
    Novartis Global                Novartis Global                        Novartis Global       3
    1020                                  EWR                                       Globaling                 4
    My O/p should be
    FIELD1                                FIELD2                                   FIELD3                    LINE
    Novartis Global                Novartis Global                        Novartis Global         3
    Novartis Global                   xyz                                        Global                       1
    ABC                                  Novartis                                   DXY                          2
    1020                                  EWR                                      Globaling                     4
    For achieving this i used command
    FIND ALL OCCURRENCES OF Novartis  Global     IN TABLE ITAB  RESULTS IT_RESULTS  IN CHARACTER MODE .
    Since all records in my internal table have the search term already it retunrs all the records but i want to RANK these records
    based on my search term
    1.Records which exactly match the keyword in all fields should be first
    2.Records which have the key word in atleast 1 field should be second
    3.Records which have one word of 2 should be third
    and so on RANKING BASED on search term.
    Please suggest how should i go about it ? I am not sure what kind of logic is required here.
    Any suggestions will be appreciated.
    Thanks
    Bhanu

    TYPES: BEGIN OF ty_data,
            f1 TYPE char30,
            f2 TYPE char30,
            f3 TYPE char30,
            line TYPE i,
           END OF ty_data.
    DATA:
    lt_data TYPE TABLE OF ty_data,
    wa_data TYPE ty_data,
    mcnt TYPE i,
    moff TYPE i,
    mlen TYPE i,
    lv_f1 TYPE i,
    lv_f2 TYPE i,
    lv_f3 TYPE i.
    LOOP AT lt_data INTO wa_data.
      lv_f1 = 0.
      lv_f2 = 0.
      lv_f3 = 0.
      FIND ALL OCCURRENCES OF wa_phrase IN wa_data-f1 IN CHARACTER MODE
      RESPECTING CASE MATCH COUNT  mcnt
      MATCH OFFSET moff
      MATCH LENGTH mlen.
      IF sy-subrc = 0.
        lv_f1 = 1.
      ENDIF.
      FIND ALL OCCURRENCES OF wa_phrase IN wa_data-f2 IN CHARACTER MODE
      RESPECTING CASE MATCH COUNT  mcnt
      MATCH OFFSET moff
      MATCH LENGTH mlen.
      IF sy-subrc = 0.
        lv_f2 = 1.
      ENDIF.
      FIND ALL OCCURRENCES OF wa_phrase IN wa_data-f3 IN CHARACTER MODE
      RESPECTING CASE MATCH COUNT  mcnt
      MATCH OFFSET moff
      MATCH LENGTH mlen.
      IF sy-subrc = 0.
        lv_f3 = 1.
      ENDIF.
      lv_f1 = lv_f1 + lv_f2 + lv_f3.
      IF lv_f1 = 3.
        wa_data-line = 1.
      ELSEIF lv_f1 > 0.
        wa_data-line = 2.
      ELSE.
        wa_data-line = 3.
      ENDIF.
      MODIFY lt_data FROM wa_data TRANSPORTING line.
    ENDLOOP.
    SORT lt_data BY line.
    LOOP AT lt_data INTO wa_data.
      WRITE:/ wa_data-f1, wa_data-f2, wa_data-f3, wa_data-line.
    ENDLOOP.
    CLEAR wa_data.
    Hi,
    The above code will sort the table for 1st and 2nd Rank properly. There is still logic to be added for 3rd Rank. The phrase should be split in words and then each word should be searched in each field of internal table and thus derive if its for 3rd Rank or not.
    Thanks,
    Murtuza

  • I want to create an internal table without using header line and occurs 0?

    hi experts,
    Can anybody help me to declare an internal table without using headerline and occurs 0 options but still i have to use the functionalities that occurs 0 and header line options provide.

    Hi Saisri,
    You can use the internal table without headerline and create a header for then internal table with the same structure. We need to use the header while manipulating with the data of the internal table.
    example:
    types: begin of ty_afpo,
                 kdauf type kdauf,
                 kdpos type kdpos,
                 ltrmp   type ltrmp,
               end   of ty_afpo.
    data : t_afpo type standard table of ty_afpo,  " internal table declaration
             wa_afpo type ty_afpo.                        " work area declaration
    <after populating the data into the internal table>
    loop at t_afpo into wa_afpo.
    write:/ wa_afpo-kdauf, wa_afpo-kdpos, wa_afpo-ltrmp.
    endloop.
    This I think shall give you a basic understanding of how things work.
    <b>Reward points if this helps,</b>
    Kiran

  • Internal Table : occurs statement

    What is the meaning of using "occurs" statement in Internal Table. What does it imply?
    DATA: BEGIN OF ITAB OCCURS 10,
             END OF ITAB.
    What difference it will make if suppose I use "OCCURS 0" or "OCCURS 10" ?

    Hi yogesh for more clearification
    difference b/w occurs 0 & occurs n
    The number <N> indicate how many lines has to have the table in initialization time: i.e. when the program is loaded in memory, the space for the table depends on the initialization numbers of the records.
    AT run time if the table needs more space, this'll automatically be enhanced.
    But If you know your table can have a certain numbers of records, you can indicate it in the defination, what'll improve the performance:
    all the space the table needs is taken at the beginin, so it doesn't need to enhance the space at run time.
    When this initial area is full, the system makes twice as much extra space available up to a limit of 8KB. Further memory areas of 12KB each are then allocated.
    You can usually leave it to the system to work out the initial memory requirement. The first time you fill the table, little memory is used. The space occupied, depending on the line width, is 16 <= <n> <= 100.
    It only makes sense to specify a concrete value of <n> if you can specify a precise number of table entries when you create the table and need to allocate exactly that amount of memory (exception: Appending table lines to ranked lists). This can be particularly important for deep-structured internal tables where the inner table only has a few entries (less than 5, for example).
    To avoid excessive requests for memory, large values of <n> are treated as follows: The largest possible value of <n> is 8KB divided by the length of the line. If you specify a larger value of <n>, the system calculates a new value so that n times the line width is around 12KB."
    and it is better to use occus 0 inplace of occurs  n    because of above specified reasons
    while it is not recommended to use occurs for internal table declaration  and it has become obselete
    reward if helpful

  • Error occured in  moving internal tables

    Hi  i have a doubt in internal tables
    Actually i have created a internal table(rtab_alv ) for the output in the format of alv grid and after that i had created another internal table as iznew1 in which i had transfered all the values of a database view(znew1)  into that internal table iznew1 after that while i was trying to move the values of iznew1 to rtab_alv its not accepting it was showing an error  as
    <b>rtab_alv and iznew1 are not mutually convertible in a unicode program</b>
    so can u explain me what is the possible error in this and how to resolve it
    solution will be rewarded points

    Hi Mr. Sadiqui
    By following your procedure an error has occured as
    below field are coming from database view and i m passing view data into iznew1
    fields of iznew1
                 LIFNR  LIKE EKKO-LIFNR,
                 EBELN  LIKE EKKO-EBELN,
                 VGABE  LIKE EKBE-VGABE,
                 EBELP  LIKE EKBE-EBELP,
                 BELNR  LIKE EKBE-BELNR,
                 MATNR  LIKE EKPO-MATNR,
                 TXZ01  LIKE EKPO-TXZ01,
            PS_PSP_PNR  LIKE EKKN-PS_PSP_PNR,
                 KOSTL  LIKE EKKN-KOSTL,
                 NAME1  LIKE LFA1-NAME1,
                 NAME2  LIKE LFA1-NAME2,
                 WERKS  LIKE EKPO-WERKS,
                 NETWR  LIKE EKPO-NETWR,
                 KNUMV  LIKE EKKO-KNUMV,
                 GJAHR  LIKE EKBE-GJAHR,
    and now i want to pass
    one field ED1  which i hase calculated separatly and i want to pass this value into iznew1
    but error is coming that iznew1 is a table with out header line  has no component like ED1.
    so how can i pass calculated value to internal table iznew1,

  • Internal table decaration using "occurs 0" is obsolete! Any other ideas?

    Hi All:
       I came to know that internal table declaration like shown below is obsolete in ECC6.0:
    Data:   Begin of i_tab occurs 0.
                 fld(1),
                 fld(2),
              End of i_tab.
    What is the corerct way of declaring internal tables as per the latest version?
    Thanks.
    Mithun

    Hi Mithun,
    Check these examples
    * Table declaration (old method)
    DATA: BEGIN OF tab_ekpo OCCURS 0,             "itab with header line
      ebeln TYPE ekpo-ebeln,
      ebelp TYPE ekpo-ebelp,
    END OF tab_ekpo.
    *Table declaration (new method)     "USE THIS WAY!!!
    TYPES: BEGIN OF t_ekpo,
      ebeln TYPE ekpo-ebeln,
      ebelp TYPE ekpo-ebelp,
    END OF t_ekpo.
    DATA: it_ekpo TYPE STANDARD TABLE OF t_ekpo INITIAL SIZE 0,      "itab
          wa_ekpo TYPE t_ekpo.                    "work area (header line)
    * Build internal table and work area from existing internal table
    DATA: it_datatab LIKE tab_ekpo OCCURS 0,      "old method
          wa_datatab LIKE LINE OF tab_ekpo.
    * Build internal table and work area from existing internal table,
    * adding additional fields
    TYPES: BEGIN OF t_repdata.
            INCLUDE STRUCTURE tab_ekpo.  "could include EKKO table itself!!
    TYPES: bukrs  TYPE ekpo-werks,
           bstyp  TYPE ekpo-bukrs.
    TYPES: END OF t_repdata.
    DATA: it_repdata TYPE STANDARD TABLE OF t_repdata INITIAL SIZE 0,   "itab
          wa_repdata TYPE t_repdata.                 "work area (header line)

  • "IT_SPFLI" is not an internal table "OCCURS n" specification is missing.

    I follow this tutorial. I replaced the 2  tables into sflight and spfli table.
    http://www.****************/Tutorials/BSP/UsingTableView/demo.htm
    and this error occurred.
    "IT_SPFLI" is not an internal table "OCCURS n" specification is missing.

    You'll need to create a table type for spfli and sflight. If you check the tutorial, the two tables it_vbak and it_vbap are typed on zvbak and zvbap respectively, not vbak and vbap. Here, zvbak and zvbap have presumably already been defined in the DD as table types for vbak and vbap.
    Regards,
    Trond

  • Internal table occurs

    hi
    wht is the diff b/w occurs <b>'n'</b> in the declaration of Internal table.....
    i know that occurs 0 will give 8kb of size, then wht is occurs 1, 2 .....
    is it goes with multiples of 8 i mean 1 implies 16kb or 64 kb
    plz clear,
    thanks in advance
    ganesh

    hi,
    Occurs means it holds the records of the internal table n by default its size is 8kb.if we take it as occurs 1 then it occupies the space required for one record by doubling the size. if field string size is 30 n boby size is 8 kb n if we have given occurs 1 then the body size becomes 30.if we give occurs 2 then it doubles ...then the fieldstring n body size will be 60 kb.......hope u understood this.
    if it has solved ur problem then dont forget to reward with points.
    with regards,
    madhuri.

  • Internal Table occurs n Error - BSP

    I have declared a type as
    Types: BEGIN OF ty_mara
           MATNR TYPE MARA-MATNR,
    ENDOF ty_mara.
    Problem is it is giving me error that "NO INTERNAL TABLE IS CREATED, OCCURS N SPECIFICATION".
    Need Directions.
    Edited by: NiksRules on Feb 14, 2011 6:25 AM

    Hi,
    I assume that you declared the types in "Type definitions" and trying the use this in page attributes for an internal table.
    Is this correct?
    If so, you need to have another type declaration like
    types: ty_mara_table type table of ty_mara.
    use the type ty_mara_table in the page attributes.
    Regards,
    Ravi.

  • Internal table occurs 0 --------- why obsolate?

    Hi,
    Can anybody tell why the declaration of internal table occurs 0 and internal table with header line is obsolate now?
    Explain the adavantages of newer one.
    is there any performance related issue?
    Thanks in advance
    Debjani Lahiri

    Hi,
    Like all other data objects, you can declare internal table objects using the LIKE or TYPE addition of the DATA statement.
    DATA <itab> TYPE <type>|LIKE <obj> [WITH HEADER LINE].
    Here, the LIKE addition refers to an existing table object in the same program. The TYPE addition can refer to an internal type in the program declared using the TYPES statement, or a table type in the ABAP Dictionary.
    You must ensure that you only refer to tables that are fully typed. Referring to generic table types (ANY TABLE, INDEX TABLE) or not specifying the key fully is not allowed (for exceptions, refer to Special Features of Standard Tables).
    The optional addition WITH HEADER line declares an extra data object with the same name and line type as the internal table. This data object is known as the header line of the internal table. You use it as a work area when working with the internal table (see Using the Header Line as a Work Area). When you use internal tables with header lines, you must remember that the header line and the body of the table have the same name. If you have an internal table with header line and you want to address the body of the table, you must indicate this by placing
    brackets after the table name (<itab>[]). Otherwise, ABAP interprets the name as the name of the header line and not of the body of the table. You can avoid this potential confusion by using internal tables without header lines. In particular, internal tables nested in structures or other internal tables must not have a header line, since this can lead to ambiguous expressions.
    Before Release 3.0, internal tables all had header lines and a flat-structured line type. There were no independent table types. You could only create a table object using the OCCURS addition in the DATA statement, followed by a declaration of a flat structure:
    DATA: BEGIN OF <itab> OCCURS <n>,
    <fi> ...,
    END OF <itab>.
    This statement declared an internal table <itab> with the line type defined following the OCCURS addition. Furthermore, all internal tables had header lines.
    The number <n> in the OCCURS addition had the same meaning as in the INITIAL SIZE addition from Release 4.0. Entering ‘0’ had the same effect as omitting the INITIAL SIZE addition. In this case, the initial size of the table is determined by the system.
    Regards,
    Bhaskar

  • Diff Between Internal Table with Occurs 0 & Field Groups

    Hi,
    Is there really any difference between just using an internal table with an OCCURS 0 statement-- which would write the entire table to paging space-- and using field-groups? How is Field-Groups is more effective than Internal tables with occurs 0 when it comes to performance?
    Could anybody please give some information regarding above question?
    Thanks,
    Mohan.

    hi,
    occurs 0 means it wont create any extra memory. based on the records only the memory is allocated to internal tables at run time. but when an internal table is created it can hold data of type to which it is declared.
    i.e data: itab like mara occurs 0 with header line.
    can take data only from mara table
    we can also do in another way as using types keyword we can declare a standard structure and create a internal table of that type. its also not that useful as we have to change the structure depending on changes for storing data.
    for this purpose field symbols are used. field symbols can hold any data means that they can point to tables, fields, any standard or user-defined types. field symbols actually points to respective types by which we can directly access to that types using field symbols.
    filed symbols works more faster than internal tables.
    if helpful reward some points.
    with regards,
    Suresh.A

  • Differences between Internal table with Occurs 0 and Field-Groups?

    Is there really any difference between just using an internal table with an OCCURS 0 statement-- which would write the entire table to paging space-- and using field-groups? How is Field-Groups is more effective than Internal tables with occurs 0 when it comes to performance?
    Could anybody please give some information regarding above question?
    Thanks,
    Surya.

    hi,
    occurs 0 means it wont create any extra memory. based on the records only the memory is allocated to internal tables at run time. but when an internal table is created it can hold data of type to which it is declared.
    i.e data: itab like mara occurs 0 with header line.
    can take data only from mara table
    we can also do in another way as using types keyword we can declare a standard structure and create a internal table of that type. its also not that useful as we have to change the structure depending on changes for storing data.
    for this purpose field symbols are used. field symbols can hold any data means that they can point to tables, fields, any standard or user-defined types. field symbols actually points to respective types by which we can directly access to that types using field symbols.
    filed symbols works more faster than internal tables.
    if helpful reward some points.
    with regards,
    Suresh.A

  • TSV_TNEW_PAGE_ALLOC_FAILED  with internal table declared with occurs 0

    HI guys,
    when the internal table is declared as occurs 0, the dump TSV_TNEW_PAGE_ALLOC_FAILED is encountered, when changing the declaration into standard table, th dump disappears. Why is this so?
    Thanks!

    There are three type of tables: Standard, sorted and hashed tables (see [here|http://help.sap.com/abapdocu_70/en/ABAPDATA_ITAB.htm]). When you define a table using the keyword OCCURS you're still defining a standard table.
    Your exception indicates that you're running out of memory. The difference in the declarations that you mention shouldn't cause that. Main difference between the two declaration versions is probably that your table defined via OCCURS has a header line, whereas your other table doesn't (unless you declared it explicitly as WITH HEADER LINE).
    I don't think though that with that little information anybody could explain the short dump. Actually it sounds rather odd that the change you mention should cause the dump (or make it go away). So I suspect you probably have to post further details. You might want to check the shortdump yourself and place a breakpoint at this place and run it for each version. Maybe you can see some difference...

  • Internal table maximum records when occurs 0

    hi experts,
    i am using the internal table upload data,
    at a time it can hold only 10000 recods only ?
    how can i capture more than this.
    thanks&regards,
    srinivas

    Try this way.
    Create a structure with TYPES statement,
    Create internal Table & work area with DATA statement.
    Eg:-
    TYPES : BEGIN OF ty_itab,
                    field1 TYPE mara-matnr,
                    field2 TYPE mara-mtart,
                  END OF ty_itab.
    DATA : it_itab TYPE TABLE OF ty_itab,
                wa_itab TYPE ty_itab.
    Now fill the records into that internal table.
    When you want to read use
    LOOP AT it_ita INTO wa_itab.
    ENDLOOP.
    Regards
    Bala Krishna

Maybe you are looking for

  • I can't figure out how to download my Canon PIXMA MP230 to my macbook air

    Okay so i recently bought a new PIXMA MP230 printer and i can't figure out how to install it onto my Macbook Air as it doesn't have a CD drive. Help?

  • BI Server not starting in OBIEE 11g

    hi, While starting the BI server from Enterprise Manager in OBIEE 11g I am facing this issue. the details in the error log says. [2010-09-15T05:45:58.000+00:00] [OracleBIServerComponent] [ERROR:1] [] [] [ecid: 00hvhkOQB^r0Vsk_Kxx0ie0001F^000000] [tid

  • Some error after install and configure fmw 11g

    I have installed: jdk 1.6.0_30 x64 weblogic 10.3.4 generic forms and reports 11.1.1.2 >> patch set 11.1.1.4 on windows server 2008 standard sp2 x64 RAM 6GB installed all as services, my application is running ok (it seems to be ok) but -the url http:

  • ORA-12545:connect failed because target host or object not exist

    Dear DBA's I am getting this error message when i want to connect oracle by using internet explorer browser. ORA-12545:connect failed because target host or object not exist I already started services: oracleservicesSID,OracleOraDb10g_home1TSNListene

  • Purchase all content for Garageband 10.0.1 doesn't work.

    Purchase all content for Garageband 10.0.1 doesn't work. From the App I choose the purchase option, it leads me to my account. After loggin the App Store Screen remains white (no information at all) How to solve this problem?