Skip to Content
author's profile photo Former Member
Former Member

download data to excel

i use fm reuse_alv with out pf-status, when i get the report i want to download it to excel and i dont get data ( i have 20,000 lines).

and when i make local file icon i get dump why>\???

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 10, 2007 at 06:50 PM

    Hi,

    You dont have to do anything extra as such coz transport to excel is already given in the toolbar of the ALV Check report BALVSD04.

    But still you wanna download it then download the final table by using any of the download functions ' GUI_DOWNLOAD' , ' CONVER_SAP_TO_XLS', etc.

    Regards

    Sudheer

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 10, 2007 at 07:51 PM

    Hi,

    Just check your fieldcatalog first, because if you are getting short dump as <b>'Field Symbol not yet assigned' </b> means you are not populating fildcatalog

    properly.

    Otherwise check the same report with lesser data say 100 or 100 records and then see the output.

    Regards,

    Amit

    Reward all helpful replies.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 11, 2007 at 02:02 PM

    Dear Liat,

    I'm providing you with the following piece of code ... Its working fine for me ... hopefully it suits your requirement ...

    ************************************************************************

    • D A T A D E C L A R A T I O N *

    ************************************************************************

    TYPES: BEGIN OF TY_EXCEL,

    CELL_01(80) TYPE C,

    CELL_02(80) TYPE C,

    CELL_03(80) TYPE C,

    CELL_04(80) TYPE C,

    CELL_05(80) TYPE C,

    CELL_06(80) TYPE C,

    CELL_07(80) TYPE C,

    CELL_08(80) TYPE C,

    CELL_09(80) TYPE C,

    CELL_10(80) TYPE C,

    END OF TY_EXCEL.

    DATA: IT_EXCEL TYPE STANDARD TABLE OF TY_EXCEL,

    WA_EXCEL TYPE TY_EXCEL..

    ************************************************************************

    • E V E N T : S T A R T - O F - S E L E C T I O N *

    ************************************************************************

    START-OF-SELECTION.

    • Here you populate the Internal Table.

    • -------------------------------------

    • Display - Top of the Page.

    • --------------------------------------

    PERFORM DISPLAY_TOP_OF_PAGE.

    ************************************************************************

    • E V E N T : E N D - O F - S E L E C T I O N *

    ************************************************************************

    END-OF-SELECTION.

    SET PF-STATUS 'GUI_STATUS'.

    ************************************************************************

    • E V E N T : A T U S E R - C O M M AN D *

    ************************************************************************

    AT USER-COMMAND.

    CASE SY-UCOMM.

    WHEN 'EXPORT'.

    • Exporting the report data to Excel.

    PERFORM EXPORT_TO_EXCEL.

    ENDCASE.

    &----


    *& Form DISPLAY_TOP_OF_PAGE

    &----


    • text

    ----


    • --> p1 text

    • <-- p2 text

    ----


    FORM DISPLAY_TOP_OF_PAGE .

    SKIP.

    WRITE: /05(128) SY-ULINE,

    /05 SY-VLINE,

    06(127) 'O R I C A'

    CENTERED COLOR 1,

    132 SY-VLINE.

    WRITE: /05(128) SY-ULINE,

    /05 SY-VLINE,

    06(127) 'Shift Asset Depreciation - Period/Year-wise Report.'

    CENTERED COLOR 4 INTENSIFIED OFF,

    132 SY-VLINE.

    WRITE: /05(128) SY-ULINE.

    *----


    • E X C E L O P E R A T I O N

    *----


    CLEAR: IT_EXCEL[],

    WA_EXCEL.

    PERFORM APPEND_BLANK_LINE USING 1.

    WA_EXCEL-cell_02 = ' XYZ Ltd. '.

    APPEND WA_EXCEL TO IT_EXCEL.

    CLEAR: WA_EXCEL.

    WA_EXCEL-cell_02 = 'Shift Asset Depreciation - Period/Year-wise Report.'.

    APPEND WA_EXCEL TO IT_EXCEL.

    PERFORM APPEND_BLANK_LINE USING 1.

    ENDFORM. " DISPLAY_TOP_OF_PAGE

    &----


    *& Form APPEND_BLANK_LINE

    &----


    • text

    ----


    • -->P_1 text

    ----


    FORM APPEND_BLANK_LINE USING P_LINE TYPE I.

    DO P_LINE TIMES.

    CLEAR: WA_EXCEL.

    APPEND WA_EXCEL TO IT_EXCEL.

    enddo.

    ENDFORM.

    &----


    *& Form EXPORT_TO_EXCEL

    &----


    • text

    ----


    • --> p1 text

    • <-- p2 text

    ----


    FORM EXPORT_TO_EXCEL .

    DATA: L_FILE_NAME(60) TYPE C.

    • Create a file name

    CONCATENATE 'C:\' 'Shift_Depn_' SY-DATUM6(2) '.' SY-DATUM4(2)

    '.' SY-DATUM+0(4) INTO L_FILE_NAME.

    • Pass the internal table (it_excel which is already populated )

    • to the function module for excel download.

    CALL FUNCTION 'WS_EXCEL'

    exporting

    filename = L_FILE_NAME

    tables

    data = IT_EXCEL

    exceptions

    unknown_error = 1

    others = 2.

    if sy-subrc <> 0.

    message e001(ymm) with 'Error in exporting to Excel.'.

    endif.

    ENDFORM. " EXPORT_TO_EXCEL

    *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    When you click the button - Export to Excel ( GUI-Status) you'll be able to export the content of the Internal Table to an Excel file .......

    Regards,

    Abir

    ************************************

    • Don't forget to award Points *

                                                                        Add a comment
                                                                        10|10000 characters needed characters exceeded

                                                                      • author's profile photo Former Member
                                                                        Former Member
                                                                        Posted on Jan 11, 2007 at 02:27 PM
                                                                        Add a comment
                                                                        10|10000 characters needed characters exceeded

                                                                      Before answering

                                                                      You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
                                                                      You must be Logged in to submit an answer.

                                                                      Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.