Download ALV to Desktop

Hi All!
  I have a Dialogue Program.In that I want to introduce a download button.Clicking on that button should allow me to download the ALV report to desktop in a excel sheet.
    Secondly output in excel sheet should contain fields of ALV as well as 2 extra field form some other internal table.
  Kindly suggest me a way how could I achieve it.
Help would be appreciated.
Regards
Sourabh

Hi
  U can Use As Follows.
DATA  : BEGIN OF IT_FIL_HEADINGS OCCURS 0,
        COL(40) TYPE C,
        END OF IT_FIL_HEADINGS.
Case ok_code. 
   WHEN 'DWND'.
    PERFORM CREATE_DOWN_LOAD_FILE.
endcase.
FORM CREATE_DOWN_LOAD_FILE .
  CLEAR IT_FIL_HEADINGS.
  IT_FIL_HEADINGS-COL = 'Sales Ord. Num.'.
  APPEND IT_FIL_HEADINGS.
  CLEAR IT_FIL_HEADINGS.
  IT_FIL_HEADINGS-COL = 'Item Lev. Num.'.
  APPEND IT_FIL_HEADINGS.
  CLEAR IT_FIL_HEADINGS.
  IT_FIL_HEADINGS-COL = 'Product'.
  APPEND IT_FIL_HEADINGS.
  CLEAR IT_FIL_HEADINGS.
  IT_FIL_HEADINGS-COL = 'Location'.
  APPEND IT_FIL_HEADINGS.
  CLEAR IT_FIL_HEADINGS.
  IT_FIL_HEADINGS-COL = 'Delivery Date'.
  APPEND IT_FIL_HEADINGS.
  CLEAR IT_FIL_HEADINGS.
  IT_FIL_HEADINGS-COL = 'Customer Ord. Num.'.
  APPEND IT_FIL_HEADINGS.
  CLEAR IT_FIL_HEADINGS.
  IT_FIL_HEADINGS-COL = 'Commits'.
  APPEND IT_FIL_HEADINGS.
  CLEAR IT_FIL_HEADINGS.
  IT_FIL_HEADINGS-COL = 'Actuals'.
  APPEND IT_FIL_HEADINGS.
  CLEAR IT_FIL_HEADINGS.
  IT_FIL_HEADINGS-COL = 'Remarks'.
  APPEND IT_FIL_HEADINGS.
  CLEAR IT_TCL.
  CLEAR FILE_NAME.
  CONCATENATE 'C:\' 'Germany MTO Front End' '.XLS' INTO FILE_NAME.
  CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
      FILENAME                = FILE_NAME
      FILETYPE                = 'ASC'
      WRITE_FIELD_SEPARATOR   = 'X'
     DAT_MODE                = 'X'
    TABLES
      DATA_TAB                = IT_TCL
      FIELDNAMES              = IT_FIL_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.
