Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Internal table limit

Former Member
0 Likes
3,030

Hi,

I have declared my table as

  • Type declaration

types: itab1 type standard table of epsfili.

data: itab type itab1 with header line, " To store all the files in app serv.

Would there be a limit for this kind of internal table. It only picked the files till 999. The rest of them are not processed. So, I wonder if there is any limit.

1 ACCEPTED SOLUTION
Read only

ferry_lianto
Active Contributor
0 Likes
1,912

Hi,

Please check the following codes in FM EPS_GET_DIRECTORY_LISTING.

There are some exception on file length (2147483647 byte) and number of files to read (1000).


...

*   handle files > 2147483647 byte (int 4) - hen 9.9.2004
    IF file-len > 2147483647.       "<--- check here
      dir_list-size  = -99.
    ELSE.
      dir_list-size  = file-len.
    ENDIF.
    dir_list-name = file-name.
    IF sy-subrc = 0.
      IF file-type(1) = 'f' OR              " regular file
         file-type(1) = 'F'.
        ADD 1 TO file_counter.
        dir_list-rc   = 0.
        APPEND dir_list.
      ENDIF.
    ELSEIF sy-subrc = 1.
      EXIT.
    ELSE.
      IF error_counter > gc_1000.   "<--- check here
...

Regards,

Ferry Lianto

8 REPLIES 8
Read only

Former Member
0 Likes
1,912

Hi,

Internal table does have a limit but it depends on the available and allocated memory.

But it certainly should not be limited to 1000 in any case.

Please check the logic of your program.

Read only

ferry_lianto
Active Contributor
1,912

Hi,

There is no ABAP limit to the number of records that you can put into an internal table, but there are system memory limits. For example, if you try to put all records from BSEG into an internal table, you will likely exceed this limit and dump.

Regards,

Ferry Lianto

Read only

Former Member
0 Likes
1,912

Basically there are no limits...

also There is no limit on number of fields in internal table.

how the memory could be calculated and as informed that you want to list the Million records (thats huge)

You can use the Pakage size option

select field1 field2 field3

from Tablename

into table it_tablename package size 10000.

  • Package size determines the Total # of records that will be picked up in the First loop.

loop at it_tablename.

write:/ it_tablename-field1,

it_tablename-field2.

endloop.

refresh it_tablename.

free it_tablename.

endselect.

In this way the first 10000 records are fetched written on to the screen, the memory is freed and the Internal table is ready for the second set to 10000 records.

Reward Points if it is useful

Thanks

Seshu

Read only

Former Member
0 Likes
1,912

The problem is likely with the program, not the internal table.

Rob

Read only

0 Likes
1,912

I have used EPS_GET_DIRECTORY_LISTING FM to get all the files and only 999 files got processed out of 1183. I am not sure what the problem is. Could some one tell me if they can think of something.

Read only

ferry_lianto
Active Contributor
0 Likes
1,913

Hi,

Please check the following codes in FM EPS_GET_DIRECTORY_LISTING.

There are some exception on file length (2147483647 byte) and number of files to read (1000).


...

*   handle files > 2147483647 byte (int 4) - hen 9.9.2004
    IF file-len > 2147483647.       "<--- check here
      dir_list-size  = -99.
    ELSE.
      dir_list-size  = file-len.
    ENDIF.
    dir_list-name = file-name.
    IF sy-subrc = 0.
      IF file-type(1) = 'f' OR              " regular file
         file-type(1) = 'F'.
        ADD 1 TO file_counter.
        dir_list-rc   = 0.
        APPEND dir_list.
      ENDIF.
    ELSEIF sy-subrc = 1.
      EXIT.
    ELSE.
      IF error_counter > gc_1000.   "<--- check here
...

Regards,

Ferry Lianto

Read only

amit_khare
Active Contributor
0 Likes
1,912

Internal table has limits of storing the records.

An internal table can store upto 2GB records and after applying some packages this limit can be exceed to 4 GB...but that is too optimistic....

Regards,

Amit

Reward all helpful replies.

Read only

ferry_lianto
Active Contributor
0 Likes
1,912

Hi,

Please try to use FM SUBST_GET_FILE_LIST.


REPORT ZDIRTEST.
 
PARAMETER: P_DIR TYPE RSMRGSTR-PATH DEFAULT '/usr/sap/trans/data' LOWER CASE.
 
DATA: WA_FILES  TYPE RSFILLST,
      IT_FILES  LIKE TABLE OF WA_FILES,
      WA_LINES  TYPE I.
                                                                        
START-OF-SELECTION.
                                               
  CALL FUNCTION 'SUBST_GET_FILE_LIST'
    EXPORTING
      DIRNAME      = P_DIR
      FILENM       = '*'
    TABLES
      FILE_LIST    = IT_FILES
    EXCEPTIONS
      ACCESS_ERROR = 1
      OTHERS       = 2. 
 
  IF  SY-SUBRC  <>   0.
    WRITE: / 'Error reading files'.
  ELSE.
    DESCRIBE TABLE IT_FILES LINES WA_LINES.
    WRITE: / 'Numbers of files:', WA_LINES.
    LOOP AT IT_FILES INTO WA_FILES.
      WRITE: / WA_FILES-NAME.
    ENDLOOP.
  ENDIF.

Regards,

Ferry Lianto