Application Development 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: 

excel sheet with more than 65000 records

Former Member
0 Kudos
182

HI SCNites.

i am using this code. but what if the iternal table (excel) has more than 65000 records? what to do? is the only solution to downloaded to ASCII file?

call function 'WS_DOWNLOAD'
    exporting
      filename                = pa_file
      filetype                = 'DAT'
    tables
      data_tab                = excel
      fieldnames              = i_fil_names
    exceptions
      file_open_error         = 1
      file_write_error        = 2
      invalid_filesize        = 3
      invalid_table_width     = 4
      invalid_type            = 5
      no_batch                = 6
      unknown_error           = 7
      gui_refuse_filetransfer = 8
      others                  = 9.


    CREATE OBJECT application 'excel.application'.
    SET PROPERTY OF application 'visible' = 1.
    CALL METHOD OF application 'Workbooks' = workbook.
*CALL METHOD OF workbook 'Add'. "if you want to create a file
    CALL METHOD OF workbook 'Open'
      EXPORTING
        #1 = pa_file.
*

 CALL METHOD OF application 'Worksheets' = sheet
      EXPORTING
        #1 = 1.
        SET PROPERTY OF sheet 'Name' = 'report u03B1u03BDu03B5u03AFu03C3u03C0u03C1u03B1u03BAu03C4u03C9u03BD''.
    CALL METHOD OF sheet 'Activate'.



     call method of application 'RANGE' = gs_range
  exporting #1 = 'A1:Z1'.
  set property of gs_range 'HORIZONTALALIGNMENT' = 1.

  call method of gs_range 'FONT' = gs_font.
  set property of gs_font 'BOLD' = 1.


  call method of application 'Columns' = h_columns
      exporting
      #1 = 'A:Z'.

    get property of h_columns 'EntireColumn' = h_entirecol.
    set property of h_entirecol 'Autofit' = 1.

2 REPLIES 2

ThomasZloch
Active Contributor
0 Kudos
36

Excel 2007 can digest about one million rows. And don't use WS_DOWNLOAD, it's obsolete, replacement is GUI_DOWNLOAD.

Thomas

Former Member
0 Kudos
36

Till Microsoft excel 2003 sheets only have 65535 rows. In microsoft excel 2007 rows reach one million .

Is a limit from excel application. SAP has no influence on it