Download ALV to any file

Hi Experts,
I am not able to see the standard ALV toolbar to download the output to an Excel or local file..etc.
I placed my ALV container on a screen below some I/O text boxes in display mode only.
I also need to download the I/O text boxes.
Can someone help me with this?
Thanks
Dany

Hi Dany,
Could you verify that in the layout the no_toolbar option is equal to space.
Regards,
Eric
PD. The standard download button of the ALV, its only going to work for the data on your internal table. In order to download all the data of the screen you are going to need to program the button functionality yourself.
Add a button to the toolbar and in the user_command do something like this (to export to excel).
CASE sy-ucomm.
    WHEN 'DOWNLOAD'.
      filefilter = 'Ficheros EXCEL (*.XLS)|*.XLS|Ficheros de texto (*.TXT)|*.TXT|Fich.(todos) (*.*)|*.*|'.
      CALL FUNCTION 'GUI_FILE_SAVE_DIALOG'
        EXPORTING
          file_filter       = filefilter
          default_extension = 'xls'
        IMPORTING
          filename          = filename
          path              = path
          fullpath          = fullpath
          user_action       = user_action.
      DATA: wa_filelength TYPE i,
            wa_archivo    TYPE string.
      CALL METHOD cl_gui_frontend_services=>gui_download
        EXPORTING
          filename                = fullpath
          filetype                = 'ASC'
          write_field_separator   = 'X'
        IMPORTING
          filelength              = wa_filelength
        CHANGING
          data_tab                = it_asc_file
        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
          not_supported_by_gui    = 22
          error_no_gui            = 23
          OTHERS                  = 24.
Declare a table in which you are going to save the data in the same way you want it at the output file
DATA: BEGIN OF t_asc_file OCCURS 100,
        campo1(50)  TYPE c,
        campo2(50)  TYPE c,
        campo3(50)  TYPE c,
        campo4(50)  TYPE c,
        campo5(50)  TYPE c,
        campo6(50)  TYPE c,
        campo7(50)  TYPE c,
        campo8(50)  TYPE c,
        campo9(50)  TYPE c,
        campo10(50) TYPE c,
        campo11(50) TYPE c,
        campo12(50) TYPE c,
        campo13(50) TYPE c,
        campo14(50) TYPE c,
        campo15(50) TYPE c,
        campo16(50) TYPE c,
        campo17(50) TYPE c,
        campo18(50) TYPE c,
        campo19(50) TYPE c,
        campo20(50) TYPE c,
      END OF t_asc_file,
      it_asc_file LIKE t_asc_file OCCURS 0,
      wa_asc_file LIKE LINE OF it_asc_file.
Reward points if helpful

