Skip to Content
P D

Issue with Download to Excel from SAP Directory

Hi Experts,

We are trying to download the AL11 data which is stored in the format of .xls to the local pc. It is being shown good in the AL11 and hence we need the same while downloading it as excel file. But some data is getting changed while downloading it as excel. For example, '#' in AL11 is getting changed to '<-5'. What could be done to have the data in proper format.

B.R.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

8 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Oct 14, 2015 at 10:12 AM

    As for the character issue, try downloading it with langauge specific codepage. This may solve your issue.

    OR

    If you want to download a file which is in AL11 directory, then you can simply use OPEN_DATASET.

    Read the data set and close it. You can read the data stored in AL11 and download it in desired output.

    Regards,

    Swet Bhushan

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 14, 2015 at 05:48 AM

    Use tcode CG3Y

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 14, 2015 at 05:48 AM

    Hi,

    try to download with transaction CG3Y with BIN transfer format.

    Br

    Michael

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 14, 2015 at 05:53 AM

    Can you please tell me the steps, how you download the data into excel

    List --> Export --> spreadsheet --> Excel office 2007 ?

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 14, 2015 at 06:40 AM

    Hi,

    To Download the file directly from AL11 I would suggest this method

    Hope this helps


    pastedImage_0.png (12.2 kB)
    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 14, 2015 at 06:47 AM

    Hi

    First get the files from AL11 using

    call function 'EPS_GET_DIRECTORY_LISTING'

    exporting

    dir_name = './'

    importing

    dir_name = lv_eps_dir

    tables

    dir_list = it_file_list

    exceptions

    invalid_eps_subdir = 1

    sapgparam_failed = 2

    build_directory_failed = 3

    no_authorization = 4

    read_directory_failed = 5

    too_many_read_errors = 6

    empty_directory_list = 7

    others = 8.

    if it_file_list[] is not initial.

    delete it_file_list where name np '*.CSV'.

    endif.


    Then download the file using below logic


    read table it_file_list index rs_selfield-tabindex.

    if sy-subrc = 0.

    w_filename = it_file_list-name.

    concatenate './' w_filename into w_fnam.

    lw_file = w_fnam.

    translate lw_file to upper case.

    open dataset lw_file in text mode encoding default for input

    ignoring conversion errors.

    if sy-subrc = 0.

    do.

    read dataset lw_file into wa_data.

    if sy-subrc <> 0.

    exit.

    else.

    while ( wa_data ne space ).

    if wa_data eq space.

    exit.

    else.

    append wa_data to it_data.

    clear: wa_data.

    endif.

    endwhile.

    endif.

    enddo.

    close dataset lw_file.

    concatenate wa_fname '\' w_filename into filename.

    call function 'GUI_DOWNLOAD'

    exporting

    filename = filename

    tables

    data_tab = it_data. "csv_converted_table.

    if sy-subrc <> 0.

    i = 1.

    endif.

    else.

    message 'Unable to display this file' type 'I' display like 'E'.

    endif.

    Regards

    Suganya

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 14, 2015 at 06:58 AM

    May be you should go through the following thread

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 14, 2015 at 08:06 AM

    any other suggestions ?

    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.