Problem: User has problems to export ALV Grid to Excel...

Hello experts,
I have a very strange problem with an single user: when she tries to export ALV Grid data from SAP into Excel by List/Export/Spreadsheet, she's only able to export this to an xml-based file on her local client, every other user gets the popup to choose the spreadsheet format (XXL...).
What I did so far:
- Look up Excel Makro Security --> the same as on other desktops
- SAP GUI Patch Level --> the same as on other desktops
- Test with an different user on her desktop on SAP Report S_ALR_87012284 --> it worked perfectly
- User parameters are the same as for the test user
- Security regarding ALV is the same (S_GUI ACTVT = 61...)
Has there ever been a similar problem to anyone else?
Many thanks in advance for your feedback!

Hi ,
This problem looks very weired. Just try running that FM from SE37 from the same system and see that what is happening there.... if the problem is similar then it is not the problem of your report and some patch may be missing in that system.

Similar Messages

  • Facing a Problem while downloading the data from ALV Grid to Excel Sheet

    Hi Friends,
    Iam facing a problem while downloading the data from ALV Grid to excel sheet. This is working fine in Development server , when comes to Quality and Production servers I have this trouble.
       I have nearly 11 fields in ALV Grid and out of which one is PO number of length 10 , all the ten numbers are visible in the excel sheet if we download it from development server but when we download it from Quality or Production it is showing only 9 numbers.
    Can any one help me out in this case.

    hi...
    if this problems happens dont display the same internal as u finally got.
    just create new internal table without calling any standard data elements and domains... but the new internal table s similar like ur final internal table and move all the values to new int table.
    for eg.
    ur final internal int table for disp,
         data : begin of itab occur 0,
                        matnr like mara-matnr,
                   end of itab.
    create new like this,
               data : begin of itab occur 0,
                        matnr(12) type N,
                   end of itab.

  • Total problem in Exporting ALV GRID to Excel

    Hi all,
    I have manipulated the Total of ALV Grid by using GET_SUBTOTALS and REFRESH method of CL_GUI_ALV_GRID. The ALV Output is also correct. When i export to Excel,only the Original total is displaying not the calculated one. How to download the exact output which is displaying in the ALV Grid to Excel.
    Please help me out to solve this.
    Thanks,
    Ramesh

    DEAR,
    AS U WANT UPLOAD WITH THE SUB TOTAL YOU TRY THIS.
    FIRST to get subtotal in ALV output you select at least one column of total and then press ctrl + F6 . u will see the sub total .
    and now how to download it so press  ctrl + shift + F9 .
    now screen appears and select second option ie spreadsheet and press enter
    now a screen appear  in wich u have to give file name.
    so double click on search button of file name . click on desktop  give ur file name as u want suppose zreport u have given.
    and save type = excel file.
    now save it and then generate it your output bytes will be transmitted .
    now u can see in your desktop in your file name . ur output with subtotal.
    regards
    navin

  • Export alv grid to excel

    When I try to export to excel using the Icon in the toolbar, or List->Export->Spreadsheet..., it happens that it opens a new excel file, but it is empty. All the data selected disappear.
    But if I try to export through Local file, it exports the data, but not in the format I prefer.
    Anyone can help me?
    Thank you!

    REPORT z_down_xml LINE-SIZE 132 NO STANDARD PAGE HEADING.
    Databases
    TABLES:
      makt,                                "Mat description
      marc,                                "Material / plant
      t001w,                               "plant name
      bhdgd.                               "Batch heading
    Internal tables
    DATA:
      BEGIN OF gt_marc OCCURS 0,
        werks LIKE marc-werks,
        matnr LIKE marc-matnr,
      END OF gt_marc,
    Table to be downloaded as xml. Each line stores start and end tags
    and the value
      BEGIN OF gt_xml OCCURS 0,
        line(120),
      END OF gt_xml,
      g_maktx(120).
    User-input
    SELECT-OPTIONS:
      s_werks FOR marc-werks,
      s_matnr FOR marc-matnr.
    START-OF-SELECTION.
    Extract all required data
      PERFORM main_processing.
    END-OF-SELECTION.
      SORT gt_marc BY werks matnr.
      LOOP AT gt_marc.
        AT FIRST.                          "First tag must be root
          CLEAR gt_xml.
          gt_xml-line = ''.
        APPEND gt_xml.
        CLEAR gt_xml.
    display data
        FORMAT COLOR 2 ON.
        WRITE :/ gt_marc-matnr, makt-maktx.
        FORMAT COLOR 2 OFF.
      ENDLOOP.
    The last tag must be the root closing tag --*
      gt_xml-line = '</LOCATIONS>'.
      APPEND gt_xml.
      CLEAR gt_xml.
      CALL FUNCTION 'DOWNLOAD'
           EXPORTING
                filename = 'C:PLANT1.XML'
                filetype = 'ASC'
           TABLES
                data_tab = gt_xml.
    TOP-OF-PAGE.
      MOVE sy-title TO bhdgd-line1.
      MOVE sy-repid TO bhdgd-repid.
      MOVE sy-uname TO bhdgd-uname.
      MOVE sy-datum TO bhdgd-datum.
      MOVE '0' TO bhdgd-inifl.
      MOVE '132' TO bhdgd-lines.
      FORMAT INTENSIFIED ON COLOR COL_HEADING.
      PERFORM batch-heading(rsbtchh0).     "report header
    Form READ_PLANT
    FORM read_plant.
    Get plant name
      CLEAR t001w.
      SELECT SINGLE name1
        INTO t001w-name1
        FROM t001w
       WHERE werks EQ gt_marc-werks.
    ENDFORM.                               " READ_PLANT
    Form MAIN_PROCESSING
    FORM main_processing.
    Material and plant basic data
      SELECT werks matnr
        INTO TABLE gt_marc
        FROM marc
       WHERE werks IN s_werks
         AND matnr IN s_matnr.
    ENDFORM.                               " MAIN_PROCESSING
    Form READ_DESCRIPTION
    FORM read_description.
    Material name
      CLEAR g_maktx.
      SELECT SINGLE maktx
        INTO g_maktx
        FROM makt
       WHERE matnr EQ gt_marc-matnr
         AND spras EQ 'E'.
    Replace special character
      DO.
        REPLACE '&' WITH '*ù%;' INTO g_maktx.
        IF NOT sy-subrc IS INITIAL. EXIT.ENDIF.
      ENDDO.
      DO.
        REPLACE '*ù%;' WITH '&amp;' INTO g_maktx.
        IF NOT sy-subrc IS INITIAL. EXIT.ENDIF.
      ENDDO.
      DO.
        REPLACE '/' WITH '&#47;' INTO g_maktx.
        IF NOT sy-subrc IS INITIAL. EXIT.ENDIF.
      ENDDO.
    ENDFORM.                               " READ_DESCRIPTION

  • Alv Grid to Excel Sheet Downloading problem for Bank account Number(CHAR18)

    Hi every one,
                 I am downloading  Alv grid to excel using local file---> spreadsheet
    but,  the bank account no is populating as like ''11+E213". When press F2 in that column then only its showing the correct value.
    If i do download directly from  ctrlshiftF7 , its down loading perfectly but my user Needs the Header of the ALV also, Buecause HEader Consists of Payment Date and all details.
    I have checked the same from the Satandard table also its also populating in the same way as in the report,
    So if any body have valueble suggestions, Please reply soon,
    Thanks & Regards,
    Raj S

    Hi Lalit,
             Thanks for Ur promt reply,
    I ahve alraedy Changed the lenght to 25 but it doesnot effect,
    But when i concatenate the same number with any one character in front of the A/C No. Its generating perfectly,
    But i cant do so as its an account No.
    Thanks,
    Raj S

  • Runtime Error during export ALV Grid to Local File and Print Priview

    Hi all,
             While Exporting ALV grid to local file using menu List->export->local file , I m getting following runtime error,
             Field Symbol has not yet been assigned.
    Details of Errors:
    Program : SAPLKKBL
    Include :   LKKBLF99
    Module Type : (FORM)
    module name : GEN_FIELD_OUT2
    So. pls Suggest any good solution.
    Thanks & Regards,
    Sandip Sonar.

    hi
    this is happening just because you might have declared that your ALV list should have a checkbox, but defined no field as "checkbox" into your internal table.
    and one more thing to check up is that before you call the REUSE_ALV_GRID_DISPLAY, you need to fill a few parameters for instance is_layout. This one has a field box_fieldname, in which you have to enter the name of the field of the internal table that will store the 'X' as and when the checkbox is checked.
    hope this helps
    regards
    Aakash Banga

  • User command for checkbox in alv grid output

    Hi,
    Does anyone knows the user command for checkbox in alv grid display. My requirement is to have a column for checkbox in alv output. When the user checks the checkbox, a pop-up dialog box will appear. This dialog box was created in screen painter. I can't find the user command for this. Please help.
    Thanks in advance.

    Hi,
    there r two ways for creating checkbox col on the ALV grid.
    1.)  take an extra field in your internal table i.e 
    data:
       checkbox type c.
    loop at internal_table into wa.
    checkbox.
    endloop.
    or
    the fieldcatalog attribute
    2.) wa_fcat-checkbox = 'X'.
    append wa_fcat to t_fcat.
    clear wa_fcat.
    if itab-checkbox = 'X'.
    call screen <dialogbox screen number>.
    endif.
    regards
    ravi

  • Alv grid to excel question

    Hello, I have a report with an selection screen with a few input parameters. This results in an alv grid being displayed. The users downloads the alv grid to excel. This works fine.
    I'd like to include the input parameters as the top row in the downloaded excel, on top of the result set. Is this possible? How do you do it?
    Best regards /Otto

    This data would have to be included in the ALV grid itself(assuming that you are using the standard excel functionality embedded into the ALV grid). 
    There are others ways to get around this.  You could add a new button to the applicatoin toolbar, where then you would handle the building of the excel file in your custom code.
    REgards,
    Rich Heilman

  • ALV grid to excel (.XLS) format issue

    im trying to export an ALV grid to excel file using FM 'GUI_DOWNLOAD'.
    the output  is located at the link  below:
    http://img393.imageshack.us/my.php?image=excelproblemjt4.jpg
    some how the fields arent inside the individual boxes..
    can anyone provide me with the solution? thanks
    below are the codes of how i implement the 'GUI DOWNLOAD' FM
    CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          filename   = lv_file        " C:\filename.xls
          write_field_separator = 'X'
        IMPORTING
          filelength = lv_size
        TABLES
          data_tab   = ltt_data

    REPORT  test0012                                                  .
    INCLUDE test_top.
    INCLUDE test_f01.
    INCLUDE test_alv.
          START OF SELECTION
    START-OF-SELECTION.
      PERFORM get_data.
      PERFORM process_data.
    END-OF-SELECTION.
      IF tt_output IS NOT INITIAL.
        PERFORM prepare_excel_data.
    Download CSV file to local
        IF c_loc = 'X'.
         PERFORM convert_to_xls.
          PERFORM download_local.
        ENDIF.
      ELSE.
    Show Message when no records selected
       MESSAGE I016 WITH TEXT-005.
      ENDIF.
      PERFORM f_alv_disp.
    *&  Include           test_TOP                                   *
    TABLES: vbrk, vbrp, vbak, vbap, kna1.
    DATA: total_value TYPE p DECIMALS 2 LENGTH 15.
    DATA: total TYPE c LENGTH 5 VALUE 'total'.
    TYPE-POOLS
    TYPE-POOLS: slis, truxs.
    -ALV----
    DATA:
      wa_alv_layout       TYPE slis_layout_alv,
      tt_alv_fieldcat     TYPE slis_t_fieldcat_alv WITH HEADER LINE,
    tt_alv_sort         TYPE slis_t_sortinfo_alv WITH HEADER LINE,
      tt_alv_events       TYPE slis_t_event WITH HEADER LINE,
      wa_sort             TYPE slis_sortinfo_alv,
      tt_sort             TYPE slis_t_sortinfo_alv,
      v_pagno             TYPE sy-pagno,
      s_keyinfo           TYPE slis_keyinfo_alv.
    TYPES
    TYPES: BEGIN OF vbrk,
            vbeln TYPE vbrk-vbeln,
            fkdat TYPE vbrk-fkdat,
            vkorg TYPE vbrk-vkorg,
            vtweg TYPE vbrk-vtweg,
            spart TYPE vbrk-spart,
            kunag TYPE vbrk-kunag,
           END OF vbrk,
           BEGIN OF vbrp,
            vbeln TYPE vbrp-vbeln,
            aubel TYPE vbrp-aubel,
            vgbel TYPE vbrp-vgbel,
            aupos TYPE vbrp-aupos,
           END OF vbrp,
           BEGIN OF vbak,
            vbeln TYPE vbak-vbeln,
            auart TYPE vbak-auart,
            bstnk TYPE vbak-bstnk,
           END OF vbak,
           BEGIN OF vbap,
            vbeln TYPE vbap-vbeln,
            posnr TYPE vbap-posnr,
            netwr TYPE vbap-netwr,
            mwsbp TYPE vbap-mwsbp,
           END OF vbap,
           BEGIN OF kna1,
            kunnr TYPE kna1-kunnr,
            name1 TYPE kna1-name1,
           END OF kna1,
           BEGIN OF output,
            fkdat TYPE vbrk-fkdat,
            vkorg TYPE vbrk-vkorg,
            vtweg TYPE vbrk-vtweg,
            spart TYPE vbrk-spart,
            kunag TYPE vbrk-kunag,
            name1 TYPE kna1-name1,
            auart TYPE vbak-auart,
            bstnk TYPE vbak-bstnk,
            aubel TYPE vbrp-aubel,
            vgbel TYPE vbrp-vgbel,
            total LIKE total_value,
           END OF output.
    Type for download to excel use.
    TYPES: BEGIN OF ty_excel,
             col1(20), sp01,
             col2(25), sp02,
             col3(23), sp03,
             col4(14), sp04,
             col5(15), sp05,
             col6(23), sp06,
             col7(13), sp07,
             col8(25), sp08,
             col9(20), sp09,
             col10(30), sp10,
             col11(13),
           END OF ty_excel.
    DATA: wa_vbrk TYPE vbrk,
          wa_vbrp TYPE vbrp,
          wa_vbak TYPE vbak,
          wa_vbap TYPE vbap,
          wa_kna1 TYPE kna1,
          wa_output TYPE output,
          tt_vbrk TYPE STANDARD TABLE OF vbrk,
          tt_vbrp TYPE STANDARD TABLE OF vbrp,
          tt_vbak TYPE STANDARD TABLE OF vbak,
          tt_vbap TYPE STANDARD TABLE OF vbap,
          tt_kna1 TYPE STANDARD TABLE OF kna1,
          tt_output TYPE STANDARD TABLE OF output.
    Table for download to excel use.
    DATA: tt_excel TYPE STANDARD TABLE OF ty_excel,
          wa_excel LIKE LINE OF tt_excel,
          tt_excel_output  TYPE truxs_t_text_data.
         wa_excel type ty_excel.
    Data Declaration for CSV file use
    CONSTANTS : c_comma TYPE c VALUE ','.
    Selection-Screen
    SELECTION-SCREEN BEGIN OF BLOCK b01 WITH FRAME TITLE text-b01.
    SELECT-OPTIONS:  s_fkdat FOR vbrk-fkdat OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK b01.
    SELECTION-SCREEN BEGIN OF BLOCK b02 WITH FRAME TITLE text-b02.
    PARAMETERS:      p_vkorg TYPE vbrk-vkorg OBLIGATORY.
    SELECT-OPTIONS:  s_vtweg FOR vbrk-vtweg,
                     s_spart FOR vbrk-spart.
    SELECTION-SCREEN END OF BLOCK b02.
    SELECTION-SCREEN BEGIN OF BLOCK b03 WITH FRAME TITLE text-b03.
    SELECT-OPTIONS:  s_kunag FOR vbrk-kunag.
    SELECTION-SCREEN END OF BLOCK b03.
    SELECTION-SCREEN BEGIN OF BLOCK b04 WITH FRAME TITLE text-b04.
    PARAMETERS:      c_loc AS CHECKBOX,
                     p_file LIKE rlgrap-filename DEFAULT 'C:\filename.txt'.
    SELECTION-SCREEN END OF BLOCK b04.
    *&  Include           test_F01                                   *
    FORM get_data
    FORM get_data.
      DATA: lt_vbrk TYPE STANDARD TABLE OF vbrk,
            lt_vbrp TYPE STANDARD TABLE OF vbrp.
      SELECT vbeln fkdat vkorg vtweg spart kunag
      FROM vbrk
      INTO TABLE tt_vbrk
      WHERE fkdat IN s_fkdat
      AND   vkorg = p_vkorg
      AND   vtweg IN s_vtweg
      AND   spart IN s_spart
      AND   kunag IN s_kunag.
      lt_vbrk[] = tt_vbrk[].
      SORT lt_vbrk BY vbeln.
      IF lt_vbrk[] IS NOT INITIAL.
        SELECT vbeln aubel vgbel aupos
        FROM vbrp
        INTO TABLE tt_vbrp
        FOR ALL ENTRIES IN lt_vbrk
        WHERE vbeln = lt_vbrk-vbeln.
      ENDIF.
      lt_vbrp[] = tt_vbrp[].
      SORT lt_vbrp BY aubel.
      IF lt_vbrp[] IS NOT INITIAL.
        SELECT vbeln auart bstnk
        FROM vbak
        INTO TABLE tt_vbak
        FOR ALL ENTRIES IN lt_vbrp
        WHERE vbeln = lt_vbrp-aubel.
      ENDIF.
      lt_vbrp[] = tt_vbrp[].
      SORT lt_vbrp BY aubel aupos.
      IF lt_vbrp[] IS NOT INITIAL.
        SELECT vbeln posnr netwr mwsbp
        FROM vbap
        INTO TABLE tt_vbap
        FOR ALL ENTRIES IN lt_vbrp
        WHERE vbeln = lt_vbrp-aubel
        AND posnr = lt_vbrp-aupos.
      ENDIF.
      lt_vbrk[] = tt_vbrk[].
      SORT lt_vbrk BY kunag.
      IF lt_vbrk[] IS NOT INITIAL.
        SELECT kunnr name1
        FROM kna1
        INTO TABLE tt_kna1
        FOR ALL ENTRIES IN lt_vbrk
        WHERE kunnr = lt_vbrk-kunag.
      ENDIF.
    ENDFORM.                    "get_data
    *&      Form  process_data
    FORM process_data.
      LOOP AT tt_vbrk INTO wa_vbrk.
        wa_output-fkdat = wa_vbrk-fkdat.
        wa_output-vkorg = wa_vbrk-vkorg.
        wa_output-vtweg = wa_vbrk-vtweg.
        wa_output-spart = wa_vbrk-spart.
        wa_output-kunag = wa_vbrk-kunag.
    read table tt_vbrp into wa_vbrp with key vbeln = wa_vbrk-vbeln.
    if sy-subrc = 0.
       wa_output-aubel = wa_vbrp-aubel.
       wa_output-vgbel = wa_vbrp-vgbel.
    endif.
        READ TABLE tt_kna1 INTO wa_kna1 WITH KEY kunnr = wa_vbrk-kunag BINARY SEARCH.
        IF sy-subrc = 0.
          wa_output-name1 = wa_kna1-name1.
        ENDIF.
        LOOP AT tt_vbrp INTO wa_vbrp WHERE vbeln = wa_vbrk-vbeln.
          wa_output-aubel = wa_vbrp-aubel.
          wa_output-vgbel = wa_vbrp-vgbel.
          READ TABLE tt_vbak INTO wa_vbak WITH KEY vbeln = wa_vbrp-aubel BINARY SEARCH.
          IF sy-subrc = 0.
            wa_output-auart = wa_vbak-auart.
            wa_output-bstnk = wa_vbak-bstnk.
          ENDIF.
          READ TABLE tt_vbap INTO wa_vbap  WITH KEY vbeln = wa_vbrp-aubel
                                                    posnr = wa_vbrp-aupos BINARY SEARCH.
          wa_output-total = wa_vbap-netwr + wa_vbap-mwsbp.
          APPEND wa_output TO tt_output.
        ENDLOOP. "endloop tt_vbrp
      wa_output-total = wa_vbap-netwr + wa_vbap-mwsbp.
    append wa_output to tt_output.
        CLEAR wa_output.
      ENDLOOP.  "endloop vbrk
    ENDFORM.                    "process_data
    *&      Form  APPEND_EXCEL
    FORM append_excel .
      wa_excel-sp01 = wa_excel-sp02 = wa_excel-sp03 =
      wa_excel-sp04 = wa_excel-sp05 = wa_excel-sp06 =
      wa_excel-sp07 = wa_excel-sp08 = wa_excel-sp09 =
      wa_excel-sp10.
      APPEND wa_excel TO tt_excel. CLEAR wa_excel.
    ENDFORM.                    " APPEND_EXCEL
    *&      Form  PREPARE_EXCEL_DATA
    FORM prepare_excel_data .
    List's Header for excel file
      WRITE  'Billing Date'                TO wa_excel-col1.
      WRITE  'Sales Organization'          TO wa_excel-col2.
      WRITE  'Distribution Channel'        TO wa_excel-col3.
      WRITE  'Division'                    TO wa_excel-col4.
      WRITE  'Sold-to Party'               TO wa_excel-col5.
      WRITE  'Name of Sold-to Party'       TO wa_excel-col6.
      WRITE  'Order Type'                  TO wa_excel-col7.
      WRITE  'Customer PO Number'          TO wa_excel-col8.
      WRITE  'Sales Order Number'          TO wa_excel-col9.
      WRITE  'Delivery Order Number'       TO wa_excel-col10.
      WRITE  'Total Value'                 TO wa_excel-col11.
      PERFORM append_excel.
    Item data for excel file.
      LOOP AT tt_output INTO wa_output.
        WRITE  wa_output-fkdat  TO wa_excel-col1.
        WRITE  wa_output-vkorg  TO wa_excel-col2.
        WRITE  wa_output-vtweg  TO wa_excel-col3.
        WRITE  wa_output-spart  TO wa_excel-col4.
        WRITE  wa_output-kunag  TO wa_excel-col5.
        WRITE  wa_output-name1  TO wa_excel-col6.
        WRITE  wa_output-auart  TO wa_excel-col7.
        WRITE  wa_output-bstnk  TO wa_excel-col8.
        WRITE  wa_output-aubel  TO wa_excel-col9.
        WRITE  wa_output-vgbel  TO wa_excel-col10.
        WRITE  wa_output-total TO wa_excel-col11.
        PERFORM append_excel.
      ENDLOOP.
    List's Header for excel file
    CONCATENATE '"' 'Billing Date'           '"'     INTO WA_EXCEL-COL1.
    CONCATENATE '"' 'Sales Organization'     '"'     INTO WA_EXCEL-COL2.
    CONCATENATE '"' 'Distribution Channel'   '"'     INTO WA_EXCEL-COL3.
    CONCATENATE '"' 'Division'               '"'     INTO WA_EXCEL-COL4.
    CONCATENATE '"' 'Sold-to Party'          '"'     INTO WA_EXCEL-COL5.
    CONCATENATE '"' 'Name of Sold-to Party'  '"'     INTO WA_EXCEL-COL6.
    CONCATENATE '"' 'Order Type'             '"'      INTO WA_EXCEL-COL7.
    CONCATENATE '"' 'Customer PO Number'     '"'     INTO WA_EXCEL-COL8.
    CONCATENATE '"' 'Sales Order Number'     '"'     INTO WA_EXCEL-COL9.
    CONCATENATE '"' 'Delivery Order Number'  '"'     INTO WA_EXCEL-COL10.
    CONCATENATE '"' 'Total Value'            '"'     INTO WA_EXCEL-COL11.
    PERFORM APPEND_EXCEL.
    Item data for excel file.
    LOOP AT TT_output INTO WA_output.
       CONCATENATE '"' WA_OUTPUT-FKDAT '"' INTO WA_EXCEL-COL1.
       CONCATENATE '"' WA_OUTPUT-VKORG '"' INTO WA_EXCEL-COL2.
       CONCATENATE '"' WA_OUTPUT-VTWEG '"' INTO WA_EXCEL-COL3.
       CONCATENATE '"' WA_OUTPUT-SPART '"' INTO WA_EXCEL-COL4.
       CONCATENATE '"' WA_OUTPUT-KUNAG '"' INTO WA_EXCEL-COL5.
       CONCATENATE '"' WA_OUTPUT-NAME1 '"' INTO WA_EXCEL-COL6.
       CONCATENATE '"' WA_OUTPUT-AUART '"' INTO WA_EXCEL-COL7.
       CONCATENATE '"' WA_OUTPUT-BSTNK '"' INTO WA_EXCEL-COL8.
       CONCATENATE '"' WA_OUTPUT-AUBEL '"' INTO WA_EXCEL-COL9.
       CONCATENATE '"' WA_OUTPUT-VGBEL '"' INTO WA_EXCEL-COL10.
       CONCATENATE '"' total '"' INTO WA_EXCEL-COL11.
       PERFORM APPEND_EXCEL.
    ENDLOOP.
    ENDFORM.                    " PREPARE_EXCEL_DATA
    *&      Form  Convert_to_xls
    *form Convert_to_xls.
    LOOP AT TT_EXCEL INTO WA_EXCEL.
       MOVE WA_EXCEL TO LTT_DATA-TEXT.
       APPEND LTT_DATA. CLEAR LTT_DATA.
    ENDLOOP.
    LV_FILE = P_FILE.
    CALL FUNCTION 'SAP_CONVERT_TO_XLS_FORMAT'
    EXPORTING
       I_FIELD_SEPERATOR          = ';'
      I_LINE_HEADER              =
       i_filename                 = lv_file
      I_APPL_KEEP                = ' '
    tables
       i_tab_sap_data             = LTT_DATA
    CHANGING
      I_TAB_CONVERTED_DATA       = tt_excel_output
    EXCEPTIONS
      CONVERSION_FAILED          = 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.
    *endform.
    *&      Form  DOWNLOAD_LOCAL
    FORM download_local .
      TYPES:
          BEGIN OF lty_data,
            text(800),
          END OF lty_data.
      DATA:
        lv_file  TYPE string,
        lv_size  TYPE i,
        lv_msg   TYPE bapi_msg,
        ltt_data TYPE STANDARD TABLE OF lty_data WITH HEADER LINE.
      LOOP AT tt_excel INTO wa_excel.
        MOVE wa_excel TO ltt_data-text.
        APPEND ltt_data. CLEAR ltt_data.
      ENDLOOP.
      lv_file = p_file.
    CONCATENATE LV_FILE 'file.csv' INTO LV_FILE.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          filename   = lv_file
          write_field_separator = 'X'
          FILETYPE   = 'ASC'
        IMPORTING
          filelength = lv_size
        TABLES
          data_tab   = ltt_data
        EXCEPTIONS
          OTHERS     = 1.
      IF sy-subrc EQ 0.
        "File &1 downloaded successfully - &2 bytes transferred
        MESSAGE e419(3e) WITH lv_file lv_size INTO lv_msg.      "#EC *
      ELSE.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4 INTO lv_msg.
      ENDIF.
    WRITE LV_MSG.
    ENDFORM.                    " DOWNLOAD_LOCAL
    *ENDIF.
    *&  Include          test_ALV                                   *
    FORM build_layout .
    wa_alv_layout-zebra           = 'X'.
      wa_alv_layout-colwidth_optimize = 'X'.
      wa_alv_layout-window_titlebar = sy-title.
    ENDFORM.                    " build_layout
    *&      Form  f_build_event
          text
    -->  p1        text
    <--  p2        text
    FORM f_build_event .
      REFRESH tt_alv_events.
      tt_alv_events-name = slis_ev_top_of_page.
      tt_alv_events-form = slis_ev_top_of_page.
      APPEND tt_alv_events.
      CLEAR tt_alv_events.
      tt_alv_events-name = slis_ev_top_of_list.
      tt_alv_events-form = slis_ev_top_of_list.
      APPEND tt_alv_events.
      CLEAR tt_alv_events.
    ENDFORM.                    " f_build_event
    *&      Form  f_alv_disp
          text
    -->  p1        text
    <--  p2        text
    FORM f_alv_disp.
      DATA lv_repid TYPE sy-repid.
      REFRESH: tt_alv_fieldcat, tt_alv_events.
      PERFORM build_layout.
      PERFORM f_build_event.
      lv_repid = sy-repid.
      PERFORM f_build_fieldcat_summary.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program = lv_repid
          is_layout          = wa_alv_layout
          it_fieldcat        = tt_alv_fieldcat[]
          I_GRID_TITLE       = 'Billing Due List Report'
         it_sort           = tt_sort
           i_save          = 'A'
         it_events          = tt_alv_events[]
        TABLES
          t_outtab           = tt_output
        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.
    ENDFORM.                    " f_alv_disp
    *&      Form  f_build_fieldcat_SUMMARY
          text
    -->  p1        text
    <--  p2        text
    FORM f_build_fieldcat_summary .
    do_sum    no_out    outputlen
      PERFORM f_fieldcat USING:
      'tt_output'  'FKDAT'      text-c01    ' '       ' '       '10' ,
      'tt_output'  'VKORG'      text-c02    ' '       ' '       '10',
      'tt_output'  'VTWEG'      text-c03    ' '       ' '       '10' ,
      'tt_output'  'SPART'      text-c04    ' '       ' '       '10'  ,
      'tt_output'  'KUNAG'      text-c05    ' '       ' '       '10' ,
      'tt_output'  'NAME1'      text-c06    ' '       ' '       '10' ,
      'tt_output'  'AUART'      text-c07    ' '       ' '       '10' ,
      'tt_output'  'BSTNK'      text-c08    ' '       ' '       '10'  ,
      'tt_output'  'AUBEL'      text-c09    ' '       ' '       '10' ,
      'tt_output'  'VGBEL'      text-c10    ' '       ' '       '10' ,
      'tt_output'  'TOTAL'      text-c11    ' '       ' '       '15' .
    ENDFORM.                    "
    *&      Form  f_fieldcat
    FORM f_fieldcat  USING pv_a TYPE any
                           pv_b TYPE any
                           pv_c TYPE any
                           pv_d TYPE any
                           pv_e TYPE any
                           pv_f TYPE any.
      tt_alv_fieldcat-tabname      = pv_a.
      tt_alv_fieldcat-fieldname    = pv_b.
      tt_alv_fieldcat-reptext_ddic = pv_c.
      tt_alv_fieldcat-do_sum       = pv_d.
      tt_alv_fieldcat-no_out       = pv_e.
      tt_alv_fieldcat-outputlen    = pv_f.
      APPEND tt_alv_fieldcat.
      CLEAR tt_alv_fieldcat.
    ENDFORM.                    " f_fieldcat

  • ALV Grid to Excel Problem

    Hi Folks,
    I have developed a report using ALV GRID for an user. However when he tries to export it to excel my field LIFNR (vendor no.) its 1 character short.
    For example:
    ALV GRID VIEW:
    103190325          2000004610          37,900.00
    EXCEL File:
    10319032          2000004610          37,900.00
    This is pretty strange for me, never had this problem before. Can anyone help me with this problem.
    Thanks in advance for your help.
    Regards,
    Gilberto Li
    Edited by: Gilberto Li on Nov 6, 2008 4:28 PM

    Hi Naimesh,
    Thanks for your reply.
    Yes I have checked the output length for the field. Right now I have it on 12 just in case, but LIFNR is a 10 character field, and I am still having this problem.
    When I hit the button for a preview on the grid it shows like this:
    10319032...   2000004610               37,900.00
    Strangely, don't know why this last digit is getting cutted.
    Thanks again.
    Regards,
    Gilberto Li

  • Problem in exporting ALV Report to excel sheet

    Hi All,
    I have developed a Report and now facing problem in exporting the same to excel sheet.
    When we click the "Locate File" icon in the report layout, the system will pop up a window with radio buttons. I have opted for 'Spreadsheet'.
    When i save the excel sheet into my desktop, the excel file has all the report headers (Title of each column). But no value is exported.
    There are around 15 columns in the report and the excel sheet shows value of last 2 columns which has some text.
    I have been into ALV report development and developed around 30+ reports in the same fashion.
    What might be the reason behind this issue?
    When i export other reports into excel sheet, everything is perfect without any flaws......
    Kindly help me out......
    Regards
    Pavan

    Hi,
    Here's my suggestion: Install OpenOffice.org and ask SAP to deliver good integration with OpenOffice.org.
    Alternative suggestion: re-install SAP Gui on the PC where the integration is not working. If that does not help, re-install Microsoft Office as well.
    Here's my comment: I think you should ask this question in a different forum, e.g. in the Duet forum. That may not be the correct forum either, but as it is a Microsoft/SAP integration technology forum, someone there may know the solution.
    Regards,
    Raj.

  • Problem in placing the background in ALV Grid display

    I have created one image of the business flow, and it have to be displayed in the background of ALV grid display.
    For this I have gone to T.Code –<b>OAER</b> , Given class name as <b>PICTURES</b> , Class type as <b>OT</b> , Object Key <b>BACKGROUND</b>, clicked on the triangle of Standard Doc , then double click on screen, and finally uploaded the background into SAP.
    In the function module <b>‘REUSE_ALV_GRID_DISPLAY’</b> I passed this background to the parameter I_BACKGROUND_ID.
    It is working fine, and I was able to see the back ground in my program.
    (developed in IDES)
    But the same is not working in my development client, will some one suggest be the reason for the problem. Please kindly help me out from this problem.

    hello Dinesh,
    I have created the object key in the development client itself and used in the grid display of the same client. i am not understanding where the problem is, any how thank you very much for your responce. if you have any other solution please let me know.
    Thank you

  • Problem when printing icons of an ALV grid

    I made an Alv grid report that has some icons.When i printed i don't see the icons but isee some characters ...
    What can i do ?
    Thanks a lot ....

    hi good
    if you take the print out of a alv grid report it wont show you the icon pictures in your paper,it wll show you the respective characters for those icons,
    Thanks
    mrutyun^

  • Problem in format of quantity in alv grid

    Hi All,
    In edittable alv grid,I have a quantity field which has been specified ad type p in program code.
    In table i have taken the data type as dec with 4 decimals.
    when i put value in edittable grid as 255.It changes it to .0255
    Also if i take value as 2.58,it gives error and it changes it to .0258
    Please help me to solve my query.
    Thanks and Regards,
    Aman

    Hi,
    clear afield.
      afield-fieldname = 'VERME'.
      afield-ref_tabname = 'LQUA'.
      *afield-qfieldname = 'MEINS'.*
      append afield to xfield.
    Try this !!
    Edited by: Raj on May 6, 2008 6:15 PM

  • Problem in GET_CURRENT_CELL method in oops ALV GRID

    Hi,
      I got output records int eh ALV GRID and i have a one push button in the report. When i select any CELL(say 5 row) in ALV GRID and click on this push Button, it should display me the Row number (row number = 5). I have used the GET_CURRENT_CELL. when I execute the report and select one cell (5 row cell )and click on push button, it is giving me the Row number(row number =  5) correctly. Again when i choose the cell (say 8 record)second time, it should display give the row number = 8 but always it is giving me the First row number .
    Get selected row
      PERFORM get_selected_row CHANGING l_sel_row.
    FORM get_selected_row  CHANGING p_l_sel_row.
      DATA: li_sel_row TYPE i,             "Selected row
            lv_rowid   TYPE lvc_s_row.
    Query which row was selected.
      CALL METHOD grid_brr_main->get_current_cell
        IMPORTING
          e_row     = li_sel_row
          es_row_id = lv_rowid.
      MOVE lv_rowid-index TO p_l_sel_row.
    ENDFORM.                    " get_selected_row
    Regards,
    Deepthi.

    Hi,
    Probably the data is not getting refreshed.
    Please call the following methods.
    REFRESH_TABLE_DISPLAY in PBO.
    Call this method only if the grid has been created and called once using SET_TABLE_FOR_FIRST_DISPLAY.
    As follows:-
    If grid is initial.
    call method grid-set_table_for_first_display
    else
    call method grid->REFRESH_TABLE_DISPLAY.
    endif.
    In the PAI.
    call the following method.
    grid->CHECK_CHANGED_DATA
    So that the data changes are transferred.
    Regards,
    Ankur Parab
    Edited by: Ankur Parab on Jun 4, 2009 5:18 PM

Maybe you are looking for

  • Hiding fields in a form

    hiding fields in a Form is called what? How do I go about hiding fields in a form than having a button the user can click on to make the fields visible to fill out?  Thanks  Nick

  • How to setup sent items for IMAP in Apple Mail

    I am changing my aple mail email account to an IMAP account from a POP3. When I do this I lose my sent items. I was able to import my sent items back in, but when I try send a mail it does not register in my sent items. It shows that I did not send a

  • Need  help in Credit memo IDOC !

    I am trying to create a idoc when the credit memo is generated ! How to create it !

  • I was trying to download the movie Mighty Joe Young, but I got the music of Mighty Joe Young.

    I was downloading the movie, Mighty Joe Young not the music to Mighty Joe Young. I was trying to download it to my computer. I don't want to pay for anything I didn't order.

  • Dynamic Item Creation

    Hi, Can i create more than 50 items dynamically in a page. I tried creating but it is not working. In one of my application page i have more than 10 regions, each region has 6-7 dynamic items. Any work-around?? Regards, Som