Similar Messages

  • Downloading ALV to excel file

    Hi all,
       i am trying to download ALV to excel file.
       but as the alv contains many fields,
       the row in the excel is automatically wrapped to the
       next row ..
       what i want is the row in excel should come as it is
       in the ALV (whole thing in one line) and should not wrap to next row
      Regards,
      Tarang

    Hi Shah,
    <b>
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'</b>
        EXPORTING
          I_CALLBACK_PROGRAM      = V_REPID
          I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
          IS_LAYOUT               = WA_LAYOUT
          I_SAVE                  = 'A'
          IT_FIELDCAT             = I_FLDCAT_HEAD
          IT_SORT                 = IT_SORT
          IT_EVENTS               = I_EVENTS
        TABLES
          T_OUTTAB                = IT_FINAL
        EXCEPTIONS
          PROGRAM_ERROR           = 1
          OTHERS                  = 2.
      IF SY-SUBRC = 0.
    <b>     CALL FUNCTION 'GUI_DOWNLOAD'</b>
         EXPORTING
          BIN_FILESIZE                    =
            FILENAME                        = 'C:\Documents and Settings\vikranthk\Desktop\vikranth.xls'
           FILETYPE                        = 'ASC'
          APPEND                          = ' '
          WRITE_FIELD_SEPARATOR           = ' '
          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
    Thanks
    Vikranth Khimavath
    Message was edited by: Khimavath Vikranth

  • Safari not downloading but open any file in browser

    All of a sudden I can't seem to download any files with Safari anymore, where it use to save the file in the download folder it stop doing that and trying to open the files in the browser, so for example a text file will show up as text in the browser, binary files show garbage on the web browser - nothing in download folfer even though that is where it's suppose to save download that is set in Preferences. Can't remember changing anything or installing something new.
    Running a MacBook Pro on OSX 10.6.8 and Safari 5.0.5.
    Did not have Speed Download or anything like that installed.
    Any suggestions?
    Thanks
    Jaco

    Go to ~/Library/Safari. Move the Downloads.plist file to the Trash.
    Restart your Mac.
    ~ (Tilde) represents your Home folder.

  • When I give a download commond for any file, saving bar itself is not showing

    when try to give command to download any file, saving bar or open doesn't show at all, I mean if I have open & see any download file at least it has ask for open or saving option should be given, earlier this problem was not there.

    Do you mean this? Tools > Options > General : Downloads : "Always ask me where to save every file"

  • Download ALV into excel file

    Hi experts,
                   I used subtotals in ALV.first three columns I claculated based on the addition of individual column.In fourth column i calculated the value based on three calculated values ...It is  not problem.
              when i download this into excel file the original value is only coming .the calculated value i.e) calculated based on three values didnt get displayed in excel file..Help me please...
    Thank u,
    Manjula Devi.D

    Hi.
    I find that
    List > Export > Spreadsheet
    gives no subtotals, but
    List > Export > Local File and then Spreadsheet
    does give subtotals.
    I find that
    Views > Microsoft Excel
    followed by
    Save As
    does give subtotals.
    John

  • Cannot download from safari any files.

    Hope someone can help, I'm unable to download any files, get the spinning wheel then a plain dark grey screen, then it times out. I checked my internet plug ins and i don't have any third party plug ins. I've also trashed my downloads plist but no joy. Finally I have also tried changing the download location to desktop, then changing back to downloads, but still no luck. Has anyone else had the same trouble? I cannot even download firefox as an alternative because it won't even allow me to download this file. I'm running most up to date version of snow leopard and safari 4. Really stuck please help thanks.

    Well, you went a bit overboard on removing things. You definitely need these for Safari to run properly:
    JavaPluginCocoa.bundle
    nsIQTScriptablePlugin.xpt
    Quartz Composer.webplugin
    QuickTime Plugin.plugin
    The others are all optional, depending upon what other software you may have installed. One or a combination of them is probably the cause of the inability to download files in your user account, but unless you installed them in the new user account you created, it doesn't explain downloads not working in that account.
    Try adding the Internet Plug-Ins back one at a time, starting Safari and testing for the problem each time, then quitting and adding another one and repeating the process until you're unable to download a file. That last item added back is one of the culprits, and if you still have more you haven't added back for testing, one or more of them could also be contributing factors.
    You may have a version that is simply incompatible with Snow Leopard, so you should check the site for a compatible version and install that. If there is no compatible version, you'll have to do without it until there is one.

  • Download Music or any file.

    Whenever i try to download any music or video it show online music or video but it cannot show download option.

    hello, you can long-tap somewhere on the player interface and select ''save audio/video''in order to download the file.

  • Download ALV O/P to multiple XL files

    Hi All,
                I have a report with subtotals at the vendor level, my requirement is when the user presses a button each vendor's information with the subtotals should  go to a different XL file. The user can have his own layout; how can I know in my program which fields he had picked up for his layout? Any pointers would be great. Thanks!
    Regards,
    Amit

    Hi there -- the OO method for ALV GRID works from V4.6C so you should have NO problem in using ALV OO (CL_GUI_ALV_GRID).
    What you could do is intercept the standard button for EXPORT
    use the ON_USER_COMMAND method with the parameter e_ucomm.
    The function code is &PC.
    Then do your own download  to your relevant files and exit back to the grid or make a new button on the toolbar EXPORT for example with your own FCODE.
    In the example below I've got a download to excel but change the method to your download for your users.
    standard SAP class cl_gui_frontend_services has  methods gui_upload and gui_download for up / downloading files etc.
    note that the layout used in any particular OO grid is normally to be found in some parameter  ls_layout so reading this table at your ON_USER_COMMAND event should give you the layout the user is using.
    If you don't get it directly in the ON_USER_COMMAND method you can call a method from this method  like I have done .  The layout is available in this method (or any other after the Grid has been displayed).
    when 'EXCEL'.
           call method me->download_to_excel.
    method constructor .
    create object grid_container1
            exporting
    *           container_name = 'CCONTAINER1'.
        container_name = cfname.
        create object  grid1
           exporting
              i_parent = grid_container1.
        set handler z_object->on_user_command for grid1.
        set handler z_object->on_toolbar for grid1.
        set handler z_object->handle_data_changed for grid1.
        set handler z_object->handle_data_changed_finished for grid1.
        set handler z_object->on_dubbelklik for grid1.
        set handler z_object->on_hotspot for grid1.
        call method grid1->register_edit_event
            exporting
               i_event_id = cl_gui_alv_grid=>mc_evt_enter.
      endmethod.
    method on_toolbar .
    type-pools icon.
    clear ls_toolbar.
         move  0 to ls_toolbar-butn_type.
         move 'EXCEL' to ls_toolbar-function.
         move  space to ls_toolbar-disabled.
         move  icon_xxl to ls_toolbar-icon.
         move 'Excel' to ls_toolbar-quickinfo.
         move  'EXCEL' to ls_toolbar-text.
         append ls_toolbar to e_object->mt_toolbar.
        perform   toolbar  in program (caller) if found
         using e_object.
    endmethod.
    method on_user_command .
    *        FOR EVENT before_user_command OF cl_gui_alv_grid
    *        IMPORTING
    *          e_ucomm
    *          sender
    case e_ucomm.
          when 'EXIT'.
            leave program.
          when 'EXCEL'.
           call method me->download_to_excel.
          when 'SAVE'.
          when 'PROC'.
            call method me->process.
          when 'REFR'.
            call method me->refresh.
            when 'SWITCH'.
            call method me->switch.
           when 'TEST'.
            call method me->get_cell.
           endcase.
    endmethod.
    method download_to_excel.
    field-symbols:
           <fs0> type standard table,
           <fs1> type standard table.
        assign g_outtab1->* to <fs0>.
        assign g_fldcat1->* to <fs1>.
           call function  'LVC_TRANSFER_TO_KKBLO'
          exporting
            it_fieldcat_lvc   = <fs1>
    *     is_layout_lvc     = m_cl_variant->ms_layout
             is_tech_complete  = ' '
          importing
            es_layout_kkblo   = ls_layout
            et_fieldcat_kkblo = lt_fieldcat.
        loop at lt_fieldcat into lt_fieldcat_wa.
          clear lt_fieldcat_wa-tech_complete.
          if lt_fieldcat_wa-tabname is initial.
            lt_fieldcat_wa-tabname = '1'.
            modify lt_fieldcat from lt_fieldcat_wa.
          endif.
          l_tabname = lt_fieldcat_wa-tabname.
        endloop.
        call function 'ALV_XXL_CALL'
             exporting
                  i_tabname           = l_tabname
                  is_layout           = ls_layout
                  it_fieldcat         = lt_fieldcat
                  i_title             = sy-title
             tables
                  it_outtab           = <fs0>
             exceptions
                  fatal_error         = 1
                  no_display_possible = 2
                  others              = 3.
        if  sy-subrc <> 0.
          message id sy-msgid type 'S' number sy-msgno
                 with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        endif.
    endmethod.
    Cheers
    jimbo

  • I am trying to download a variety of files and when it is finished, the Mac freezes up and the task bar continues to blink on and off. I have to go into Firefox and actually quit the application to continue. Any help is very much appreciated

    I am trying to download a variety of files and when it is finished, the Mac freezes up and the task bar continue to blink on and off.
    I have to go into Firefox and actually quit the application to continue. Any help is very much appreciated.

    are you backing up files, or doing a Time machine backup, either way, the Time machine will STOP when finished and show "last backup at XXXXXX"  meaning its done...... OR if when transferring files, it will show a progress bar on your desktop and vanish when files are copied.
    Open up the Hitachi drive (your G drive is made by Hitachi, and the best made by the way).....and see if the files are there.
    a MORE VISUAL way is to open the hard drive file, and drag and drop files INTO the Gdrive and you can see them visually be copied there as you do it.
    To see your HD on your desktop GOTO  FINDER......PREFERENCES....then GENERAL TAB.........check the box marked HARD DRIVES.........then your Gdrive will appear on your desktop........open it from there,  and DRAG and drop files from anywhere INTO the Gdrive....... easy visual way to see the files being copied into the Gdrive.

  • I can not download any files, i think i by misstake put the download manager in the trash and then deleted it, what should i do? I am not so shore what the program is called in English( in Swedish:filhämtare) but it looks like a little grey box

    Hi, i really need help... I think i by accident deleted the "download manager" i´m not shore what the program is called in English ( Swedish : filhämtaren), but its symbol looks like a grey little box and when you download a file it appears on a list and is then saved in this program. I don`t know how i didn´t see it in the trash, but somehow i deleted this program by mistake. And as a consequence i can no longer open/download any files. I just got my macbook pro and i do love the system but i am now unsure about what i should do with this problem since i am not that terribly good with computers.... Is there any way you can fix this?

    soffi h wrote:
    Hi, i really need help... I think i by accident deleted the "download manager" i´m not shore what the program is called in English ( Swedish : filhämtaren), but its symbol looks like a grey little box
    If it looks like this:
    It's called an "installer.app"
    You can custom install the "installer.app" directly from your System DVD that originally came w/your computer.  It will be either inside the "Bundled Software" folder or inside the "Applications" folder.

  • If i download any file which is prepare on microsoft office 2007 . The file have been download without extension of the prog. Means if files name is "1,docx" when i download from firefox it download in that form "1". after download i have to rename and gi

    If i download any file which is prepare on microsoft office 2007 . The file have been download without extension of the prog. Means if files name is "1,docx" when i download from firefox it download in that form "1". after download i have to rename and give the extension name is plz tell me the way that office files are compatible with it.
    == This happened ==
    Every time Firefox opened
    == when i download the office files

    In Firefox Options / Privacy be sure "Remember download history" is checked. To see all of the options on that panel, "Firefox will" must be set to "Use custom settings for history".
    To find your OS information, on your Windows desktop, right-click the My Computer icon, choose Properties, under System on that small window is info about your OS.
    '''If this reply solves your problem, please click "Solved It" next to this reply when <u>signed-in</u> to the forum.'''

  • I recently updated my macbook, i don't know if that has any effect to my recent problem, but when i try to download and save .mp3 files from the internet, like i have done in the past, it downloads but not as an mp3 file, its "blank"

    i recently updated my macbook, i don't know if that has any effect to my recent problem, but when i try to download and save .mp3 files from the internet, like i have done in the past, it downloads but not as an mp3 file, its "blank" and when i try to open it, i can't? I NEED HELP !

    Here is the download page

  • Firefox crashes whenever i want to install any addon or download any file. Some times i am receiving error while downloading any file like "could not be saved, because you cannot change the contents of that folder"

    I am the user of latest firefox 3.6.6 browser. I am getting problems of frequent crashes whenever i tries to install any addon. The crashes also occures whenever i want to download any file.
    I am also receiving errors while downloading any file like:
    "C:\Users\****\AppData\Local\Temp\******.001.part could not be saved, because you cannot change the contents of that folder.
    Change the folder properties and try again, or try saving in a different location. I already changed it many many times but still the same problem."
    Adobe flash palyer is also giving problems of not responding. I am using updated version of it already. Java is also updated.
    I already uninstalled firefox compeletly and re installed it many many times but still the same problem. I also scanned my computer with avira and malware bytes' Anti malware and got no dection. Please ractify this problem ASAP lest my profession will suffer.
    == Crash ID(s) ==
    b7f518f2-8d86-41ca-8bab-aee632100709; 1d790e10-d8eb-4904-98c9-94bc62100708; f042d319-b9f8-42ed-a8cb-57c7d2100708

    Please help.
    It is getting worse
    Adobe flash player is crashing. I already uninstalled and re installed the latest ver. Also it is hanging randomly.
    Please help.

  • HT1386 The laptop I originally synch'd my iphone 4s with is broken and cannot retrieve any files. How can I sync the phone with a new laptop without losing all my downloaded music and apps already installed on my iphone?

    The laptop I originally synch'd my iphone 4s with is broken and cannot retrieve any files. How can I sync the phone with a new laptop without losing all my downloaded music and apps already installed on my iphone?

    If the answer to the above question is "yes", FIRST, set up a backup of your new computer before you do anything else so the next time your computer breaks you will not be in the same situation. Backup solutions are numerous and inexpensive, and there is absolutely no excuse in the Third Millennium not to have one.
    Then see this tip: https://discussions.apple.com/docs/DOC-3141

  • When i download any file it start in a second but when i pause the downloading file & after some time when i open it amessage flash 'download error' source file could not be read please try again later or contact the server administrator.

    when i download any file it works frequently and downloading start in a second but when i pause the downloading file & after some time when i open it,The downloading not start proper and after some time a message flash 'download error' source file could not be read please try again later or contact the server administrator.

    I downloaded the Microsoft Autoruns package and ran it.  There are no programs in the LSA Providers tab, and Apple's Bonjour is the only program in the Winsock Providers tab.  I also did the "netsh winsock reset" and rebooted.  It didn't fix the problem.  Any more ideas?

Maybe you are looking for

  • Variable Function Names

    What I'm trying to do is add event listeners for each position up to the total of compPositions. This way, each one will have a dymanic function name. Right now, they all launch function "clicked1" but I can't figure out how to make it add numbers to

  • How do i get my music from the icloud to verizon cloud

    I am trying to export my music from my Itunes library to verizon cloud.  How do I do that?

  • Index contention & row lock contention

    Hi, Recently our application loaded a handsome amount of data into our production database. The process took around 5 to 6 hours. During this process, we observed that the performance degraded. The major wait events are 1) TX index contention (concur

  • Multi-line command problems

    I am trying to add an motd banner to a configuration template in template center.  When I add it I get the following error on the import: Template import Failed. Unable to parse the XML file.Please ensure that the XML file is complaint to the schema.

  • Is it legal to use iMovie content such as audio for commercial purposes?

    The reason for my question is that I want to make a commercial video where I use some of the audio content from iMovie, but I am not sure if it is legal.