ENDFORM.                    " CREATE_UPLOAD_FILE
If u want Two Additional columns Then Ur Internal Table Should Contain those columns also
Regards
Ahasan

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

  • Facing problem while downloading ALV grid Output into Excel

    Hi Guys,
    I am facing problem while downloading ALV grid Output into Excel.
    It is downloading into excel, but all character columns first and next all quantity columns it is displaying. But I need columns order as it is in the grid.
    If I take all columns as characters it works fine. But it will be problem for calculating total, subtotals of quantity columns
    Can someone help me regarding this
    thanks for your help

    Hi,
    Open up Excel on your desktop. Goto Tools > Macro > Security.
    Make sure that your security is set to Medium (or less). SAP uses OLE automation to run the Excel instance and in Office 2003 (for example), Microsoft has increased their default security setting to High. With the High setting, the output to Excel fails.
    Was this your problem? Don't forget those points, either.
    check with this wetther it is solved or not.
    Regards,
    sana.

  • Download ALV report to PDF with Lights

    Hi,
    I have a requirement wherein, when i download ALV report to PDF which has Lights in the first column.  My problem is these lights are not displayed instead i get the following in the PDF
    PDF o/p:
    XOO RED SIGNAL
    OXO YELLOW SIGNAL
    OOX GREEN SIGNAL
    Please let me know how to get the lights in the PDF o/p
    Thanks & Regards,
    Sandhya

    Hi Sandhya,
    U can convert any type of display(SF,ALV) to PDF.....
    User Program rstxpdft4 to convert it first the O/P need to be converted into spool.
    cheers,
    Naveen.

  • HT203167 My iTunes library on laptop is correct/up to date with recent purchases and downloads; however, our desktop computer does not have any of these when logged into Itunes.... how do I add these so both computers have current info?

    The iTunes library on our laptop is correct and up to date with recent purchases and downloads; however, our desktop does not have any of these when using it.  Home sharing is turned "ON" with both computers. Why is the desktop not showing the same content and how do I resolve this?

    From your OLD computer...
    Copy your ENTIRE iTunes FOLDER to an External Drive... and then from the External Drive to your New Computer..
    Full Details Here  >  http://support.apple.com/kb/HT1751
    Also see this migrate iTunes library post by turingtest2

  • BlackBerry Desktop Software Is their a download for Mac desktop Os 10.5.8

    Hi
    I was wondering if their is an archive within Blackberry where I could download a BlackBerry Desktop Software for my mac. I am useing 10.5.8, the new version is for 10.6 or higher.
    Regards
    Vintage Tec head 8088

    This subject has been discussed on the forum already.
    No earlier versions of the MAC desktop software for reasons unknown to us.
    Indeed PC versions can be retrieved somewhere, I guess, but not for the Mac.
    Only a possible reader of this forum could offer you his file if still an older version in his archive folders or something similar.
    Fingers crossed
    Please don't forget to mark as "solved" if your question is replied and to "like" a useful reply to your post ;-)

  • I have tried many times to download creative cloud desktop app such as AI, LR, PS, ID and so on.  the following message appears You are running an operating system that Illustrator no longer supports. Refer to the system requirements for a full list of su

    I have tried many times to download creative cloud desktop app such as AI, LR, PS, ID and so on.  the following message appears You are running an operating system that Illustrator no longer supports. Refer to the system requirements for a full list of supported platforms. The only one I have succeeded to download are DW and MU.
    Please could you help out

    Hello,
    please have a look at the different sys-requirements for example:
    AI: http://helpx.adobe.com/illustrator/system-requirements.html
    PS: http://helpx.adobe.com/photoshop/system-requirements.html
    (LR 1-5: http://helpx.adobe.com/de/lightroom/system-requirements.html)
    You will find the same explanations for your other programs.
    Hans-Günter

  • I am an Adobe CC subscriber and my account is paid up.  Why am I seeing "TRY" beside some programs I'd like to download in the desktop CC app?

    I don't know why a "TRY" button is next to apps I want to download in the desktop Adobe CC app manager.  I am a paid up subscriber.

    Does your Cloud subscription properly show on your account page?
    If you have more than one email, are you sure you are using the correct Adobe ID?
    https://www.adobe.com/account.html for subscriptions on your Adobe page
    If yes
    Some general information for a Cloud subscription
    Cloud programs do not use serial numbers... you log in to your paid Cloud account to download & install & activate... you MAY need to log out of the Cloud and restart your computer and log back in to the Cloud for things to work
    Log out of your Cloud account... Restart your computer... Log in to your paid Cloud account
    -Sign in help http://helpx.adobe.com/x-productkb/policy-pricing/account-password-sign-faq.html
    -http://helpx.adobe.com/creative-cloud/kb/sign-in-out-creative-cloud-desktop-app.html
    -http://helpx.adobe.com/x-productkb/policy-pricing/activation-network-issues.html
    -http://helpx.adobe.com/creative-suite/kb/trial--1-launch.html
    -ID help https://helpx.adobe.com/contact.html?step=ZNA_id-signing_stillNeedHelp
    -http://helpx.adobe.com/creative-cloud/kb/license-this-software.html
    If no
    This is an open forum, not Adobe support... you need Adobe staff to help
    Adobe contact information - http://helpx.adobe.com/contact.html
    -Select your product and what you need help with
    -Click on the blue box "Still need help? Contact us"

  • Download ALV output to excel with formatting

    Hi All,
    i want to download ALV output to excel sheet and the uneditable fields in ALV oputput should be locked (uneditable) in excel also.
    Can you please tell me approach to achieve this functionality?
    Thanks in advance.

    Thanks Vamsi. Your Suggestion was helpful.
    I have used excel integration and used SET PROPERTY OF (COLUMN) 'LOCKED' = 1.
    For more details refer below mentioned link.
    http://webcache.googleusercontent.com/search?q=cache:SoY6hFC17PoJ:wiki.sdn.sap.com/wiki/display/Snippets/Download%2BData%2Binto%2BMultiple%2BSheet%2BExcel%2BDocument%2Bwith%2BNon%2BEditable%2BColumns%2B(Password%2Bprotected)%2BUsing%2BABAP%2BOLESetPropertynoteditableexcelsapABAP&cd=1&hl=en&ct=clnk&gl=in&source=www.google.co.in (http://webcache.googleusercontent.com/search?q=cache:SoY6hFC17PoJ:wiki.sdn.sap.com/wiki/display/Snippets/Download%2BData%2Binto%2BMultiple%2BSheet%2BExcel%2BDocument%2Bwith%2BNon%2BEditable%2BColumns%2B%28Password%2Bprotected%29%2BUsing%2BABAP%2BOLESetPropertynoteditableexcelsapABAP&cd=1&hl=en&ct=clnk&gl=in&source=www.google.co.in

  • How to download alv grid output(with field catalog) into excel file format

    Hi all,
    How to download alv grid output(with field catalogs) into excel file format and same file has to download to application server.
    Please help.
    Regards,
    Satya.

    Hi,
    On list where alv is displayed, select export icon( green color -> ),select spread sheet.
    This will display records in Excel sheet.

  • To download alv output to two excel sheets because of large data

    Hi all,
    I want to download alv output to excel sheet,I know how to do,but the no of record is very large and can not be accomodated in one sheet.
    can anyone please tell how to download it into two sheets or some other way.
    I want excel format only.
    Regards,
    sudha

    hi sudha yadav,
    right now i am working on the same issue.
    what right i am doing is that,
    i want to download an internal table it is containing more than 2 lakhs records but excel can accomidate 60000 records, so
    before call gui download i am sending first 60000 records into another internal table with same time, by using append statemen and indexs,
    that new internal table i am downloading
    again i am repeating the same thing by using sy-tabix,
    finally i am creating more than one excel file
    by using oops concepts we can also create in one excel file no of work sheets
    but its lengthy process so i am right now creating no of excel files only
    if it is useful , pls rewards points to this answer

  • Dump in prodcution server while downloading ALV report to excel sheet

    HI ALL,
    ALV report is working fine in bother DEV and PROD servers....but in production while downloading report to excel sheet it is going to dump.
    "dump is below:
    Short text
    Field symbol has not yet been assigned.
    What happened?
        Error in the ABAP Application Program
        The current ABAP program "SAPLKKBL" had to be terminated because it has
        come across a statement that unfortunately cannot be executed. "
    But in development this problem is not there, iam able to download ALV report to EXCEL sheet.
    Any help experts......
    Thanks in advance
    Ram

    Hi,
    I had the same problem,
    Run a consistency check for your ALV and you will find out. See if you havent passed any unnecessary parameter to FM.
    /people/rainer.hbenthal/blog/2009/09/25/sos--my-alv-report-is-not-working
    Dump while printing ALV (field symbol not assigned)
    Sumit

  • Downloading ALV to EXCEL - in some fields the last character is missing ...

    Hi,
    I am experiencing this kind of problem when downloading ALV report into Excel :-
    "You are downloading an ALV result to an EXCEL file. In some fields the last character is missing."
    For example, if MATNR is 0000234567 in display but after downloading to excel it becomes only 23456.
    I found another related forum thread : Pronlem while downloading ALV grid to excel
    I tried the suggested method to apply OSS note 1075315. However, the note cannot be implemented in the system. I am working in a ECC6 environment (SAP version 700, 701).
    Kindly please help me if you came across the similar kind of issue. Thanks much.

    Hi gkGoh8     ,
    The link thread that you just gave already provided the answer, in your field catalog you need to activate field lzero.
    1. Check FM : REUSE_ALV_GRID_DISPLAY
    2. Import Parameter tab :IT_FIELDCAT
    3. Double click SLIS_T_FIELDCAT_ALV
    4. On type group SLIS, check line 93
    Regards,
    JQC

  • Problem in downloading ALV output in excel

    Dear Abapers,
                           I am facing a problem while downloading alv output in spreadsheet. Report headers and data headings are coming in excle but contents are missing instead of that No Data is displaying on excel sheet. I have debug that and observed the deep structure name T_OUTTAB using by the FM ALV_DATA_EXPORT is empty, It should contain the contents of my output data.
    Below I am giving my code. 
    ***********************************************declaration****************
          BEGIN OF d_file_out,
            index           TYPE i,                      "Index no
            msg             TYPE string,              "Message
            msgtyp(1)       TYPE c,                 "Message type
           END OF d_file_out,
    DATA:t_file_out       TYPE TABLE OF d_file_out.
    DATA:wa_file_out          TYPE d_file_out.
    Display Error Logs
    PERFORM display_logs USING text-006.
    FORM display_logs USING p_text TYPE string.
      CONSTANTS:  c_count    TYPE char5 VALUE 'INDEX',
                  c_mestyp   TYPE char6 VALUE 'MSG',
                  c_message  TYPE char7 VALUE 'MSGTYP'.
    *Field catalog
      PERFORM: z_field_catalog USING c_count   text-010,  "Record number
               z_field_catalog USING c_mestyp  text-011,  "Message type
               z_field_catalog USING c_message text-012.  "Message
    *Top of page event
      PERFORM z_event USING t_events.
    wa_layout-colwidth_optimize = c_x.
    ALV grid.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
         i_buffer_active          = 'X'
           i_callback_program = sy-repid
         is_layout          = wa_layout
         I_STRUCTURE_NAME   = wa_file_out
          it_fieldcat        = t_field
          it_events          = t_events
        TABLES
          t_outtab           = t_file_out
        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.
    ***********************************Fieldcatalog**********************************************
    FORM z_field_catalog USING p_field TYPE any
                                                p_name  TYPE any.
      wa_field-fieldname = p_field.
      wa_field-seltext_l = p_name.
      IF p_field = 'INDEX'.
        wa_field-outputlen = '14'.
        wa_field-col_pos = 1.
      ELSEIF p_field = 'MSG'.
        wa_field-outputlen = '120'.
        wa_field-col_pos = 2.
      ELSEIF p_field = 'MSGTYP'.
        wa_field-outputlen = '08'.
        wa_field-col_pos = 3.
      ENDIF.
      APPEND wa_field TO t_field.
      CLEAR wa_field.
    ENDFORM. 
    Here I have given my code, which contain the building of field catalog and Calling ALV Grid. I have already checked the excel micros settings. Other programs are working fine on my system and downloading in excel is also working.
    Hope to get reply soon.
    Regards,
    Himanshu

    Hi ,
    use this to down load to xcel
    v_file = lv_file.
      DATA:  BEGIN OF s_head OCCURS 0,
             head(40) TYPE c ,
             END OF s_head.
      s_head-head = text-015."'Sales price'.   * for header
      APPEND s_head.
      s_head-head = text-016."'Purchase price'.   * for header
      APPEND s_head.
      s_head-head = text-017."'Listing Procedure'.   * for header
      APPEND s_head.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          filename                        = v_file
         filetype                        = 'ASC'
         write_field_separator           = '#'
        TABLES
          data_tab                        = it_output1[]
          fieldnames                      = s_head[]
       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.

  • I'm trying to install Adobe CC on the 2nd computer, a Macbook and after downloading the CC desktop app I double click to intall. When it looks to be done installing I go to double-click on the ourobouros icon at the top and I am rewarded with the spinning

    I'm trying to install Adobe CC on the 2nd computer, a Macbook and after downloading the CC desktop app I double click to intall. When it looks to be done installing I go to double-click on the ourobouros icon at the top and I am rewarded with the spinning beach all of death. Any suggestions?

    Hi,
    Please refer to the help document below to fix the issue:
    App doesn't open | Progress wheel spins continually
    Regards,
    Sheena

Maybe you are looking for

  • Std workflow for Parked Invoices?

    hi guys are there any std workflows for parked invoices? Our requirement is that once the Finance clerk creates a customer or vendor invoice he should only be able to park it and not post the invoice. Once the invoice is parked then the system should

  • How many categorization of customers possible in oracle.

    i.e for single customer we like to categorise it as 1. Domestic      1.1 Wholesealer           1.2 - NSW Region. So in short every customer needs to be configured for three categories. Which fields we can use for the same in customer master. we know

  • Analyzing core dumps generated by JVM

    I have an application written in Java that is crashing with JVM core dumps. All debug symbols have been installed but since the default build of JDK doesn't have Java binary with debug information, it is difficult to nail down the problem. gdb shows

  • Distributed query using local BackingMap

    I'm trying to create a distributed query (deriving a task from AbstractInvocable). I want each cluster node to query only it's local storage, aggregate a result and then return that single result to the invoker of the Task.      To do this I'm using

  • Audacity effects not recognized by iTunes?

    I imported some CD music into iTunes, and opened up the music into Audacity. So far so good. I did some editing of the music, including some fade-ins and fade-outs. But when I play back the finished product through iTunes, the fading effects do not w