Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with Download to Excel from SAP Directory

former_member207873
Participant
0 Kudos

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.

20 REPLIES 20

former_member210541
Active Participant
0 Kudos

Use tcode CG3Y

0 Kudos

tried with CG3Y.. Still issue exists.

michael_kozlowski
Active Contributor
0 Kudos

Hi,

try to download with transaction CG3Y with BIN transfer format.

Br

Michael

0 Kudos

Even after using CG3Y

Excel                        AL11

         

0 Kudos

In the ALV toolbar, there is an option for Excel, did you try with that?

0 Kudos

in AL11 we do not have that option. We are in 4.6C

venkateswaran_k
Active Contributor
0 Kudos

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

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

0 Kudos

there are number posts available in scn on the same topic.

refer to this How to download file from application server | SCN

0 Kudos

Yes , the same as you mentioned. Excel : 2010.

0 Kudos

Hi,

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

    

    

Hope this helps

0 Kudos

No it doesnt help. I am doing the same at the moment.

Former Member

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

0 Kudos

May be you should go through the following thread

former_member207873
Participant
0 Kudos

any other suggestions ?

0 Kudos

Hi,

you can try report 'CACS_FILE_COPY'

or FM 'ARCHIVFILE_SERVER_TO_CLIENT'

Br

Michael

0 Kudos

I am in 4.6C. CACS_FILE_COPY does not exist in this.

Former Member

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

0 Kudos

Can you explain more on downloading with language specific code page as i am simply making use of standard system -> List -> Save -> Local File option.

0 Kudos

To make the things more clear.

I am downloading a file from AL11 into notepad or excel.

In AL11, data looks like this.

But when we try to download into excel or word the data is getting changed,

In Excel

Further a digit 5 is getting appened in the beginning.

In notepad

What can be done so that the data will be exactly as it is in AL11.

PS: SAP System is 4.6C.

0 Kudos

Hi P.D.

What says that what you're seeing in AL11 is actually what it there.

Special Characters can have an influence on what you see there.

Therefore...how is the data getting populated in AL11?

Regards

Arden