ALV Excel Download problem ( Special Character)

Hi,
I am unable to download completely in XLS format from ALV grid. When i tried in couple of ways there is a special character( " ) in one of the filed. Due to the same Excel download has some problem. I tested by removing those and it worked fine, 
Please suggest me to solve the issue.
Thanks,
Bhanu Gattu,

Data strings with special characters can not be downloaded into XLS format from ALV grid. In my case, I replaced the special character " with space and I could download the data into excel.

Similar Messages

  • ALV Excel download problem

    Hi,
    I am trying to download ALV report to excel but the columns in the o/p is appearing in two rows.
    THe ALV report has 82 columns in o/p.Is there any restriction on the no of columns that can be downloaded in excel.Please help.
    Thanks,
    Sutapa.

    Hi Sutapa,
    Kindly go through this link below for ALV Excel Download:
    Re: how to view alv grid output in excel format(not downloading to pc)
    Hope it helps
    Regrds
    Mansi

  • ALV to excel download problem through standard tool bar

    I am downloading data into excel from ALV , When there are 128 column data in execl coming as 2 row for 1 row of data in alv. This problem is not there for 78 columns report.
    Kindly suggest some solution.

    i think there is a limit to the number of columns for ALV and which is i think 92 ..this can be the cause of the issue
    amit

  • ALV to Excel download problem

    Hi Experts,
       I display around 15 fields(columns) in ALV output. When I download it to Excel, it downloads exactly.
    Then dynamically, when I increase the  number of fields to be displayed in ALV it is displaying correctly. But when I download
    to excel, half of the fields are coming in one line of excel sheet and remaining fields are coming in the second line of excel.
    Why am I not getting all the fields in one line itself in the excel sheet?
    Is it a problem in standard ALV?
    I am using cl_gui_alv_grid class to display ALV output.
    Thanks and regards,
    Venkat.

    Hi!
    Which function module you are using for downloading?

  • ALv to excel download problems

    HI friends,
    Probelm I'm facing while saving an ALV report to Excel Sheet by clicking
    on the 'Save as File Icon' button on the ALV output.=0D
    Here data is going into a new Line after 65 columns.I've used Function
    Module 'RSAQ_ALV'.This function module is ultimately using
    'REUSE_ALV_GRID_DISPLAY' and 'REUSE_ALV_LIST_DISPLAY' function
    modules.ALV output I'm getting correctly but when I save this ALV output
    to Excel,columns are getting wrapped and going into 2nd row after 65
    columns.=0D
    Could anybody tell me what could be the reason ?=0D
    Thanks,
    Sreekanth.G
    Moderator message: duplicate post locked.
    Edited by: Thomas Zloch on Jul 9, 2010 12:36 PM

    ch_alv_layout-info_fieldname = 'COLOR'. "infofield for listoutput
      ch_alv_layout-colwidth_optimize = 'X'.
    try commenting the above values.and also check the Fieldcatlog.
    Check the issue similar issue was resolve by checking catalog and layout:
    [ALV Issue solution|Re: Problem when export ALV.]
    Regards,
    Gurpreet

  • Excel Download problem - Urgent please

    Hi All,
    I am using 4.6C version.
    The user is downloading the ALV output to excel from the output menu
    List > Save > File > Spreadsheet >
    User tried saving a file to the Local drive and got a "Disk is full" error.
    User realized that the export didn't complete (Partial download)
    because there wasn't enough disk space to export the report.
    User stated that if he had received an error message of some sort, he might have realized the problem.
    He didn't receive any kind of errors.
    User would like some kind of error message to come up in those situations.
    Without an error message, he assumes the reports are acurate and trusts them.
    <b>I have analysied and found a exit EXIT_SAPLGRAP_001 which triggres after the popup asking the file path. However this exit doesnot give me the file path</b>.
    After this i think i can make use of the class CL_GUI_FRONTEND_SERVICES and method GET_FREE_SPACE_FOR_DRIVE and FILE_GET_SIZE to check for disk space full.
    Kindly let me know how to get the file path given in the popup to get it in the exit EXIT_SAPLGRAP_001. Also there was no parameter id for the field.
    Thanks for your help.
    Senthil

    Senthil,
    "However in this case the sap didnot uses GUI_DOWNLOAD to download instead it uses download FM. "
    What "download FM" is 4.6 using then?
    The GUI_DOWNLOAD does check for a disk_full situation... I find it hard to believe that SAP made an oversight here.
    I believe that the user is not telling the truth to you... or something else happened in that they have not conveyed to you.

  • Max. no of columns in ALV Excel download

    I've a problem regarding the download of data from alv report's that have more than 99 columns.
    I have searched the forum but couldn't find a right answer.
    It is being done by standard option and not by custom functionality is there any way where we can increase this limitation.

    I don't know if there is a way it for more columns using that function.     But I suggest you to use excel inplace tool. With excel inplace users directly display and maintain values in SAP screen and they can save final document without any limits I think. Just go to change layout-> view and choose microsoft excel. To be able to display excel using this option macro security in installed MS Excel should be in low and VB script execution must be on.

  • Excel download problem.

    Hi,
    i have developed a report using Dynamic ALV, when i used to save the output to excel, data in the output is matched with the excel. while executing the report in SAP screen it works fine. i have used REUSE_ALV_GRID.for this.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
          EXPORTING
            i_bypassing_buffer = 'X'
            i_buffer_active    = ' '
            i_callback_program = lv_repid
            is_layout          = gs_layout
            it_fieldcat        = gt_fieldcat
            it_sort            = gt_sort[]
            it_events          = gt_event
          TABLES
            t_outtab           = <dyn_table>
          EXCEPTIONS
            program_error      = 0
         OTHERS             = 0.
    is there any settings to be done in the excel or should we add any additional parameters for local file?
    pointers for this will be helpful.
    Regards,
    Dinesh

    Hi,
    What is your problem ?
    If you don't see anything in Excel after download :
    In Excel 
    first step
    - Menu : Tools ->Macros->scurity
    go to tab Trusted Publishers  and flag Trust acces to Visual Basic Project
    second step
    allow execution of macro
    - Menu : Tools ->Macros->scurity
    go to tab security Level and choise medium or Low
    Rgds

  • ALV - Excel download Date field sits in the last Column

    Hi,
    I have custom ALV grid report using OOp . From the report i am exporting the results to an EXCEL, but the date columns in the report sits as last column the exported excel.
    Any idea ?
    Thanks
    aRs

    That is the default functionality of the ALV grid, it collects all the similar data types together and then donwloads the data.
    If you don't want that, you will have write code yourself and download the data
    Regards,
    Ravi
    Note - Please mark all the helpful answers

  • Blocked ALV Excel Download Issue

    Hi Experts,
    My customers requirement is to download the output of Quotation Comparison Report with exact alignments as how it displays on Screen.
    When I tried to download from Standard SAP Save options, like List->save.... Export.. Spreadsheet........, I am not getting the same format into the Excel Sheet.
    I went into the program to check and found that it is a Blocked ALV.
    I have 3 Blocks in the Outputs.
    I am missing the alignment of Second Block having "Quoted" "Negotiated" to left side.
    Kindly help me in downloading this as it is.
    Regards,
    G.V.S Praveen Kumar

    Hi Sumeet,
    DATA: lv_exit   TYPE char1,                               "#EC NEEDED
             lwa_exit  TYPE slis_exit_by_user,                   "#EC NEEDED
             lt_excl   TYPE slis_t_extab,
             lwa_event TYPE slis_alv_event.
       DATA: lwa_layout1 TYPE slis_layout_alv,
             lwa_layout2 TYPE slis_layout_alv,
             lwa_layout3 TYPE slis_layout_alv,
             lt_events   TYPE slis_t_event.
    FIELD-SYMBOLS: <t_block1> TYPE STANDARD TABLE,
                    <t_block2> TYPE STANDARD TABLE,
                    <t_block3> TYPE STANDARD TABLE,
                    <w_block>  TYPE any.
    * Initializing the Block List
       CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
         EXPORTING
           i_callback_program       = sy-repid
           i_callback_pf_status_set = 'PF_STATUS'
           i_callback_user_command  = 'USER_COMMAND'
           it_excluding             = lt_excl.
    CONSTANTS:slis_ev_top_of_list TYPE slis_formname VALUE 'TOP_OF_LIST'.
       lwa_event-name = slis_ev_top_of_list.
       lwa_event-form = 'HEADER_TOP_OF_LIST'.
       APPEND lwa_event TO lt_events.
       CLEAR  lwa_event.
       lwa_layout1-no_colhead = 'X'.
       lwa_layout1-zebra = 'X'.
    * Appending the block data for header to the list
       CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
         EXPORTING
           is_layout                  = lwa_layout1
           it_fieldcat                = t_fld1
           i_tabname                  = '<T_BLOCK1>'
           it_events                  = lt_events
         TABLES
           t_outtab                   = <t_block1>
         EXCEPTIONS
           program_error              = 1
           maximum_of_appends_reached = 2
           OTHERS                     = 3.
       IF sy-subrc <> 0.
         MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
       ENDIF.
       REFRESH lt_events.
       lwa_event-name = slis_ev_top_of_list.
       lwa_event-form = 'ITEM_TOP_OF_LIST'.
       APPEND lwa_event TO lt_events.
       CLEAR  lwa_event.
       lwa_layout2-no_colhead = 'X'.
       lwa_layout2-zebra = 'X'.
    * Appending the block data for item to the list
       CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
         EXPORTING
           is_layout                  = lwa_layout2
           it_fieldcat                = t_fld2
           i_tabname                  = '<T_BLOCK2>'
           it_events                  = lt_events
         TABLES
           t_outtab                   = <t_block2>
         EXCEPTIONS
           program_error              = 1
           maximum_of_appends_reached = 2
           OTHERS                     = 3.
       IF sy-subrc <> 0.
         MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
       ENDIF.
       lwa_layout3-no_colhead = 'X'.
       lwa_layout3-zebra = 'X'.
       REFRESH lt_events.
    * Appending the block data for item to the list
       CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
         EXPORTING
           is_layout                  = lwa_layout3
           it_fieldcat                = t_fld3
           i_tabname                  = '<T_BLOCK3>'
           it_events                  = lt_events
         TABLES
           t_outtab                   = <t_block3>
         EXCEPTIONS
           program_error              = 1
           maximum_of_appends_reached = 2
           OTHERS                     = 3.
       IF sy-subrc <> 0.
         MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
       ENDIF.
    * Displaying the block list
       CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
         EXPORTING
           i_screen_start_column   = 0
           i_screen_start_line     = 0
           i_screen_end_column     = 0
           i_screen_end_line       = 0
         IMPORTING
           e_exit_caused_by_caller = lv_exit
           es_exit_caused_by_user  = lwa_exit
         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 -Excel download -header & data comming in Different columns

    Hi,
    I have an ALV report with FM.When I download it to excel through LIST/EXPORT/LOCALFILE some columns are getting messed up (ex: header is in one column and data is comming in different column).
    When i do with LIST/EXPORT/SPREADSHEET option it is working fine.
    but users want to use the first option only.
    I am use FM's in this report.
    Regards
    Praveen

    Hi
    What is the statement you used to dowload data .Check the field catalog that u are passing to downloaad function module.
    or check in the debuging mode..
    change these options in excel sheet and checkout if it can help u
    1. Go to Tools -> Macro -> Security in Excel
    2. Select the ‘Trusted Sources’ tab and ensure that the checkbox titled ‘Trust access to Visual Basic Project’ is ticked.
    3. With the feature switched on, the data is passed to Excel.
    check this sample one
    TABLES : MAST , "Material to BOM Link
    STKO , "BOM Header
    MARA . "General Material Data
    * Types Begin with TY_ *
    TYPES : BEGIN OF TY_MASTER ,
    MATNR TYPE MAST-MATNR , "Material Number
    WERKS TYPE MAST-WERKS , "Plant
    STLAN TYPE MAST-STLAN , "BOM Usage
    STLNR TYPE MAST-STLNR , "Bill of material
    STLAL TYPE MAST-STLAL , "Alternative BOM
    ANDAT TYPE MAST-ANDAT , "Date record created on
    AEDAT TYPE MAST-AEDAT , "Date of Last Change
    AENAM TYPE MAST-AENAM , "Name of Person Who Changed Object
    STLST TYPE STKO-STLST , "BOM status
    ZPLP1 TYPE MBEW-ZPLP1 , "Future Planned Price 1
    DWERK TYPE MVKE-DWERK , "Delivering Plant (Own or External)
    END OF TY_MASTER .
    TYPES : MY_TYPE(20) TYPE C.
    * Constants Begin with C_ *
    * Internal tables Begin with IT_ *
    DATA : IT_MASTER TYPE STANDARD TABLE OF TY_MASTER,
    WA_MASTER TYPE TY_MASTER .
    DATA : IT_HEADER TYPE TABLE OF MY_TYPE.
    * Data Begin with W_ *
    DATA : W_PTH TYPE RLGRAP-FILENAME.
    DATA : W_FILE TYPE RLGRAP-FILENAME.
    * Field Symbols Begin with FS_ *
    * Select Options Begin with SO_ *
    * Parameter Begin with PR_ *
    * I N I T I A L I Z A T I O N *
    *--- Add Header Fields to Header Table ---
    APPEND 'Material Number' TO IT_HEADER .
    APPEND 'Plant' TO IT_HEADER .
    APPEND 'BOM Usage' TO IT_HEADER .
    APPEND 'Bill Code' TO IT_HEADER .
    APPEND 'Alternative BOM' TO IT_HEADER .
    APPEND 'Created On' TO IT_HEADER .
    APPEND 'Changed On' TO IT_HEADER .
    APPEND 'Changed By' TO IT_HEADER .
    APPEND 'BOM Status' TO IT_HEADER .
    APPEND 'Planned Price' TO IT_HEADER .
    APPEND 'Delivery Plant' TO IT_HEADER .
    IF SY-MANDT = '700'.
    W_PTH = '\lkdb01ISDISSoftware DevelopmentsDevelopmentsData FilesSAP DumpsBOM_Available'.
    ELSE.
    W_PTH = 'C:'.
    ENDIF.
    * A T S E L E C T I O N S C R E E N *
    * s t a r t o f s e l e c t i o n
    START-OF-SELECTION.
    *--- Load Data to Internal Table ---
    * SELECT MAST~MATNR MAST~WERKS MAST~STLAN MAST~STLNR MAST~STLAL MAST~ANDAT MAST~AEDAT MAST~AENAM STKO~STLST
    * INTO TABLE IT_MASTER
    * FROM MAST
    * INNER JOIN STKO ON STKO~STLNR EQ MAST~STLNR
    * AND STKO~STLAL EQ MAST~STLAL
    * INNER JOIN MARA ON MARA~MATNR EQ MAST~MATNR
    * WHERE MARA~MTART LIKE 'ZFG%'
    * AND STKO~LKENZ NE 'X'
    * AND STKO~LOEKZ NE 'X'
    * AND STKO~STLST EQ '1'.
    SELECT MAST~MATNR MAST~WERKS MAST~STLAN MAST~STLNR MAST~STLAL MAST~ANDAT MAST~AEDAT MAST~AENAM STKO~STLST MBEW~ZPLP1 MVKE~DWERK
    INTO TABLE IT_MASTER
    FROM MAST
    INNER JOIN STKO ON STKO~STLNR EQ MAST~STLNR
    AND STKO~STLAL EQ MAST~STLAL
    INNER JOIN MARA ON MARA~MATNR EQ MAST~MATNR
    INNER JOIN MBEW ON MBEW~MATNR EQ MAST~MATNR
    AND MBEW~BWKEY EQ MAST~WERKS
    INNER JOIN MVKE ON MVKE~MATNR EQ MAST~MATNR
    WHERE MARA~MTART LIKE 'ZFG%'
    AND STKO~LKENZ NE 'X'
    AND STKO~LOEKZ NE 'X'
    AND STKO~STLST EQ '1'.
    IF SY-SUBRC <> 0.
    MESSAGE I014(ZLOAD).
    ENDIF.
    *--- Set Path to Function Module ---
    CONCATENATE W_PTH SY-DATUM ' - ' 'BOM_AVAILABLE_PLANT.XLS' INTO W_FILE.
    CALL FUNCTION 'WS_DOWNLOAD'
    EXPORTING
    FILENAME = W_FILE
    FILETYPE = 'DAT'
    TABLES
    DATA_TAB = IT_MASTER
    FIELDNAMES = IT_HEADER
    EXCEPTIONS
    FILE_OPEN_ERROR = 1
    FILE_WRITE_ERROR = 2
    INVALID_FILESIZE = 3
    INVALID_TYPE = 4
    NO_BATCH = 5
    UNKNOWN_ERROR = 6
    INVALID_TABLE_EIDTH = 7
    GUI_REFUSE_FILETRANSFER = 8
    CUSTOMER_ERROR = 9
    OTHERS = 10.
    IF SY-SUBRC = 0.
    SUBMIT ZI005_MARA_DUMP_SOLIDEAL_N.
    MESSAGE I023(ZLOAD) WITH text-001.
    ELSE.
    MESSAGE I022(ZLOAD) WITH W_FILE. "Errors while downloading.
    ENDIF.
    END-OF-SELECTION.
    SUBMIT ZI005_MARA_DUMP_SOLIDEAL_N.
    Reward all helpfull answers
    Regards
    Pavan
    Message was edited by:
            Pavan praveen

  • ALV  Grid downloading problem

    Hi expert,
      I got problem while downloading ALV GRID ouput to any local file.  The  output contains two records.  but while downloading  no records will be downloaded. only field headings are downloaded.  What is the problem.
    Pls help me to do.
    Thanks
    Murugan Arumugam

    I would suggest you add an additional button to the ALV grid toolbar. When the user clicks on this button you call in your event handler method for USER_COMMAND the method CL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD with the entire itab.
    Or
    Set the NO_OUT as 'X' in your fieldcatalog for the particular field.
    Reward points if useful

  • ALV Excel View Problem

    Hi All,
        I have a problem with the ALV display problem.
        When I click on the 'Microsoft Excel View' button at the top of the ALV display, I can view the data in Excel View.
        However, when my user click it on his computer, he saw the excel view is blank without data (even there are data at the initial ALV display screen).
        May I know what is the root cause of this problem? I've no idea of how to investigate it or solve it.
        Many Thanks.

    HI try with this code------
    *& Report  ZTEST_DOWNLOAD1
    report  ztest_download1.
    tables : trdir.
    type-pools: slis.
    types: begin of gt_output,
            progname type progname,
            strct_type(14) type c,
            strct_name(50) type c,
            serial(8) type c,
            mainfieldname(50) type c,
            offset(17) type c,
            leng(8) type c,
            decimals(8) type c,
            inttype(15) type c,
            datatype(9) type c,
            scrtext_m type scrtext_m,
            tabname type tabname,
            fieldname type fieldname,
            rollname type rollname,
            domname type domname,
            default(100) type c,
            end of gt_output.
    types: begin of gt_header,
            name(300) type c,
    end of gt_header.
    data : gi_output type standard table of gt_output,
           wa_output type gt_output,
           gi_header   type standard table of gt_header.
    data: d_filename like ibipparms-path,
          gi_fieldcat type slis_t_fieldcat_alv,
          wa_fieldcat type slis_fieldcat_alv,
          wa_header type gt_header.
    selection-screen:
    begin of  block b1 with frame title text-001.
    parameter: program(150) type c default 'ZTOOL_TEST'.
    select-options so_incl for trdir-name default 'ztool_test' no intervals .
    selection-screen begin of line.
    parameters :pa_check as checkbox default 'X'.
    selection-screen comment (29) text-t01.
    parameters :pa_path type rlgrap-filename default 'D:\TRIAL.XLS'.
    selection-screen end of line.
    selection-screen end of block b1.
    at selection-screen.
      perform download_excel_template.
    at selection-screen on value-request for pa_path.
      perform f4_file_help.
    *&      Form  F4_file_help
          text
    -->  p1        text
    <--  p2        text
    form f4_file_help .
      call function 'KD_GET_FILENAME_ON_F4'
        exporting
          program_name  = sy-repid
          dynpro_number = syst-dynnr
          field_name    = pa_path
        changing
          file_name     = d_filename
        exceptions
          mask_too_long = 1
          others        = 2.
      if sy-subrc <> 0.
       MESSAGE ID gv_msgid TYPE 'I' NUMBER 000.
      endif.
    endform.                    "f4_file_help
    form download_excel_template .
      refresh gi_header.
      wa_header-name = text-t01.
      append wa_header to gi_header.
      wa_header-name = text-t02.
      append wa_header to gi_header.
      wa_header-name = text-t03.
      append wa_header to gi_header.
      wa_header-name = text-t04.
      append wa_header to gi_header.
      wa_header-name = text-t05.
      append wa_header to gi_header.
      wa_header-name = text-t06.
      append wa_header to gi_header.
      wa_header-name = text-t07.
      append wa_header to gi_header.
      wa_header-name = text-t08.
      append wa_header to gi_header.
      wa_header-name = text-t09.
      append wa_header to gi_header.
      wa_header-name = text-t10.
      append wa_header to gi_header.
      wa_header-name = text-t11.
      append wa_header to gi_header.
      wa_header-name = text-t12.
      append wa_header to gi_header.
      wa_header-name = text-t13.
      append wa_header to gi_header.
      wa_header-name = text-t14.
      append wa_header to gi_header.
      wa_header-name = text-t15.
      append wa_header to gi_header.
      wa_header-name = text-t16.
      append wa_header to gi_header.
      wa_output-strct_name = 'abc'.
      append wa_output to gi_output.
      call function 'MS_EXCEL_OLE_STANDARD_DAT'
        exporting
          file_name                 = pa_path
          data_sheet_name           = 'Structure details'
        tables
          data_tab                  = gi_output
          fieldnames                = gi_header
        exceptions
          file_not_exist            = 1
          filename_expected         = 2
          communication_error       = 3
          ole_object_method_error   = 4
          ole_object_property_error = 5
          invalid_pivot_fields      = 6
          download_problem          = 7
          others                    = 8.
      if sy-subrc <> 0.
       MESSAGE ID gv_msgid TYPE 'E' NUMBER 002.
      endif.
    endform.                    " DOWNLOAD_EXCEL_TEMPLATE
    regards
    prashant

  • Alv Excel download

    Hi,
    I written a ALV Grid report and i want to download the the report to Excel.
    When I click on the excel button on the menu, Excel opens and the report is downloaded . BUT all the data with decimals are not downloaded it shows blank ,
    Can any one help me on this  .
    But when I use export to excel it works properly but my customer want to click on the excel and download
    Thanking you,
    Raju S

    hi raju,
    please try this,
    Open Excel -> Tools -> Options -> Security -> Macro Security -> Make it low.
    Now on the same path open tab -> Trusted Publishers and Check the checkbox for Trust Access to VB Project.
    Use the FM - ALV_XXL_CALL. here is the sample -
    REPORT ZSKC_ALV_XXL.
    TYPE-POOLS : KKBLO.
    DATA : ITAB LIKE T100 OCCURS 0,
    T_FCAT_LVC TYPE LVC_S_FCAT OCCURS 0 WITH HEADER LINE,
    T_FCAT_KKB TYPE KKBLO_T_FIELDCAT.
    START-OF-SELECTION.
    Get data.
    SELECT * UP TO 20 ROWS
    FROM T100
    INTO TABLE ITAB
    WHERE SPRSL = SY-LANGU.
    CHECK SY-SUBRC EQ 0.
    Create the field catalog.
    CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
    EXPORTING
    I_STRUCTURE_NAME = 'T100'
    CHANGING
    CT_FIELDCAT = T_FCAT_LVC[]
    EXCEPTIONS
    INCONSISTENT_INTERFACE = 1
    PROGRAM_ERROR = 2
    OTHERS = 3.
    CHECK SY-SUBRC EQ 0.
    make sure you pass the correct internal table name in the field catalog.
    t_fcat_lvC-tabname = 'ITAB'.
    MODIFY T_FCAT_LVC TRANSPORTING TABNAME WHERE TABNAME NE SPACE.
    Transfer to KKBLO format.
    CALL FUNCTION 'LVC_TRANSFER_TO_KKBLO'
    EXPORTING
    IT_FIELDCAT_LVC = T_FCAT_LVC[]
    IMPORTING
    ET_FIELDCAT_KKBLO = T_FCAT_KKB
    EXCEPTIONS
    IT_DATA_MISSING = 1
    IT_FIELDCAT_LVC_MISSING = 2
    OTHERS = 3.
    CHECK SY-SUBRC EQ 0.
    Call XXL.
    CALL FUNCTION 'ALV_XXL_CALL'
    EXPORTING
    I_TABNAME = 'ITAB'
    IT_FIELDCAT = T_FCAT_KKB
    TABLES
    IT_OUTTAB = ITAB[]
    EXCEPTIONS
    FATAL_ERROR = 1
    NO_DISPLAY_POSSIBLE = 2
    OTHERS = 3.
    IF SY-SUBRC 0.
    ENDIF.
    Dont forget to reward,
    Thanks & Regards,
    Kalyan.

  • Excel download problem :--- Header data duplicating in unexpected  columns

    Guys, 
       I   am  able  to  download  the  data onto  Excel  with   Header  data  but  the Header data duplicating in unexpected  columns RHS  upto  all  the  line item columns  below....Below  is  partial   excerpt... 
    Please help....
    DATA:
           BEGIN OF excel_wa,
                posnr               TYPE  vbap-posnr,           "Line Item
                matnr               TYPE  vbap-matnr,           "Mat#
                pmatn               TYPE  vbap-pmatn,           "Pric Mat
                zansicat            TYPE  zmarall-zansicat,     "AnsiCat#
                zansigrd            TYPE  zmarall-zansigrd,     "Grade
                zcurrvaltnarea      TYPE  zco002-zcurrvaltnarea,"Val Area
                zcurrcstusd         TYPE  zco002-zcurrcstusd,   "Cost$
                zzbrndnm            TYPE  mara-zzbrndnm,        "Brand
                zqedscgrp           TYPE  zglbprc-zqedscgrp, "QE Disc Grp
                mstav               TYPE  mara-mstav,        "Status
                prodh               TYPE  vbap-prodh,        "Prod Heir
                kwmeng              TYPE  vbap-kwmeng,       "Qty
                lprc                TYPE  konv-kbetr,  "List Price ZBP1
                sprc                TYPE  konv-kbetr,  "Std Pric ZNAA,ZNAX
                netpr               TYPE  vbap-netpr,  "Quot price
                mrgn                TYPE  konv-kbetr,  "margin%
           END   OF excel_wa,
           BEGIN OF sema_wa,
            posnr            LIKE ws-xxlt VALUE 'STRDFT',
            matnr            LIKE ws-xxlt VALUE 'STRDFT',
            pmatn            LIKE ws-xxlt VALUE 'STRDFT',
            zansicat         LIKE ws-xxlt VALUE 'STRDFT',
            zansigrd         LIKE ws-xxlt VALUE 'STRDFT',
            zcurrvaltnarea   LIKE ws-xxlt VALUE 'STRDFT',
            zcurrcstusd      LIKE ws-xxlt VALUE 'STRDFT',
            zzbrndnm         LIKE ws-xxlt VALUE 'STRDFT',
            zqedscgrp        LIKE ws-xxlt VALUE 'STRDFT',
            mstav            LIKE ws-xxlt VALUE 'STRDFT',
            prodh            LIKE ws-xxlt VALUE 'STRDFT',
            kwmeng           LIKE ws-xxlt VALUE 'N00ADD',
            lprc             LIKE ws-xxlt VALUE 'N02ADD',
            sprc             LIKE ws-xxlt VALUE 'N03ADD',
            netpr            LIKE ws-xxlt VALUE 'N02ADD',
            mrgn             LIKE ws-xxlt VALUE 'N00ADD',
          END OF sema_wa,
          BEGIN OF clhd_wa,
            posnr            LIKE ws-xxlt VALUE 'LineItem#',
            matnr            LIKE ws-xxlt VALUE 'Mat#',
            pmatn            LIKE ws-xxlt VALUE 'VC Mat#',
            zansicat         LIKE ws-xxlt VALUE 'AnsiCat',
            zansigrd         LIKE ws-xxlt VALUE 'Grade',
            zcurrvaltnarea   LIKE ws-xxlt VALUE 'ValnArea',
            zcurrcstusd      LIKE ws-xxlt VALUE 'Currency',
            zzbrndnm         LIKE ws-xxlt VALUE 'Brand',
            zqedscgrp        LIKE ws-xxlt VALUE 'QE disc',
            mstav            LIKE ws-xxlt VALUE 'Status',
            prodh            LIKE ws-xxlt VALUE 'Prod Heir',
            kwmeng           LIKE ws-xxlt VALUE 'Qty',
            lprc             LIKE ws-xxlt VALUE 'List Pric',
            sprc             LIKE ws-xxlt VALUE 'St.Disc',
            netpr            LIKE ws-xxlt VALUE 'Quote Price',
            mrgn             LIKE ws-xxlt VALUE 'Margin%',
         END OF clhd_wa,
         BEGIN OF hdtxt1_wa,
            vbeln      LIKE ws-xxlt VALUE 'Quotation#',
            kunnr      LIKE ws-xxlt VALUE 'Quote Date',
            kvgr3      LIKE ws-xxlt VALUE 'Rep Date',
            pltyp      LIKE ws-xxlt VALUE 'Pric List Typ & Currency',
            waers      LIKE ws-xxlt VALUE 'Sold To',
            knuma      LIKE ws-xxlt VALUE 'Ship To',
            datab      LIKE ws-xxlt VALUE 'Top Parent',
            datbi      LIKE ws-xxlt VALUE 'Sales Org/Sales Dist/CPA',
            note       LIKE ws-xxlt VALUE 'Net Sales',
         END OF hdtxt1_wa,
         BEGIN OF hdtxt2_wa,
            vbeln      LIKE ws-xxlt VALUE '',"Quotation#',
            kunnr      LIKE ws-xxlt VALUE '',"Quote Date',
            kvgr3      LIKE ws-xxlt VALUE '',"Rep Date',
            pltyp      LIKE ws-xxlt VALUE '',"Pric List Typ & Currency',
            waers      LIKE ws-xxlt VALUE '',"Sold To',
            knuma      LIKE ws-xxlt VALUE '',"Ship To',
            datab      LIKE ws-xxlt VALUE '',"Top Parent',
            datbi      LIKE ws-xxlt VALUE '',"Sales Org/Sales Dist/CPA',
            note       LIKE ws-xxlt VALUE '',"Net Sales',
         END OF hdtxt2_wa.
    DATA:
          ivbap      LIKE  STANDARD TABLE OF ivbap_wa,
          imat       LIKE  STANDARD TABLE OF mat_wa,
          icurr      LIKE  STANDARD TABLE OF curr_wa,
          ikonv      LIKE  STANDARD TABLE OF konv_wa,
          ivbpa      LIKE  STANDARD TABLE OF ivbpa_wa,
          ikna1      LIKE  STANDARD TABLE OF kna1_wa,
          iresult    LIKE  STANDARD TABLE OF result_wa,
    *Excel tables
          iexcel     LIKE  STANDARD TABLE OF excel_wa,
          isema_wa   LIKE  gxxlt_s,
          it_sema    LIKE  STANDARD TABLE OF gxxlt_s,
          ihkey_wa   LIKE  gxxlt_h,
          it_hkey    LIKE  STANDARD TABLE OF gxxlt_h,
          iotxt_wa   LIKE  gxxlt_o,
          it_otext   LIKE  STANDARD TABLE OF gxxlt_o,
          iptxt_wa   LIKE  gxxlt_p,
          it_ptext   LIKE  STANDARD TABLE OF gxxlt_p,
          ivkey_wa   LIKE  gxxlt_v,
          it_vkey    LIKE  STANDARD TABLE OF gxxlt_v.
    *Field-Symbols
    FIELD-SYMBOLS:
          <vbap>  LIKE   ivbap_wa,
          <vbpa>  LIKE   ivbpa_wa,
          <mat>   LIKE   mat_wa,
          <sema_wa>,
          <clhd_wa>,
          <hdtxt1_wa>,
          <hdtxt2_wa>.
    *Constants
    CONSTANTS:
          c_auart   TYPE  vbak-auart  VALUE  'AG', "AG = Quotn
          c_parvw1  TYPE  vbpa-parvw  VALUE  'AG',
          c_parvw2  TYPE  vbpa-parvw  VALUE  'WE',
          c_parvw3  TYPE  vbpa-parvw  VALUE  'ZT',
          c_kappl   TYPE  konv-kappl  VALUE  'V',
          c_kschl1  TYPE  konv-kschl  VALUE  'ZBP1',
          c_kschl2  TYPE  konv-kschl  VALUE  'ZNAX',
          c_kschl3  TYPE  konv-kschl  VALUE  'ZNAA',
          c_psize   TYPE  i           VALUE  65535.
    *&      SELECTION-SCREEN.
    SELECTION-SCREEN BEGIN OF BLOCK a WITH FRAME TITLE  text-001.
    SELECT-OPTIONS:
        s_vbeln  FOR  ws-vbeln NO INTERVALS NO-EXTENSION OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK a.
    *&      AT SELECTION-SCREEN.
    AT SELECTION-SCREEN.
      PERFORM validate_screen_entries.
    START-OF-SELECTION.
      PERFORM gather_quot_data.
      PERFORM gather_mat_data.
      PERFORM gather_ansi_data.
      PERFORM gather_customer_data.
      PERFORM gather_price_data.
      PERFORM process_consolidate_data.
    TOP-OF-PAGE.
      PERFORM write_header_data.
      PERFORM write_column_heading.
    END-OF-SELECTION.
      SET PF-STATUS 'XLS'.
      PERFORM display_output.
    AT USER-COMMAND.
      CASE sy-ucomm.
        WHEN 'XLS'.
          LOOP AT iresult INTO result_wa.
            CLEAR excel_wa.
            excel_wa-posnr       = result_wa-posnr.
            excel_wa-matnr       = result_wa-matnr.
            excel_wa-pmatn       = result_wa-pmatn.
            excel_wa-zansicat    = result_wa-zansicat.
            excel_wa-zansigrd    = result_wa-zansigrd.
            excel_wa-zcurrvaltnarea = result_wa-zcurrvaltnarea.
            excel_wa-zcurrcstusd = result_wa-zcurrcstusd.
            excel_wa-zzbrndnm    = result_wa-zzbrndnm.
            excel_wa-zqedscgrp   = result_wa-zqedscgrp.
            excel_wa-mstav       = result_wa-mstav.
            excel_wa-prodh       = result_wa-prodh.
            excel_wa-kwmeng      = result_wa-kwmeng.
            excel_wa-lprc        = result_wa-lprc.
            excel_wa-sprc        = result_wa-sprc.
            excel_wa-netpr       = result_wa-netpr.
            excel_wa-mrgn        = result_wa-mrgn.
            APPEND excel_wa TO iexcel.
          ENDLOOP.
          PERFORM set_up_xxl_structures.
          PERFORM download_xxl.
        WHEN OTHERS.
      ENDCASE.
      FREE: ivbpa, imat, ikna1, ivbap, ikonv, iresult, ws.
    *&      Form  set_up_xxl_structures
          text
    FORM set_up_xxl_structures.
      REFRESH: it_otext, it_sema, it_hkey, it_vkey.
      CLEAR:   result_wa, ivbpa_wa, it_otext, ws.
      MOVE  sy-repid  TO ws-title-repid.
      MOVE 'Section'  TO ws-title-reppart.
      WRITE sy-uzeit  TO ws-title-uzeit USING EDIT MASK '__:__'.
      MOVE  ws-title  TO ws-xxl-title.
      READ TABLE iresult INTO result_wa
                         WITH KEY vbeln = s_vbeln-low.
      READ  TABLE  ivbpa INTO ivbpa_wa
                         WITH KEY vbeln = s_vbeln-low
                                  parvw = 'AG'.
      CONCATENATE ivbpa_wa-kunnr '/'
                  ivbpa_wa-name1 INTO ws-soldto.
      CLEAR ivbpa_wa.
      READ  TABLE  ivbpa INTO ivbpa_wa
                         WITH KEY vbeln = s_vbeln-low
                                  parvw = 'WE'.
      CONCATENATE ivbpa_wa-kunnr '/'
                  ivbpa_wa-name1 INTO ws-shipto.
      CLEAR ivbpa_wa.
      READ  TABLE  ivbpa INTO ivbpa_wa
                         WITH KEY vbeln = s_vbeln-low
                                  parvw = 'ZT'.
      IF   ivbpa_wa-kunnr EQ space.
        CLEAR ivbpa_wa.
        READ  TABLE  ivbpa INTO ivbpa_wa
                           WITH KEY vbeln = s_vbeln-low
                                    parvw = 'AG'.
      ENDIF.
      CONCATENATE ivbpa_wa-kunnr '/'
                  ivbpa_wa-name1 INTO ws-tparent.
      DO.
        CLEAR: isema_wa, ihkey_wa, iotxt_wa, iptxt_wa, ivkey_wa.
        ASSIGN COMPONENT sy-index OF STRUCTURE hdtxt1_wa TO <hdtxt1_wa>.
        ASSIGN COMPONENT sy-index OF STRUCTURE hdtxt2_wa TO <hdtxt2_wa>.
        IF sy-subrc <> 0.
          EXIT.
        ENDIF.
        CASE <hdtxt1_wa>.
          WHEN 'Quotation#'.
            <hdtxt2_wa> = 'Quotation#'.
          WHEN 'Quote Date'.
            <hdtxt2_wa> = 'Quote Date'.
          WHEN 'Rep Date'.
            <hdtxt2_wa> = 'Rep Date'.
          WHEN 'Pric List Typ & Currency'.
            <hdtxt2_wa> = 'Pric List Typ & Currency'.
          WHEN 'Sold To'.
            <hdtxt2_wa> = 'Sold To'.
          WHEN 'Ship To'.
            <hdtxt2_wa> = 'Ship To'.
          WHEN 'Top Parent'.
            <hdtxt2_wa> = 'Top Parent'.
          WHEN 'Sales Org/Sales Dist/CPA'.
            <hdtxt2_wa> = 'Sales Org/Sales Dist/CPA'.
          WHEN 'Net Sales'.
            <hdtxt2_wa> = 'Net Sales'.
        ENDCASE.
        MOVE : 1           TO ihkey_wa-col_no,
               sy-index    TO ihkey_wa-row_no,
               <hdtxt2_wa> TO ihkey_wa-col_name.
        APPEND ihkey_wa TO it_hkey.
        CLEAR ihkey_wa.
        CASE <hdtxt1_wa>.
          WHEN 'Quotation#'.
            <hdtxt2_wa> = result_wa-vbeln.
          WHEN 'Quote Date'.
            WRITE result_wa-erdat TO ws-dat1.
            <hdtxt2_wa> = ws-dat1.
          WHEN 'Rep Date'.
            WRITE result_wa-repdt TO ws-dat2.
            <hdtxt2_wa> = ws-dat2.
          WHEN 'Pric List Typ & Currency'.
            CONCATENATE result_wa-pltyp '/'
                        result_wa-waers INTO <hdtxt2_wa>.
          WHEN 'Sold To'.
            <hdtxt2_wa> = ws-soldto.
          WHEN 'Ship To'.
            <hdtxt2_wa> = ws-shipto.
          WHEN 'Top Parent'.
            <hdtxt2_wa> = ws-tparent.
          WHEN 'Sales Org/Sales Dist/CPA'.
            CONCATENATE result_wa-vkorg  '/'
                        result_wa-bzirk  '/'
                        ivbpa_wa-kvgr3
                        INTO <hdtxt2_wa>.
          WHEN 'Net Sales'.
            <hdtxt2_wa> = result_wa-netwr.
        ENDCASE.
        MOVE : 2           TO ihkey_wa-col_no,
               sy-index    TO ihkey_wa-row_no,
               <hdtxt2_wa> TO ihkey_wa-col_name.
        APPEND ihkey_wa TO it_hkey.
      ENDDO.
      DO.
        CLEAR: isema_wa, ihkey_wa, iotxt_wa, iptxt_wa, ivkey_wa.
        ASSIGN COMPONENT sy-index OF STRUCTURE sema_wa TO <sema_wa>.
        IF sy-subrc NE 0.
          ASSIGN COMPONENT sy-index OF STRUCTURE clhd_wa TO <clhd_wa>.
          IF sy-subrc EQ 0.
            MESSAGE e193 WITH 'OFIL Structures out of synch-Contact IT'.
          ENDIF.
          EXIT.
        ENDIF.
        ASSIGN COMPONENT sy-index OF STRUCTURE clhd_wa TO <clhd_wa>.
        IF NOT <sema_wa> EQ 'NOSHOW'.
          ADD 1 TO ws-xxl-tabix.
          MOVE: ws-xxl-tabix   TO isema_wa-col_no,
                <sema_wa>(3)   TO isema_wa-col_typ,
                <sema_wa>+3(3) TO isema_wa-col_ops,
                ws-xxl-tabix   TO isema_wa-col_src.
          APPEND isema_wa TO it_sema.
          IF ws-xxl-tabix LE ws-xxl-vrtkeys.
            MOVE: ws-xxl-tabix TO ivkey_wa-col_no,
                  <clhd_wa>    TO ivkey_wa-col_name.
            APPEND ivkey_wa TO it_vkey.
          ELSE.
            ADD 1 TO ws-xxl-attcols.
            MOVE: ws-xxl-attcols TO ihkey_wa-col_no,
                  10             TO ihkey_wa-row_no,
                  <clhd_wa>      TO ihkey_wa-col_name.
            APPEND ihkey_wa TO it_hkey.
          ENDIF.
        ENDIF.
      ENDDO.
    ENDFORM.                    " set_up_xxl_structures
    *&      Form  download_xxl
          text
         -->P_IHQEXCEL  text
    FORM download_xxl.  "TABLES  iexcel STRUCTURE excel_wa.
      DESCRIBE TABLE iexcel LINES ws-xxl-count.
      ws-xxl-from = 1.
      ws-xxl-to = c_psize.
      DO.
        IF ws-xxl-from GT ws-xxl-count.
          EXIT.
        ENDIF.
        IF ws-xxl-to GT ws-xxl-count.
          MOVE ws-xxl-count TO ws-xxl-to.
        ENDIF.
        ADD 1 TO ws-xxl-suffix.
        MOVE ws-xxl-suffix TO: ws-xxl-name+6(2),
                               ws-xxl-title+36(2).
        CALL FUNCTION 'XXL_FULL_API'
             EXPORTING
                  n_vrt_keys       = ws-xxl-vrtkeys
                  n_att_cols       = ws-xxl-attcols
                  n_hrz_keys       = ws-xxl-hrzkeys
                  data_starting_at = ws-xxl-from
                  data_ending_at   = ws-xxl-to
                  filename         = ws-xxl-name
                  header_1         = space
                  sema_type        = 'X'
                  so_title         = ws-xxl-title
             TABLES
                  data             = iexcel
                  hkey             = it_hkey
                  online_text      = it_otext
                  print_text       = it_ptext
                  sema             = it_sema
                  vkey             = it_vkey
             EXCEPTIONS
                  data_too_big     = 1
                  file_open_error  = 2
                  file_write_error = 3
                  inv_winsys       = 4
                  inv_xxl          = 5.
        CASE sy-subrc.
          WHEN 1.
            MESSAGE e193 WITH 'dim_mismatch_data'.
          WHEN 2.
            MESSAGE e193 WITH 'file_open_error'.
          WHEN 3.
            MESSAGE e193 WITH 'file_write_error'.
          WHEN 4.
            MESSAGE e193 WITH 'inv_winsys'.
          WHEN 5.
            MESSAGE e193 WITH 'inv_xxl'.
        ENDCASE.
        ADD c_psize TO: ws-xxl-from,
                                ws-xxl-to.
      ENDDO.
    ENDFORM.                    " download_xxl

    Hello Friend,
    You can use GUI_DOWNLOAD FM to get the excel header if that's the only specific requirement.
    [Download Excel including header |Download Excel including header;
    Hope this helps.
    BR,
    Suhas

Maybe you are looking for

  • Invalid characters error while ODS activation

    I have 2 queries regarding Invalid characters 1) I got following error while activating ODS. Value 'HYDERABAD - IV  COMMISSIONERATE ' (hex. '48594445524142414420<b>2D</b>204956A020434F4D4D495353494F') of characteristic ZEXCRG contains     invalid cha

  • EJB 3.0 Session Bean Remote Client

    Hi, I am planning to migrate my EJB 2.1 to EJB 3.0. My old session bean is accessed by a remote java client. I just have to include this piece of code: Hashtable props = new  Hashtable(); props.put("java.naming.factory.initial", com.sun.jndi.cosnamin

  • How to select value of selectOneChoice

    Hello, First of all I want to describe what I want to do and then the preconditions for my case. What I want to do: I simply want a <selectOneChoice> Component which represents an enumeration of values. In database there is a column which has the val

  • ITunes Web-Based or iTunes Match?

    I'm sorry if this is not in the correct place. I searched for about an hour and did not find anything. I have a really old ipod classic that i'm wanting to replace. My main issue in deciding between itunes and something like Amazon, is while I'm an A

  • Using external speakers with iPad

    Hey, I have the cool imac ball speakers, these: http://www.vectronicsappleworld.com/collection/articlepics/g4imac/snap45.jpg But the plug on the speakers is a little to small. Is there an adapter that I can get that will allow me to use these speaker