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

ALV Download Problem

Hi Experts,

ALV report is generated well but the PROBLEM, lies in downloading to xls.

The character size here is more than 1600 characters, so it is downloading to xls in jumbled way.

Please help.

Regards,

IFF

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Posted on Dec 04, 2007 at 04:55 AM

    Hi IFF,

    I guess your meaning of jumbled way meaning columns are in a mess.

    Therefore, i had a similar situation like yours.

    Here's what i do.

    I replace the ALV's download button with a customized one using 'GUI_DOWNLOAD' function module.

    And it works finely.

    Do give it a try.

    Thanks

    William Wilstroth

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 04, 2007 at 04:57 AM

    Hi,

    Use excel in place option .

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 04, 2007 at 04:59 AM

    Hi,

    Use GUI_DOWNLOAD it will work

    &----


    *& Form sub_download

    &----


    • text

    ----


    • --> p1 text

    • <-- p2 text

    ----


    FORM sub_download.

    CALL FUNCTION 'GUI_DOWNLOAD'

    EXPORTING

    • BIN_FILESIZE =

    filename = p_path

    filetype = 'ASC'

    • APPEND = ' '

    write_field_separator = 'X'

    • HEADER = '00'

    • TRUNC_TRAILING_BLANKS = ' '

    • WRITE_LF = 'X'

    • COL_SELECT = ' '

    • COL_SELECT_MASK = ' '

    • DAT_MODE = ' '

    • CONFIRM_OVERWRITE = ' '

    • NO_AUTH_CHECK = ' '

    • CODEPAGE = ' '

    • IGNORE_CERR = ABAP_TRUE

    • REPLACEMENT = '#'

    • WRITE_BOM = ' '

    • TRUNC_TRAILING_BLANKS_EOL = 'X'

    • WK1_N_FORMAT = ' '

    • WK1_N_SIZE = ' '

    • WK1_T_FORMAT = ' '

    • WK1_T_SIZE = ' '

    • IMPORTING

    • FILELENGTH =

    TABLES

    data_tab = it_final

    • FIELDNAMES =

    • EXCEPTIONS

    • FILE_WRITE_ERROR = 1

    • NO_BATCH = 2

    • GUI_REFUSE_FILETRANSFER = 3

    • INVALID_TYPE = 4

    • NO_AUTHORITY = 5

    • UNKNOWN_ERROR = 6

    • HEADER_NOT_ALLOWED = 7

    • SEPARATOR_NOT_ALLOWED = 8

    • FILESIZE_NOT_ALLOWED = 9

    • HEADER_TOO_LONG = 10

    • DP_ERROR_CREATE = 11

    • DP_ERROR_SEND = 12

    • DP_ERROR_WRITE = 13

    • UNKNOWN_DP_ERROR = 14

    • ACCESS_DENIED = 15

    • DP_OUT_OF_MEMORY = 16

    • DISK_FULL = 17

    • DP_TIMEOUT = 18

    • FILE_NOT_FOUND = 19

    • DATAPROVIDER_EXCEPTION = 20

    • CONTROL_FLUSH_ERROR = 21

    • OTHERS = 22

    .

    IF sy-subrc <> 0.

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

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

    ENDIF.

    ENDFORM. " sub_download

    Regards,

    Prashant

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 04, 2007 at 05:01 AM

    Hello,

    Please use GUI_Download with ur ALV report.Below is the example how to implement it.

    Reward if useful.

    Thankx.

    report zhdownload.

    data : begin of itab occurs 100,

    f_matnr type matnr,

    f_ersda type ersda,

    f_ernam type ernam,

    end of itab.

    select matnr ersda ernam into table itab from mara up to 10 rows.

    append itab.

    data : begin of itab1 occurs 0,

    line(50) type c,

    end of itab1.

    itab1-line = 'MATERIAL NUMBER'.

    append itab1.

    itab1-line = 'DATE'.

    append itab1.

    itab1-line = 'NAME'.

    append itab1.

    call function 'GUI_DOWNLOAD'

    exporting

    filename = 'C:\Documents and Settings\ak0020758\abc2.xls'

    filetype = 'ASC'

    write_field_separator = 'X'

    • IMPORTING

    • FILELENGTH =

    tables

    data_tab = itab

    fieldnames = itab1 " for headings

    exceptions

    file_write_error = 1

    no_batch = 2

    gui_refuse_filetransfer = 3

    invalid_type = 4

    no_authority = 5

    unknown_error = 6

    header_not_allowed = 7

    separator_not_allowed = 8

    filesize_not_allowed = 9

    header_too_long = 10

    dp_error_create = 11

    dp_error_send = 12

    dp_error_write = 13

    unknown_dp_error = 14

    access_denied = 15

    dp_out_of_memory = 16

    disk_full = 17

    dp_timeout = 18

    file_not_found = 19

    dataprovider_exception = 20

    control_flush_error = 21

    others = 22

    .

    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 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.