Skip to Content
avatar image
Former Member

Downloading from Internal table to Excel

Hi All,

My requirement is download to Excel sheet, but in my internal table i have more than 95,000 record

(max limit in Excel sheet is 65535).

Please help me out by providing your solutions.

note: here i know one solution, by splitting into two files but no.of records are mis-macthing.

and one more issue when uploading the file we need to mention two file names.

hope this is not suggesstable.

Thanks in Advance

Madhavi.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Sep 02, 2008 at 04:48 AM

    hi,

    try this

    Parameters: P_file like RLGRAP-FILENAME.

    data : begin of int_head occurs 0,

    Filed1(20) type c, " Header Data

    end of int_head.

    data : begin of int_data occurs 0,

    Field1(20) type c, " Data

    Field2(20) type c,

    Field3(20) type c,

    Field4(20) type c,

    end of int_data.

    int_head-Filed1 = 'Sales Ord'.

    APPEND int_head.

    CLEAR int_head.

    int_head-Filed1 = 'Sold-to-Party'.

    APPEND int_head.

    CLEAR int_head.

    int_head-Filed1 = 'Purchase Ord'.

    APPEND int_head.

    CLEAR int_head.

    int_head-Filed1 = 'Ship-to-Party'.

    APPEND int_head.

    CLEAR int_head.

    int_data-field1 = '1JOHN'.

    int_data-field2 = '2TOM'.

    int_data-field3 = '3BRAD'.

    int_data-field4 = '4PETER'.

    Append int_data.

    Clear int_data.

    CALL FUNCTION 'MS_EXCEL_OLE_STANDARD_DAT'

    EXPORTING

    file_name = p_file " path offile where u need to download

    • CREATE_PIVOT = 0

    • DATA_SHEET_NAME = ' '

    • PIVOT_SHEET_NAME = ' '

    • PASSWORD = ' '

    • PASSWORD_OPTION = 0

    TABLES

    • PIVOT_FIELD_TAB =

    data_tab = int_data "internal table with data

    fieldnames = int_head "internal table with header

    EXCEPTIONS

    file_not_exist = 1

    filename_expected = 2

    communication_error = 3

    ole_object_method_error = 4

    ole_object_property_error = 5

    invalid_filename = 6

    invalid_pivot_fields = 7

    download_problem = 8

    OTHERS = 9

    .

    IF sy-subrc <> 0.

    • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

    • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

    ENDIF.

    Add comment
    10|10000 characters needed characters exceeded