Delete blank lines when downloading to excel from CL_GUI_ALV_TREE

Hi Experts
I have developed a report using the class CL_GUI_ALV_TREE. If the user wants to download it into local machine in the excel format, he is going to the print preview and downloadn through Syste --> LIst --> Save --> Local File.
But in the excel file there are few blank lines after each node. Now my client wants to excluding of those blank lines while downloading the file into excel. Is there any method to achieve this.
Please advice me if there is any solution.
Thanks in advance
Praveen

Hi Praveen,
We cannot do any thing if the user download the file by that selection,
Disable the download option from the toolbar and you provide a download button on the toolbar. as the user clicks the button the delete the black entries from the table and download it using  CL_GUI_FRONTEND_SERVICES.
Regards,
Kumar M.

Similar Messages

  • NO header detail appears when downloading to excel from web template

    When we run our queries via a web template and through the portal we get the results which shows the query title and report details. When we try to download this to excel the header(report title etc. )information doesn't come down but all the rest of the report does. If we go in again and change the variable values for characteristics (query is being changed and run the web template (via portal)again and download to excel the header (report title etc.)the whole report title and report detail now appear. Looking for someone who has resolved this problem.

    For anyone who is interested, this was caused by our email client, not BIP.

  • Short Dump when downloading to EXCEL from ALV

    Hi,
    I have an ALV grid display program. The data in the grid is displayed correctly. But when trying to download the data to excel it gives a short dump.
    Assignment error: Overwriting a protected field.
    What happened?
    Error in ABAP application program.
    The current ABAP program "SAPLKKBL" had to be terminated because one of the
    statements could not be executed.
    This is probably due to an error in the ABAP program.
    Some times it allows to download the data, but sometimes it gives short dump.
    Thanks,
    Deepthi

    This is my part of the code:
      i_fieldcat-key     = gc_x.
      i_fieldcat-no_zero = gc_x.
      i_fieldcat-fix_column  = 'X'.
      i_fieldcat-hotspot = gc_x.
      perform bild_fieldcat using
        '' 'AUFNR' 'GT_REPORT ' ' '  'CAUFV'  ' '  'C' '12' ' '.
      perform bild_fieldcat using
        '' 'DISGR' 'GT_REPORT ' ' '  'MARC' ' '  'C' '4' ' '.
      perform bild_fieldcat using
        '' 'AUART' 'GT_REPORT ' ' '  'CAUFV' ' '  'C' '04' ' '.
      perform bild_fieldcat using
        '' 'DISPO' 'GT_REPORT ' ' '  'CAUFV' ' ' 'C' '06' ' '.
      i_fieldcat-no_zero = gc_x.
      perform bild_fieldcat using
        '' 'MATNR' 'GT_REPORT ' ' '  'MARA' ' '  'C' '18' ' '.
      i_fieldcat-no_zero = gc_x.
      perform bild_fieldcat using
        '' 'CHARG' 'GT_REPORT ' ' '  'MDFA' ' ' 'C' '14' ' ' .
    *begin insert RCHALASA
      i_fieldcat-no_zero = gc_x.
      i_fieldcat-fix_column  = 'X'.
      perform bild_fieldcat using
        '' 'FTRMI' 'GT_REPORT ' ' '  'CAUFV' ' ' 'D' '08' ' '.
    *end insert
      i_fieldcat-no_zero = gc_x.
      i_fieldcat-fix_column  = 'X'.
      perform bild_fieldcat using
        '' 'GLTRP' 'GT_REPORT ' ' '  'CAUFV'  ' '  'D' '10' ' '.
      i_fieldcat-no_zero = gc_x.
      perform bild_fieldcat using
        '' 'GLTRS' 'GT_REPORT' ' '  'CAUFV' ' ' 'D' '10' ' '.
      perform bild_fieldcat using
        '' 'GSTRP' 'GT_REPORT' ' '  'CAUFV' ' '  'D' '10' ' '.
      perform bild_fieldcat using
        '' 'AGE' 'GT_REPORT' ' '  ' ' 'Age'  'C' '08' ' '.
      i_fieldcat-no_zero = gc_x.
    i_fieldcat-do_sum  = gc_x.
      i_fieldcat-fix_column  = 'X'.
      perform assign_alv_qty_format.
      perform bild_fieldcat using
        '' 'GAMNG' 'GT_REPORT' ' '  ' '  'Order Qty'  'QUAN' '09' ' '.
      perform bild_fieldcat using
        '' 'STK_PROD_FLAG' 'GT_REPORT' ' '   ' '  'Stk/Prod'  'C' '06' ' '.
      i_fieldcat-no_zero = gc_x.
    i_fieldcat-do_sum  = gc_x.
      i_fieldcat-fix_column  = 'X'.
      perform assign_alv_qty_format.
      perform bild_fieldcat using
        '' 'IGMNG' 'GT_REPORT' ' '  ' ' 'Order Yield Qty' 'QUAN' '11' ' '.
      i_fieldcat-no_zero = gc_x.
    i_fieldcat-do_sum  = gc_x.
      i_fieldcat-fix_column  = 'X'.
      perform assign_alv_qty_format.
      perform bild_fieldcat using
        '' 'IASMG' 'GT_REPORT' ' ' ' ' 'Order Scrap Qty'  'QUAN' '11' ' '.
    **begin insert RCHALASA
      perform bild_fieldcat using
         '' 'YIELD_PER' 'GT_REPORT' ' ' ' ' 'Yield'  'C' '05' ' '.
    **end insert
    DATA: col_pos like sy-colno.
    col_pos = '17'.
      loop at gt_oper.
        gv_tabix = sy-tabix.
        i_fieldcat-no_zero = gc_x.
        i_fieldcat-do_sum  = gc_x.
        i_fieldcat-fix_column  = 'X'.
       col_pos = col_pos + 1.
        perform assign_alv_qty_format.
        gv_yield6(03) = gt_oper-vornr1(03).
    *begin insert RCHALASA
        move gt_oper-ltxa1 to gv_text.
      translate gv_text to upper case.
    gv_text = gv_yield.
    *end insert
        gv_tabixn = gv_tabix.
        gv_yield+6(03) = gv_tabixn.
        gv_fieldname = gv_yield.
        translate gv_fieldname to upper case.
        perform bild_fieldcat using
         '' gv_fieldname 'GT_REPORT' ' ' ' ' gv_text  'QUAN' '04' ' '.
       perform assign_alv_qty_format.
      gv_scrap6(03) = gt_oper-vornr1(03).
      select single
             grdtx
             from trugt
             into gv_text1
             where
             grund = gt_oper-vornr
             and werks in s_werks.
       gv_text = gv_scrap.
       i_fieldcat-no_zero = gc_x.
       gv_tabixn = gv_tabix.
      gv_scrap+6(03) = gv_tabixn.
       gv_fieldname = gv_scrap.
       translate gv_fieldname to upper case.
       perform bild_fieldcat using
         gv_fieldname 'GT_REPORT' ' ' gv_text1 'X' 'QUAN' '08' ' '.
       clear gv_text1.
      endloop.  " GT_OPER
      DATA: count type c.
      DESCRIBE table gt_grund lines count.
      loop at gt_grund into gl_grund.
        gv_tabix = sy-tabix.
        i_fieldcat-no_zero = gc_x.
        i_fieldcat-do_sum  = gc_x.
        i_fieldcat-fix_column  = 'X'.
        perform assign_alv_qty_format.
        if gl_grund-grund is initial.
          gl_grund = 'NONE'.
          gv_text = gl_grund.
        else.
           gv_text = gl_grund-grdtx.
        endif.
        gv_tabixn = gv_tabix.
        gv_scrap_code+11(03) = gv_tabixn.
        gv_fieldname = gv_scrap_code.
        translate gv_fieldname to upper case.
       col_pos = col_pos + 1.
        perform bild_fieldcat using
          '' gv_fieldname 'GT_REPORT' 'XMNGA' 'AFRU'  gv_text  'QUAN' '12' ' ' .
      endloop.  " GT_OPER
      gb_layout-zebra = 'X'.
      gb_print-no_print_listinfos = 'X'.
      gb_variant-variant = p_varia.
      perform create_events using gt_events[].
      call function 'SAPGUI_PROGRESS_INDICATOR'
        EXPORTING
          text = 'Reading SAP Records.......'(600).
      call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_callback_program       = gv_repid
                i_callback_top_of_page   = 'TOP_OF_PAGE'
               i_callback_pf_status_set = 'SET_STATUS'
                i_callback_user_command  = 'CALL_UP_SAP_TRANS'
                it_fieldcat              = i_fieldcat[]
                is_layout                = gb_layout
                i_grid_title             = gb_title
                i_default                = 'X'
                i_save                   = 'X'
                is_variant               = gb_variant
                is_print                 = gb_print
                it_events                = gt_events[]
           tables
                t_outtab                 = gt_report
           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.
    ***********ALV SUBROUTINE**************
    TYPE-POOLS: slis.
    DATA: gv_repid            LIKE sy-repid.
    DATA: i_fieldcat          TYPE slis_t_fieldcat_alv WITH HEADER LINE.
    DATA: gb_layout           TYPE slis_layout_alv.
    DATA: gb_selfield         TYPE slis_selfield.
    DATA: gb_print            TYPE slis_print_alv.
    DATA: i_sort              TYPE  slis_t_sortinfo_alv WITH HEADER LINE.
    DATA: gv_keyinfo          TYPE SLIS_KEYINFO_ALV.
    DATA: gb_variant          LIKE disvariant,
          gb_def_variant      LIKE disvariant.
    DATA: gb_title(70).
    DATA: gt_events           TYPE slis_t_event,
          gt_sort             TYPE SLIS_T_SORTINFO_ALV,
          gt_list_top_of_page TYPE slis_t_listheader,
          g_status_set        TYPE slis_formname VALUE 'PF_STATUS_SET',
          g_user_command      TYPE slis_formname VALUE 'USER_COMMAND',
          g_top_of_page       TYPE slis_formname VALUE 'TOP_OF_PAGE',
          g_end_of_page       TYPE slis_formname VALUE 'END_OF_PAGE',
          g_top_of_list       TYPE slis_formname VALUE 'TOP_OF_LIST',
          g_end_of_list       TYPE slis_formname VALUE 'END_OF_LIST'.
    DATA: it_event_exit TYPE slis_t_event_exit WITH HEADER LINE.
    *--- Rotinas ---
    FORM alv_init.
      CLEAR: gb_variant.
      gv_repid = sy-repid.
      gb_variant-report = gv_repid.
      CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
           EXPORTING
                i_save     = 'A'
           CHANGING
                cs_variant = gb_variant
           EXCEPTIONS
                not_found  = 2.
      IF sy-subrc = 0.
        p_varia = gb_variant-variant.
      ENDIF.
    ENDFORM.                    " ALV_INIT
    FORM alv_f4.
      gb_variant-report = gv_repid.
      CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
           EXPORTING
                is_variant = gb_variant
                i_save     = 'A'
           IMPORTING
                es_variant = gb_variant
           EXCEPTIONS
                not_found  = 2.
      IF sy-subrc = 2.
        MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ELSE.
        p_varia = gb_variant-variant.
      ENDIF.
    ENDFORM.                                                    " ALV_F4
    FORM bild_fieldcat USING x_pos x_field x_tab x_reffld x_ref x_text x_type x_tam x_sym.
      i_fieldcat-col_pos       = x_pos.
      i_fieldcat-fieldname     = x_field.
      i_fieldcat-tabname       = x_tab.
      i_fieldcat-ref_fieldname = x_reffld.
      i_fieldcat-ref_tabname   = x_ref.
      i_fieldcat-seltext_l     = x_text.
      i_fieldcat-seltext_m     = x_text.
      i_fieldcat-seltext_s     = x_text.
      i_fieldcat-ddictxt  = 'M'   .
      i_fieldcat-inttype       = x_type.
      i_fieldcat-outputlen     = x_tam.
      i_fieldcat-symbol        = x_sym.
      APPEND i_fieldcat.
      CLEAR  i_fieldcat.
    ENDFORM.                    " BILD_FIELDCAT
    FORM create_events USING rt_events TYPE slis_t_event.
      DATA: ls_event TYPE slis_alv_event.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
           EXPORTING
                i_list_type = 0
           IMPORTING
                et_events   = rt_events.
      READ TABLE rt_events WITH KEY name = slis_ev_top_of_page
                               INTO ls_event.
      IF sy-subrc = 0.
        MOVE g_top_of_page TO ls_event-form.
        APPEND ls_event TO rt_events.
      ENDIF.
    ENDFORM.                    "

  • Limit the number of record to download to excel from a report

    I am just wondering if there is a way to limit the number of rows that I want to download to excel from a report in apex, right now when I click download to excel it downloads all records. If I am displaying 15 records on report page I want the ability to download only those records.
    Any help with that would be appreciated.
    Kind Regards,
    Sofia.

    Sofia,
    The same report query runs for downloading the data into excel, I don't think you can limit the number of records in download.
    You can achieve it using custom code, like on click of download excel redirect to another page and then restrict the data as per your need, or you can use the custom procedure to download the limited data.
    Denes' utility to download into excel.
    http://htmldb.oracle.com/pls/otn/f?p=31517:108:1476564836494581:::RP,::
    Regards,
    Manish

  • Office 2010 Don't print blank lines when data fields are empty

    How do you do this in office 2010?  Where do we go now?
    This used to be under the Tools menu in previous versions:
    On the Tools menu, click Mail Merge.
    In the Mail Merge Helper dialog box, click Merge.
    NOTE: You must select the main document and data source for the merge before doing step 2.
    In the Merge dialog box, under When Merging Records, click either:
    Don't print blank lines when data fields are empty.
    -or-
    Print blank lines when data fields are empty.
    Click Close in the Merge dialog box, and then click
    Close in the Mail Merge Helper.
    NOTE: If you made no changes in the Merge dialog box, the
    Close button is not available. Click Cancel instead.
    Back to the top

    Hi,
    In Word 2007 or Word 2010, you can add
    Mail Merge Helper to the Quick Access bar, and perform the steps then.
    To add the
    Mail Merge Helper command in the Quick Access Toolbar in Word 2007, follow these steps:
    a.                 
    In Word 2007, click the
    Microsoft Office Button, and then click Word Options >
    Customize.
    In Word 2010, click File > Options > Customize Ribbon.
    b.                 
    Click
    All Commands in the Choose commands from, and then click
    Mail Merger Helper in the Choose commands from list.
    c.                  
    Click
    Add, and then OK.
    Best Regards,
    Sally Tang

  • How to avoid the "filter cells" during download to Excel from WAD

    How can we avoid seeing the "filter cells" in the link:
    http://help.sap.com/saphelp_nw04/helpdata/en/f1/0a54dbe09411d2acb90000e829fbfe/content.htm
    which we have every time a Bex query is downloaded to Excel from Web application designer?
    The objective is to find a way to avoid the filter cell rows from happening period.... and not asking the users to manually delete the excel rows.
    Edited by: Sharon West on Nov 26, 2008 12:12 PM

    Why is your topicstart all in bold?

  • When downloading an update from app store, password is requested from a different user.  How to change user?

    when downloading an update from app store, password is requested from a different user.  How to change user?

    Unfortunately there's no way around this.  you will need that password to update the apps. If he won't give it to you, then i'm not sure what to say.
    You should have kept the account with the Apps you bought yourself.
    Otherwise, as I said, delete the Apps, and buy them again.
    Sorry.

  • Help needed, M getting this message sandbox environment error no test user account, when downloading any application from iTunes, friend told me to sign out and sign in iTunes it might solve the problem but instead I cannot login I to my itune account.

    Help needed,
    I am getting this message sandbox environment error no test user account, when downloading any application from iTunes, friend told me to sign out and sign in iTunes it might solve the problem , and i triyed it but still  I cannot login I to my itune account. Same message keeping. Popping up,  this problem started supricly today.

    Take a look at the instructions here.
    http://www.technogal.net/2012/03/this-is-not-test-user-account-please.html

  • In download to excel from bsp hw to increase excel column width to wrap txt

    in download to excel from bsp how to increase excel column width to wrap text
    in each column.
    My client does not want to manually click each cell aftet downloading to excel to see full text in each column

    Hi,
    You can achieve this by formatting your output using HTML table tag.
    Try the following code.
      DATA: lv_output  TYPE string.
      concatenate
      '<table border="1">'
      '<tr style="font-weight: bold; text-align:center; "><td>Name</td><td width="150">Description</td></tr>' cl_abap_char_utilities=>cr_lf
      '<tr><td>First Name</td><td>Some Description goes here..... ....... ...... </td></tr>' cl_abap_char_utilities=>cr_lf
      '<tr><td>2nd Name</td><td>XYZ.......</td></tr>' cl_abap_char_utilities=>cr_lf
      '</table>'
      into lv_output.
      response->set_cdata( data = lv_output ).
    Regards
    Geogy
    PS. Reward the useful answers.

  • Download to excel from alv display

    Hi,
    How to download to excel from alv display.I am using object oriented abap for using alv.If i click export->spreadsheet i am getting fatal error and if i export->local file->spreadsheet i am getting only the column names and heading but no contents.Can anyone tell me how to overcome this problem.
    Regards,
    Sowmya.

    Hi Sowmya,
    Just put break point near FM reuse_alv_grid_display and check if internal table which is used to display output is popullated or not.
    Regards Sachin.

  • PO No is not coming complete in length while downloading in excel from ALV

    Hi to all
    My problem is
    I have declared
    EBELN LIKE EBAN-EBELN.
    length is 10.
    Now in ALV report it is showing complete PO no but
    when downloading itto excel , last digit is cut, only 9 digits are displayed.
    Why it is so.
    Please guide me...
    Thanks & regards
    Anubhav

    Hi
    Please try to declre the field EBELN as character of length 10 in the internal table for ALV.
    EBELN type char(10)
    <REMOVED BY MODERATOR>
    Thanks
    Edited by: Alvaro Tejada Galindo on Feb 22, 2008 6:00 PM

  • Download to excel from front end - percent coming as date

    download to excel from front end - percent coming as date
    Hi,
    i'm using below method to dowload to excel from frontend (Backened is R/3).
    1) l_string will have the entire xls date ( with sepeartor cl_abap_char_utilities=>horizontal_tab and cl_abap_char_utilities=>newline)
    2) Converitng string to xstring using FM SCMS_STRING_TO_XSTRING
    3) pumping excel date to browser using  IF_HTTP_ENTITY~SET_DATA
    4) creating URL using GUID_CREATE fm.
    it's downloding the excel file but funny date.
    example
    percentage 1.5 coming as Jan 50 and Percent 3.5 coming March 50.
    How to avoid this funny conversion.
    ...Nandha

    Hi Nanda,
    have you tried to change the number format of the corresponding cells in excel to percentage?
    BR Steffen

  • When downloading an application from the App Store requires a map of all. And I would like the function is deactivated

    When downloading an application from the App Store requires a map of all. And I would like the function is deactivated

    Please post in your native language. This makes no sense.

  • Taking download into excel from ALV Grid - header is printing in two lines

    Hi All,
    I have a scenario where I am taking the download from ALV grid to an excel sheet. Now the header of the ALV (column names) is appearing in two lines in the downloaded excel sheet while items (records of the ALV table) are getting displayed in a single line.
    This download is taken from the standard download to local file (spreadsheet) button provided by SAP for ALVs.
    I am using function module "Reuse_alv_grid_display" for the purpose.
    Can somebody provide an idea how I can avoid the header printing in two lines and keep the length as it is.
    Thanks in Advance,
    Chandan

    Hi..
    1. Pass header name in internal table appned first line.
    2. after that pass u r data .
    3. Use  FM. WS_DOWNLOAD 
    Salil ......
    Edited by: salil chavan on Nov 26, 2008 11:07 AM

  • Why is the spreadsheet empty when users download to Excel from ALV grid?

    Users are seeing SAP GUI transaction results display in the ALV Grid when running an SAP Report; however, when they click the Download to Excel icon the spreadsheet is empty.  When they use List...Export...Spreadsheet, the spreadsheet is filled.
    This seems to only be happening with 'Z' transactions.  Standard delivered transactions are OK.
    Using SAP GUI for Windows and Excel 2003.

    Hi All,
    I also have same Problem I my case when i click on 'Microsoft Excel' it does nothing. It does not even open a sheet.
    Please suggest,
    regards,
    Vinit

Maybe you are looking for

  • RAW files are dissappearing from the library

    I import all my images into iphoto as .DNG Raw files. I have noticed that lately if I edit an image in iphoto the actual RAW file is changed and the original master file is nowhere to be found. Trying to use the "rever to original" button fails to wo

  • How to create Application Workspace with Jdeveloper 10g 1.3.2?

    Following the instructions in "Developing and Using ADF Faces Skins", I am trying to create an Application Workspace. The instruction says: "In JDeveloper, create a new Application workspace and name it - ADFFaces_skin_sample" I can not find the way

  • Frozen price in material ledger

    Dear all, I need to have some informations about frozen price functionality in material ledger. In particular: - what is frozen price? - where in customizing it is set? - what is the system behavior using frozen price during production order confirma

  • MacBook Pro with DVI compatibility

    It seems that Apple will let DVI go away and only support the Mini DisplayPort. But, is there a way to use the new Cinema Display along with the current DVI output of the MacBook Pro 17" ? I guess it's only an adaptor, but I'm unsure... Message was e

  • My Mazda App error message

    Hi, I was wondering if you could help me with an error message I am getting on my I phone 5. I down loaded the My Mazda App to the phone, and when I try to log into the app, it gives me a " Get Customer Error occurred on the provider side" message. I