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

excel download not working in REUSE_ALV_GRID_DISPLAY

hi,

can someone tell me why excel download funtionality doesnt work in grid display. i tried examples like balvst0*_grid and it seems those doesnt work too.

is there any example where i can see excel download working with grid.

regards,

ravi.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Oct 23, 2006 at 11:48 PM

    Hi,

    Check this program ALV GRID using ABAP OO..

    BCALV_TEST_GRID_EDIT_01

    In the output..You have a Export button..using which you can export the data to an excel..

    Thanks,

    Naren

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 23, 2006 at 11:54 PM

    Hi,

    Also check this program for FM REUSE_ALV_GRID_DISPLAY..You can use LIST -> EXPORT -> SPREADSHEET to see the values in a excel..

    TYPE-POOLS: slis.

    DATA: BEGIN OF itab OCCURS 0,

    vbeln TYPE vbeln,

    END OF itab.

    DATA: BEGIN OF itab1 OCCURS 0,

    selkz TYPE char1,

    vbeln TYPE vbeln,

    posnr TYPE posnr,

    netpr TYPE netpr,

    matnr TYPE matnr,

    END OF itab1.

    DATA: t_fieldcatalog TYPE slis_t_fieldcat_alv.

    DATA: s_fieldcatalog TYPE slis_fieldcat_alv.

    s_fieldcatalog-col_pos = '1'.

    s_fieldcatalog-fieldname = 'SELKZ'.

    s_fieldcatalog-tabname = 'ITAB1'.

    s_fieldcatalog-checkbox = 'X'.

    APPEND s_fieldcatalog TO t_fieldcatalog.

    CLEAR: S_FIELDCATALOG.

    s_fieldcatalog-col_pos = '2'.

    s_fieldcatalog-fieldname = 'VBELN'.

    s_fieldcatalog-tabname = 'ITAB1'.

    s_fieldcatalog-rollname = 'VBELN'.

    APPEND s_fieldcatalog TO t_fieldcatalog.

    s_fieldcatalog-col_pos = '3'.

    s_fieldcatalog-fieldname = 'POSNR'.

    s_fieldcatalog-tabname = 'ITAB1'.

    s_fieldcatalog-rollname = 'POSNR'.

    APPEND s_fieldcatalog TO t_fieldcatalog.

    CLEAR: s_fieldcatalog.

    s_fieldcatalog-col_pos = '4'.

    s_fieldcatalog-fieldname = 'NETPR'.

    s_fieldcatalog-tabname = 'ITAB1'.

    s_fieldcatalog-rollname = 'NETPR'.

    s_fieldcatalog-do_sum = 'X'.

    APPEND s_fieldcatalog TO t_fieldcatalog.

    CLEAR: s_fieldcatalog.

    s_fieldcatalog-col_pos = '5'.

    s_fieldcatalog-fieldname = 'MATNR'.

    s_fieldcatalog-tabname = 'ITAB1'.

    s_fieldcatalog-rollname = 'MATNR'.

    APPEND s_fieldcatalog TO t_fieldcatalog.

    DATA: s_layout TYPE slis_layout_alv.

    s_layout-subtotals_text = 'SUBTOTAL TEXT'.

    SELECT vbeln UP TO 10 ROWS

    FROM

    vbak

    INTO TABLE itab.

    IF NOT itab[] IS INITIAL.

    SELECT vbeln posnr

    FROM vbep

    INTO CORRESPONDING FIELDS OF TABLE itab1

    FOR ALL ENTRIES IN itab

    WHERE vbeln = itab-vbeln.

    ENDIF.

    DATA: v_repid TYPE syrepid.

    v_repid = sy-repid.

    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

    EXPORTING

    i_callback_program = v_repid

    it_fieldcat = t_fieldcatalog

    is_layout = s_layout

    TABLES

    t_outtab = itab1

    EXCEPTIONS

    program_error = 1

    OTHERS = 2.

    IF sy-subrc <> 0.

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

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

    ENDIF.

    Thanks,

    Naren

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 23, 2006 at 11:55 PM

    hi,

    thanks for your prompt response. i have to select export option to download it however , i need to have excel icon so that when the user selects it, it should open the excel window with data in it with out any intermediate steps.

    please let me know your suggestions.

    regards,

    ravi.

    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.