Auto-Resizing of downloaded Excel Sheet

I am downloading data into excel sheet from sap program. When I open the excel sheet it shows the fields. Here, material description field is of length 50 chars, but it shows only 12 char. When I double click on the field everything is shown.
I want to download data and when opened excel sheet it should show all the contents ie material descrption of 50 chars should be shown up.
Pl. provide neccessary inputs on achieving this functionality.

Hi try with by giving
value 'DBF' for the parameter File Type.
Regs
Manas Ranjan Panda

Similar Messages

  • Have a pushbutton on downloaded excel sheet from SAP

    Hello
         Is it possible to have a Pushbutton on downloaded excel sheet from SAP

    Check OLE for this.

  • Is there an add-on for Microsoft Skydrive to download Excel sheets?

    Looking for an add-on to download Excel sheets from Skydrive.

    Try [https://addons.mozilla.org/en-us/firefox/addon/grooveshredder/ Groove Shredder]

  • Displaying the header in the downloaded Excel sheet of BI Report

    Hi Friends,
          The BI report is mapped in the portal, there is a requirement to add a header part in the excel sheet which is downloaded from the Portal like displaying the company code and the date on which it is pulled out. How can it be done, please guide me.
    Thanks
    Karthik

    Hi,
    then that is an excel formattng.. After downloading, select the MATNR column, use the Menu option Firmat> Cells> Number--> custom and enter '000000000000000000'.
    Regards,
    Suresh Datti

  • Problem in downloading excel sheet

    Hi All,
    We have a WD Java application, where in one screen we are displaying a few records in a table. We also have a option to download and save the data in the form of a excel sheet on the click of a button.
    Now the problem is, the downloding to excel option is working fine if we use IE version 6.0. If we use teh same application in IE 8 just a empty window is opening.
    What can be the problem for this? Is there any settings that needs to be made in IE 8 or the problem is with the code?
    Regards.

    Hi Becky,
    I think browser version is an issue, may be the JAR file which you are using for excel work may be not compitable with the IE's version.
    Let me explore and will get back to you.
    Deepak!!!
    Pls find below comment from Armin from SAP:- you have to look for WD patch for this if sap has already released...:)
    Armin Reichert  
    Posts: 5,186
    Registered: 2/14/04
    Forum Points: 10,001 
       Re: Webdynpro not supported by IE8   
    Posted: May 12, 2009 10:56 PM    in response to: Rocío Lorena Su...           Reply 
    IE8 will certainly be supported in the future as soon as the tests have been passed succesfully. Only those browsers/versions mentioned in the PAM are supported officially for the different Web Dynpro versions.
    Armin
    Edited by: Deepak Arora on Jan 7, 2010 7:52 AM

  • How to disable HTML and Download excel sheet

    Hi ,
    i've some reports in my dashboards, i've enable report links for print and download, When i click on print button we can get PDT,HTML. I need only PDF. not HTML. How to disable HTML in print button. and also when click download button i need to see only download to Microsoft excel . Can any one help me out .

    Hi,
    Please refer the below links to remove the options
    http://obiee-tips.blogspot.com/
    Hope this helps
    Regards
    MuRam
    Edited by: MuRam on Jan 11, 2012 2:57 AM

  • Error msg appearing while downloading Excel sheet in Pivot table format!!

    Hi All,
    I received this error when the report outputted. I had to click okay twice, then the report populated correctly.
    "Unable to get the Pivotfields property of the Pivot table class" was the error message that i got.
    FORM start_excel .
      TYPES:
        BEGIN OF ls_table_out,
          ls_line(64000) TYPE x,
        END OF ls_table_out.
      DATA:
        fname TYPE string,
        atrname(128) TYPE C,
        ls_line_out(64000) TYPE x,
        ls_datasize TYPE i,
        ls_readsize TYPE i,
        lt_table_out TYPE TABLE OF ls_table_out WITH HEADER LINE.
    *    excelf(200) TYPE c.
      data: oref type ref to CL_GUI_FRONTEND_SERVICES.
      CREATE OBJECT oref.
      ls_datasize = 0.
      ls_readsize = 0.
    * if user indicated to get Template from Unix.
    * Copy template to C:\Gap_Mandate_Training and then start template from
    * there.  Otherwise start template from local directory indicated
      IF excelf CS '/'.   "if contains forward slash then unix file
        OPEN DATASET excelf FOR INPUT IN BINARY MODE.
        IF sy-subrc = 0.
          DO.
            READ DATASET excelf INTO ls_line_out LENGTH ls_readsize.
            IF sy-subrc <> 0.
              ls_datasize = ls_datasize + ls_readsize.
              lt_table_out-ls_line = ls_line_out.
              APPEND lt_table_out.
              EXIT.
            ENDIF.
            ls_datasize = ls_datasize + ls_readsize.
            lt_table_out-ls_line = ls_line_out.
            APPEND lt_table_out.
          ENDDO.
    *   move c_txt_file_path to fname.
          CONCATENATE dir  '\mandated_training.xls' INTO templ_name.
          MOVE templ_name TO fname.
          atrname = fname.
    *      CALL FUNCTION 'WS_FILE_ATTRIB'
    *        EXPORTING
    *          file   = atrname
    *          attrib = 'R-'.
          data: filename type string,
                rc type i.
          filename = atrname.
          CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_SET_ATTRIBUTES
            EXPORTING
              FILENAME             = filename
              READONLY             = ' '
            IMPORTING
              RC                   = rc
            EXCEPTIONS
              CNTL_ERROR           = 1
              ERROR_NO_GUI         = 2
              NOT_SUPPORTED_BY_GUI = 3
              WRONG_PARAMETER      = 4
              others               = 5.
          IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
          CALL FUNCTION 'GUI_DOWNLOAD'
          EXPORTING
            bin_filesize                  = ls_datasize
            filename                      = fname
            filetype                      = 'BIN'
    * IMPORTING
    *   FILELENGTH                    =
          TABLES
            data_tab                      = lt_table_out
          EXCEPTIONS
            file_write_error        = 1
            no_batch                = 2
            gui_refuse_filetransfer = 3
            invalid_type            = 4
            no_authority            = 5
            unknown_error           = 6
            header_not_allowed      = 7
            separator_not_allowed   = 8
            filesize_not_allowed    = 9
            header_too_long         = 10
            dp_error_create         = 11
            dp_error_send           = 12
            dp_error_write          = 13
            unknown_dp_error        = 14
            access_denied           = 15
            dp_out_of_memory        = 16
            disk_full               = 17
            dp_timeout              = 18
            file_not_found          = 19
            dataprovider_exception  = 20
            control_flush_error     = 21
            OTHERS                  = 22.
          atrname = fname.
          CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_SET_ATTRIBUTES
            EXPORTING
              FILENAME             = filename
              READONLY             = 'X'
    *         NORMAL               =
    *         HIDDEN               =
    *         ARCHIVE              =
            IMPORTING
              RC                   = rc
            EXCEPTIONS
              CNTL_ERROR           = 1
              ERROR_NO_GUI         = 2
              NOT_SUPPORTED_BY_GUI = 3
              WRONG_PARAMETER      = 4
              others               = 5.
          IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
    *      CALL FUNCTION 'WS_FILE_ATTRIB'
    *        EXPORTING
    *          file   = atrname
    *          attrib = 'R+'.
        ELSE.
          MOVE 'UNIX-TEMPLATE-NOT-FOUND.XLS' TO templ_name.
        ENDIF.  "IF sy-subrc = 0
      ELSE.
        templ_name = excelf.
      ENDIF.  "if excelf CN '/'
    * Now kick off the excel file
      DATA:
        startpath LIKE rlgrap-filename,
    *    ls_comline(100) TYPE c,                    "Comment out for GHDK964062
        ls_comline type string,                     "Added for  GHDK964062
        lf_length TYPE i.
      CALL FUNCTION 'REGISTRY_GET'
        EXPORTING
          key     = 'protocol\StdFileEditing\server'
          section = 'ExcelWorksheet'
        IMPORTING
          value   = startpath.
      MOVE templ_name TO ls_comline.
    CALL FUNCTION 'ZHR_LAUNCH_OFFICE_APPS'        "ADDED FOR GHDK964062
        EXPORTING
    *     IV_WORD           =
          IV_EXCEL          =  'X'
    *     IV_PWRPOINT       =
          IV_PATH           = ls_comline
    *   CALL FUNCTION 'WS_EXECUTE'                  "Comment out for GHDK964062
    *    EXPORTING
    *      commandline        = ls_comline
    *      program            = startpath
    *    EXCEPTIONS
    *      frontend_error     = 1
    *      no_batch           = 2
    *      prog_not_found     = 3
    *      illegal_option     = 4
    *      gui_refuse_execute = 5.
    ENDFORM.                    " start_excel
    Please help me to resolve this issue.Thanks.
    Regards,
    Arpita.

    Hi,
    Did you the use the GUO_download using the following values:
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        filename         = fullpath
        filetype         = 'ASC'
        codepage         = space
        write_bom        = 'X'
      TABLES

  • How can I download to one excel sheet from more than two table?

    Hi.
    as you know
    <SAP_BW_URL CMD='EXPORT' FORMAT='XLS' DATA_PROVIDER='DATAPROVIDER_T1' >
    this script can make download excel sheet which is same cotents of table or chart in web template.
    but if template has more than two tables how can we get excel sheet from tables?
    <SAP_BW_URL CMD='EXPORT' FORMAT='XLS' DATA_PROVIDER_1='DATAPROVIDER_T1' DATA_PROVIDER_2='DATAPROVIDER_T2'>
    I hope this gonna work but result was fail same as I expected.
    is there any way put two tables download one excel sheet?

    Welcome to SDN.
    Post this in Business Explorer forum for quicker resposne.
    SAP Business Explorer (SAP BEx)
    Regards
    Raja

  • How to change the cell value in Excel Sheet in WD Java?

    HI,
    I have an application which is used to upload and download excel sheet.I can upload the excel sheet through Upload UI element and also able to download the same file through Download UI.But before download I want to validate the excel sheet.If data is not proper in the excel then I have to put some comment (cell comment).I am able to read each cell value,but not ble to put any comment.Once I pt commen in the cell,the download file should display the commented in the excel sheet.
    Please let me know how to update hte excel sheet.
    Sandip

    hi Sandeep,
    I'm not sure about the HSSF apis, however, i inserted the Cell Comments using jexcel apis. There is a method setComment(java.lang.String s, double width, double height) in class WritableCellFeatures using which you can insert cell comments
    For more details refer [link|http://jexcelapi.sourceforge.net/resources/javadocs/current/docs/jxl/write/WritableCellFeatures.html]
    Abhinav

  • Downloading a file to excel sheet

    To all forum people 
    While I download an internal table into an excel-sheet I would like to place a field name in the excel-sheet corresponding to each field in my internal table so how could this be done are there any function modules pertaining to this issue or is there any other method to do this.....
    murali

    Hi 
    The following is a sample code download to EXCEL file
    REPORT Sample
    NO STANDARD PAGE HEADING
    LINE-SIZE 180
           LINE-
            COUNT 90                                             0001-
            LINE-COUNT 65                                             "0001+
            MESSAGE-ID z1.
    TABLES: MARC.
    DATA : BEGIN OF i_marc OCCURS 0,
           matnr LIKE marc-matnr,            "Material
           werks LIKE marc-werks,            "Plant     
           mmsta LIKE marc-mmsta,            "MM/PP Status
           ekgrp LIKE marc-ekgrp,            "Purchasing Group
           dispo LIKE marc-dispo,            "MRP Controller
           plifz LIKE marc-plifz,            "PDT (Planned Dlv Time)
           webaz LIKE marc-webaz,            "GRT (Goods Receipt Time)
           fevor LIKE marc-fevor,            "Production Scheduler
           insmk LIKE marc-insmk,            "Post to Inspection Stock
           ladgr LIKE marc-ladgr,            "Loading Group
           kautb LIKE marc-kautb,            "Automatic PO     Allowed
           kordb LIKE marc-kordb,            "Source List
           prctr LIKE marc-prctr,            "Profit Center
           lgpro LIKE marc-lgpro,            "Issue Storage Location
           abcin LIKE marc-abcin,            "Cycle Count Phys Inventory Ind
           sernp LIKE marc-sernp,            "Serial Number Profile
           lgfsb LIKE marc-lgfsb,            "Stor Loc for External Procure
           END OF i_marc.
    STRUCTURES DECLARATION
    DATA: BEGIN OF wf_msg.
            INCLUDE STRUCTURE bdcmsgcoll.
    DATA: END OF wf_msg.
    DATA : BEGIN OF rec_marc,
           matnr(18),
           z_delim1(1),
           werks(4),
           z_delim2(1),
           mmsta(2),
           z_delim3(1),
           ekgrp(3),
           z_delim4(1),
           dispo(3),
           z_delim5(1),
           plifz(3),
           z_delim6(1),
           webaz(3),
           z_delim7(1),
           fevor(3),
           z_delim8(1),
           insmk(1),
           z_delim9(1),
           ladgr(4),
           z_delim10(1),
           kautb(1),
           z_delim11(1),
           kordb(1),
           z_delim12(1),
           prctr(10),
           z_delim13(1),
           lgpro(4),
           z_delim14(1),
           abcin(1),
           z_delim15(1),
           sernp(4),
           z_delim16(1),
           lgfsb(4),
           z_delim17(1),
           END OF rec_marc.
    VARIABLES DECLARATION
      DATA: w_lines   like sy-tabix,
            w_records like sy-tabix.
    ****DELIMETERS DECLARATION
      DATA: p_del  type c  value ',',        "delimeter
            p_del1 type c  value ';'.        "delimeter
    SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS:
      s_matnr FOR marc-matnr,
      s_werks FOR marc-werks,
      s_mmsta FOR marc-mmsta,
      s_ekgrp FOR marc-ekgrp,
      s_dispo FOR marc-dispo,
      s_plifz FOR marc-plifz,
      s_webaz FOR marc-webaz,
      s_fevor FOR marc-fevor,
      s_insmk FOR marc-insmk,
      s_ladgr FOR marc-ladgr,
      s_kautb FOR marc-kautb,
      s_kordb FOR marc-kordb,
      s_prctr FOR marc-prctr,
      s_lgpro FOR marc-lgpro,
      s_abcin FOR marc-abcin,
      s_sernp FOR marc-sernp,
      s_lgfsb FOR marc-lgfsb.
    SELECTION-SCREEN END OF BLOCK blk1.
    SELECTION SCREEN FOR DOWN LOAD OPTION
    SELECTION-SCREEN BEGIN OF BLOCK blk2 WITH FRAME TITLE text-002.
    PARAMETERS:
      r_list  radiobutton group a1,
    p_del   default ',',                  "delimeter
    DATA: p_filePC TYPE rlgrap-filename value 'C:\zmarc.xls',
          typ TYPE rlgrap-filetype value 'DAT',
          fname TYPE rlgrap-filename,
          ftype TYPE rlgrap-filetype,
          fsize TYPE i.
    SELECTION-SCREEN END OF BLOCK blk2.
    START-OF-SELECTION
    START-OF-SELECTION.
      PERFORM get_data.
    END-OF-SELECTION
    END-OF-SELECTION.
    if r_list = 'X'.
        PERFORM output_list.
      elseif r_dldPC = 'X'.
        PERFORM download_file_PC.
      endif.
    *&      Form  get_data
          Get data from table MARC
    FORM get_data.
    CLEAR: i_marc. REFRESH: i_marc.
      SELECT matnr
             werks
             mmsta
             ekgrp
             dispo
             plifz
             webaz
             fevor
             insmk
             ladgr
             kautb
             kordb
             prctr
             lgpro
             abcin
             sernp
             lgfsb
        INTO TABLE i_marc
           FROM marc
             WHERE matnr IN s_matnr
             AND werks IN s_werks
             AND mmsta IN s_mmsta
             AND ekgrp IN s_ekgrp
             AND dispo IN s_dispo
             AND plifz IN s_plifz
             AND webaz IN s_webaz
             AND fevor IN s_fevor
             AND insmk IN s_insmk
             AND ladgr IN s_ladgr
             AND kautb IN s_kautb
             AND kordb IN s_kordb
             AND prctr IN s_prctr
             AND lgpro IN s_lgpro
             AND abcin IN s_abcin
             AND sernp IN s_sernp
             AND lgfsb IN s_lgfsb.
    ENDFORM.                    " get_data
    *&      Form  output_list
          Output List with Column Headings
    FORM output_list.
      CLEAR: w_lines.
      DESCRIBE TABLE i_marc LINES w_lines.
      if w_lines gt 0.
        ULINE.
        WRITE:/28  'MM/PP',
              38  'MRP',
              48  'Prod',
              58  'Purch',
              68  'Profit',
              80  'Planned',
              92  'GR',
              100 'Post to',
              114 'Auto',
              122 'Source',
              132 'Issue',
              140 'CC Phys',
              150 'Loading',
              160 'Serial No',
              172 'SLoc'.
        WRITE:/1  'Material',
              20  'Plant',
              28  'Status',
              38  'Ctrlr',
              48  'Sched',
              58  'Grp',
              68  'Ctr',
              80  'Dlv. Time',
              92  'Time',
              100 'Insp. Stock',
              114 'PO',
              122 'List',
              132 'SLoc',
              140 'Indicator',
              150 'Group',
              160 'Profile',
              172 'for EP'.
        ULINE.
        LOOP AT i_marc.
          WRITE:/   i_marc-matnr,
                20  i_marc-werks.
          set left scroll-boundary." Added to keep the left 2 columns fixed
                                   while viewing the list online
          WRITE:28  i_marc-mmsta,
                38  i_marc-dispo,
                48  i_marc-fevor,
                58  i_marc-ekgrp,
                68  i_marc-prctr,
                80  i_marc-plifz,
                92  i_marc-webaz,
                100 i_marc-insmk,
                114 i_marc-kautb,
                122 i_marc-kordb,
                132 i_marc-lgpro,
                140 i_marc-abcin,
                150 i_marc-ladgr,
                160 i_marc-sernp,
                172 i_marc-lgfsb.
        ENDLOOP.
        ULINE.
      endif.
    ENDFORM.                    " output_list
    *&      Form  download_file_PC
          Download file to Local directory on PC
    FORM download_file_PC.
    CLEAR: w_lines, w_records.
      DESCRIBE TABLE i_marc LINES w_lines.
      if w_lines gt 0.
    Download file
        PERFORM open_file using p_filePC.
        PERFORM output_file_PC.
        PERFORM close_file using p_filePC.
        PERFORM write_summary.
      endif.
    ENDFORM.                    " download_file_PC
    *&      Form  write_summary
    FORM write_summary.
      write : / '******************************************************'.
    write : / '****     PROGRAM IS ENDED SUCCESSFULLY           **'.0001-
      write : / '****   PROGRAM HAS ENDED SUCCESSFULLY         *****'."0001+
      write : / '******************************************************'.
      skip.
      write : /  'No. of recds written  :', 38 w_records.
      skip.
      if r_dldUx = 'X'.
        write : /  'Output file name : ' , p_fileUX.
      elseif r_dldPC = 'X'.
        write : /  'Output file name : ' , p_filePC.
      endif.
      skip.
      write : / '******************************************************'.
    ENDFORM.                    " write_summary
    *&      Form  open_file
          text
         -->P_P_FILEUX  text
    FORM open_file USING output_file.
      OPEN DATASET output_file FOR OUTPUT IN TEXT MODE.
      if sy-subrc <> 0.
    Send technical message
        CLEAR wf_msg.
        wf_msg-msgid  = 'ZB'.
        wf_msg-msgnr  = '003'.
        wf_msg-msgtyp = 'E'.
        wf_msg-msgv1  = output_file.
        CALL FUNCTION 'Z_ERROR'
             EXPORTING
                  msg    = wf_msg
                  pid    = sy-cprog
             EXCEPTIONS
                  others = 1.
      endif.
    ENDFORM.                    " open_file
    *&      Form  close_file
          Close File
    FORM close_file USING    output_file.
      close dataset output_file.
      if sy-subrc <> 0.
    Send technical message
        clear wf_msg.
        wf_msg-msgid  = 'Z3'.
        wf_msg-msgnr  = '003'.
        wf_msg-msgtyp = 'E'.
        wf_msg-msgv1  = output_file.
        call function 'Z_ERROR'
             EXPORTING
                  msg    = wf_msg
                  pid    = sy-cprog
             EXCEPTIONS
                  others = 1.
      endif.
    ENDFORM.                    " close_file
    *&      Form  output_file_PC
          Write Data to Local PC File
    FORM output_file_PC.
    DATA: BEGIN OF i_PCFile OCCURS 0,
              rec(2000) TYPE C,
          END OF i_PCFile.
      data: dload_record(1000).
      DATA: flength TYPE i.
    Transfer Header Line
      clear: dload_record.
      concatenate 'Material' 'Plant' 'MM/PP Status' 'Purch Grp.' 'MRP Ctrl.'
                  'Planned Dlv. Time' 'GR Time' 'Prod Sched'
                  'Post to Insp. Stock''Loading Group''Auto PO'
                  'Source List''Profit Ctr.' 'Issue SLoc''CC Phys Indicator'
                  'Serial No Profile' 'SLoc for EP'
                   into dload_record
                   separated by p_del.
      condense dload_record no-gaps.
      i_PCFile-rec = dload_record.
      append i_PCFile.
      clear i_PCFile.
    Transfer Data
      loop at i_marc.
        w_records = w_records + 1.
        clear: rec_marc, dload_record.
        move-corresponding i_marc to rec_marc.
        move p_del to:  rec_marc-z_delim1, rec_marc-z_delim2,
                        rec_marc-z_delim3, rec_marc-z_delim4,
                        rec_marc-z_delim5, rec_marc-z_delim6,
                        rec_marc-z_delim7, rec_marc-z_delim8,
                        rec_marc-z_delim9, rec_marc-z_delim10,
                        rec_marc-z_delim11,rec_marc-z_delim12,
                        rec_marc-z_delim13,rec_marc-z_delim14,
                        rec_marc-z_delim15,rec_marc-z_delim16,
                        rec_marc-z_delim17.
        move rec_marc to dload_record.
        condense dload_record no-gaps.
        i_PCFile-rec = dload_record.
        append i_PCFile.
        clear i_PCFile.
      endloop.
      IF p_filePC NE SPACE.
        CALL FUNCTION 'DOWNLOAD'
             EXPORTING
                  filename            = p_filePC
                  filetype            = typ
             IMPORTING
                  act_filename        = fname
                  act_filetype        = ftype
                  filesize            = fsize
             TABLES
                  data_tab            = i_PCFile
             EXCEPTIONS
                  invalid_filesize    = 1
                  invalid_table_width = 2.
        IF SY-SUBRC NE 0.
          WRITE 'File can not be opened'.
        ENDIF.
    Begin 0001+
      Set PC Filename to whatever is returned from the Function Module, to
      display later
        p_filePC = fname.
    End 0001+
      ELSE.
        WRITE:/ 'Please Enter File Name'.
      ENDIF.
    ENDFORM.                    " output_file_PC
    if it helps please reward points
    Regards
    Prabhakar

  • Unable to download the data perfectly into excel sheet

    Hi Frnds,
    when i am trying to download the data from the output of a report into excel, some of the records(line items/rows) are getting stored in one of column of the excel sheet. Fog eg: my report outputs 500 line items. In excel after 100 rows the next 5-10 records/rows are storing in one column. so at the end of excel sheet i may not find total 500 records/line items.
    Plz suggest me how to handle this.
    Thnks,
    Pavan

    *& Report  ZETA_EXCEL_DOWNLOAD_CLIPBOARD                               *
    report  zeta_excel_download_clipboard           .
    include ole2incl.
    data:  w_cell1     type ole2_object,
           w_cell2     type ole2_object.
    *--- Ole data Declarations
    data: h_excel     type ole2_object,        " Excel object
          h_mapl      type ole2_object,        " list of workbooks
          h_map       type ole2_object,        " workbook
          h_zl        type ole2_object,        " cell
          h_f         type ole2_object,        " font
          gs_interior type ole2_object,        " Pattern
          worksheet   type ole2_object,
          h_cell      type ole2_object,
          h_cell1     type ole2_object,
          range       type ole2_object,
          h_sheet2    type ole2_object,
          h_sheet3    type ole2_object,
          gs_font     type ole2_object,
          flg_stop(1) type c.
              Internal table Declaration
    data: begin of t_excel occurs 0,
    vkorg(20) type c, "Sales Org
    vbtyp(20) type c, "Document Category
    auart(20) type c, "Document Type
    ernam(20) type c, "Created By
    vbeln(20) type c, "Document Number
    posnr(20) type c, "Item Number
    erdat(20) type c, "Created Date
    vdatu(20) type c, "Header Requested Delivery Date
    reqdat(20) type c, "Request date
    condat(20) type c, "Confirm date
    lifsk(20) type c, "Header Block
    txt30(30) type c, "Order User Status Description
    lifsp(20) type c, "Line Block
    dispo(20) type c, "MRP Controller
    dsnam(20) type c, "MRP Controller Description
    vmsta(20) type c, "Material Sales Status
    kunnr(20) type c, "Sold To
    cname(35) type c, "Sold To Name
    regio(20) type c, "State
    cufd(10) type c, "CUD
    bstnk(20) type c, "PO#
    bsark(20) type c, "Ordering Method
    matnr(20) type c, "Material
    maktx(35) type c, "Material Description
    t200(20) type c, "T200
    vtext(20) type c, "T200 Description
    matkl(20) type c, "Material Group
    zzbomind(7) type c, "BOM Indicator
    ostat(20) type c, "Order Status
    cmgst(20) type c, "CRD
    inco1(20) type c, "Incoterms
    oqty(20) type c, "Order Quantity
    pqty(20) type c, "Open Quantity
    unit(20) type c, "UOM
    onet(20) type c, "Order Value
    pnet(20) type c, "Open Value
    curr(20) type c, "Currency key
    so_bezei like tvkbt-bezei,"Sales Office
    sg_bezei like tvgrt-bezei,"Sales Group
    bname(20) type c, "Ordering Party
    contact(20) type c, "Contact Name
    telf1(20) type c, "Contact telf1
    reqqty(20) type c, "Item Request qty
    reqval(20) type c, "Item Request value
    conqty(20) type c, "Item Confirm qty
    conval(20) type c, "Item Confirm value
    zzrev(02) type c, "Revenue recognition acceptance
    bezei(20) type c, "Revenue recognition text
    vgbel(20) type c, "Reference Order for RETURNS
    0008text(255) type c, "Internal Order Comment Text
    end of t_excel.
    data: t_excel_bckord like t_excel occurs 0 with header line,
          t_excel_bcklog like t_excel occurs 0 with header line,
          t_excel_blkord like t_excel occurs 0 with header line.
      types: data1(1500) type c,
             ty          type table of data1.
      data:  it          type ty with header line,
    it_2          type ty with header line,
    it_3          type ty with header line,
             rec         type sy-tfill,
             deli(1)     type c,
             l_amt(18)   type c.
    data: begin of hex,
             tab type x,
            end of hex.
      field-symbols: <fs>      .
      constants cns_09(2) type n value 09.
      assign deli to <fs> type 'X'.
      hex-tab = cns_09.
      <fs> = hex-tab.
    data gv_sheet_name(20) type c .
    M A C R O Declaration
    define ole_check_error.
      if &1 ne 0.
        message e001(zz) with &1.
        exit.
      endif.
    end-of-definition.
    t_excel_bckord-vkorg = 'ABC'.
    t_excel_bckord-vbtyp = 'DEF'.
    t_excel_bckord-auart = 'GHI'.
    t_excel_bckord-ernam = 'JKL'.
    t_excel_bckord-vbeln = 'MNO'.
    t_excel_bckord-0008text = 'XYZ'.
    append t_excel_bckord.
    t_excel_bckord-vkorg = 'ABC1'.
    t_excel_bckord-vbtyp = 'DEF1'.
    t_excel_bckord-auart = 'GHI1'.
    t_excel_bckord-ernam = 'JKL1'.
    t_excel_bckord-vbeln = 'MNO1'.
    t_excel_bckord-0008text = 'XYZ1'.
    append t_excel_bckord.
    t_excel_bckord-vkorg = 'ABC2'.
    t_excel_bckord-vbtyp = 'DEF2'.
    t_excel_bckord-auart = 'GHI2'.
    t_excel_bckord-ernam = 'JKL2'.
    t_excel_bckord-vbeln = 'MNO2'.
    t_excel_bckord-0008text = 'XYZ2'.
    append t_excel_bckord.
    t_excel_bcklog-vkorg = 'ABC'.
    t_excel_bcklog-vbtyp = 'DEF'.
    t_excel_bcklog-auart = 'GHI'.
    t_excel_bcklog-ernam = 'JKL'.
    t_excel_bcklog-vbeln = 'MNO'.
    t_excel_bcklog-0008text = 'XYZ'.
    append t_excel_bcklog.
    t_excel_bcklog-vkorg = 'ABC1'.
    t_excel_bcklog-vbtyp = 'DEF1'.
    t_excel_bcklog-auart = 'GHI1'.
    t_excel_bcklog-ernam = 'JKL1'.
    t_excel_bcklog-vbeln = 'MNO1'.
    t_excel_bcklog-0008text = 'XYZ1'.
    append t_excel_bcklog.
    t_excel_bcklog-vkorg = 'ABC2'.
    t_excel_bcklog-vbtyp = 'DEF2'.
    t_excel_bcklog-auart = 'GHI2'.
    t_excel_bcklog-ernam = 'JKL2'.
    t_excel_bcklog-vbeln = 'MNO2'.
    t_excel_bcklog-0008text = 'XYZ2'.
    append t_excel_bcklog.
    t_excel_bcklog-vkorg = 'ABC3'.
    t_excel_bcklog-vbtyp = 'DEF3'..
    t_excel_bcklog-auart = 'GHI3'.
    t_excel_bcklog-ernam = 'JKL3'.
    t_excel_bcklog-vbeln = 'MNO3'.
    t_excel_bcklog-0008text = 'XYZ3'.
    append t_excel_bcklog.
    t_excel_blkord-vkorg = 'ABC'.
    t_excel_blkord-vbtyp = 'DEF'.
    t_excel_blkord-auart = 'GHI'.
    t_excel_blkord-ernam = 'JKL'.
    t_excel_blkord-vbeln = 'MNO'.
    t_excel_blkord-0008text = 'XYZ'.
    append t_excel_blkord.
    t_excel_blkord-vkorg = 'ABC1'.
    t_excel_blkord-vbtyp = 'DEF1'.
    t_excel_blkord-auart = 'GHI1'.
    t_excel_blkord-ernam = 'JKL1'.
    t_excel_blkord-vbeln = 'MNO1'.
    t_excel_blkord-0008text = 'XYZ1'.
    append t_excel_blkord.
    t_excel_blkord-vkorg = 'ABC2'.
    t_excel_blkord-vbtyp = 'DEF2'.
    t_excel_blkord-auart = 'GHI2'.
    t_excel_blkord-ernam = 'JKL2'.
    t_excel_blkord-vbeln = 'MNO2'.
    t_excel_blkord-0008text = 'XYZ2'.
    append t_excel_blkord.
    t_excel_blkord-vkorg = 'ABC3'.
    t_excel_blkord-vbtyp = 'DEF3'..
    t_excel_blkord-auart = 'GHI3'.
    t_excel_blkord-ernam = 'JKL3'.
    t_excel_blkord-vbeln = 'MNO3'.
    t_excel_blkord-0008text = 'XYZ3'.
    append t_excel_blkord.
    t_excel_blkord-vkorg = 'ABC4'.
    t_excel_blkord-vbtyp = 'DEF4'..
    t_excel_blkord-auart = 'GHI4'.
    t_excel_blkord-ernam = 'JKL4'.
    t_excel_blkord-vbeln = 'MNO4'.
    t_excel_blkord-0008text = 'XYZ4'.
    append t_excel_blkord.
    loop at t_excel_bckord.
    concatenate
    t_excel_bckord-vkorg
    t_excel_bckord-vbtyp
    t_excel_bckord-auart
    t_excel_bckord-ernam
    t_excel_bckord-vbeln
    t_excel_bckord-posnr
    t_excel_bckord-erdat
    t_excel_bckord-vdatu
    t_excel_bckord-reqdat
    t_excel_bckord-condat
    t_excel_bckord-lifsk
    t_excel_bckord-txt30
    t_excel_bckord-lifsp
    t_excel_bckord-dispo
    t_excel_bckord-dsnam
    t_excel_bckord-vmsta
    t_excel_bckord-kunnr
    t_excel_bckord-cname
    t_excel_bckord-regio
    t_excel_bckord-cufd
    t_excel_bckord-bstnk
    t_excel_bckord-bsark
    t_excel_bckord-matnr
    t_excel_bckord-maktx
    t_excel_bckord-t200
    t_excel_bckord-vtext
    t_excel_bckord-matkl
    t_excel_bckord-zzbomind
    t_excel_bckord-ostat
    t_excel_bckord-cmgst
    t_excel_bckord-inco1
    t_excel_bckord-oqty
    t_excel_bckord-pqty
    t_excel_bckord-unit
    t_excel_bckord-onet
    t_excel_bckord-pnet
    t_excel_bckord-curr
    t_excel_bckord-so_bezei
    t_excel_bckord-sg_bezei
    t_excel_bckord-bname
    t_excel_bckord-contact
    t_excel_bckord-telf1
    t_excel_bckord-reqqty
    t_excel_bckord-reqval
    t_excel_bckord-conqty
    t_excel_bckord-conval
    t_excel_bckord-zzrev
    t_excel_bckord-bezei
    t_excel_bckord-vgbel
    t_excel_bckord-0008text
    into it
    separated by deli.
    append it.
        clear it.
    endloop.
    loop at t_excel_bcklog.
    concatenate
    t_excel_bcklog-vkorg
    t_excel_bcklog-vbtyp
    t_excel_bcklog-auart
    t_excel_bcklog-ernam
    t_excel_bcklog-vbeln
    t_excel_bcklog-posnr
    t_excel_bcklog-erdat
    t_excel_bcklog-vdatu
    t_excel_bcklog-reqdat
    t_excel_bcklog-condat
    t_excel_bcklog-lifsk
    t_excel_bcklog-txt30
    t_excel_bcklog-lifsp
    t_excel_bcklog-dispo
    t_excel_bcklog-dsnam
    t_excel_bcklog-vmsta
    t_excel_bcklog-kunnr
    t_excel_bcklog-cname
    t_excel_bcklog-regio
    t_excel_bcklog-cufd
    t_excel_bcklog-bstnk
    t_excel_bcklog-bsark
    t_excel_bcklog-matnr
    t_excel_bcklog-maktx
    t_excel_bcklog-t200
    t_excel_bcklog-vtext
    t_excel_bcklog-matkl
    t_excel_bcklog-zzbomind
    t_excel_bcklog-ostat
    t_excel_bcklog-cmgst
    t_excel_bcklog-inco1
    t_excel_bcklog-oqty
    t_excel_bcklog-pqty
    t_excel_bcklog-unit
    t_excel_bcklog-onet
    t_excel_bcklog-pnet
    t_excel_bcklog-curr
    t_excel_bcklog-so_bezei
    t_excel_bcklog-sg_bezei
    t_excel_bcklog-bname
    t_excel_bcklog-contact
    t_excel_bcklog-telf1
    t_excel_bcklog-reqqty
    t_excel_bcklog-reqval
    t_excel_bcklog-conqty
    t_excel_bcklog-conval
    t_excel_bcklog-zzrev
    t_excel_bcklog-bezei
    t_excel_bcklog-vgbel
    t_excel_bcklog-0008text
    into it_2
    separated by deli.
    append it_2.
        clear it_2.
    endloop.
    loop at t_excel_blkord.
    concatenate
    t_excel_blkord-vkorg
    t_excel_blkord-vbtyp
    t_excel_blkord-auart
    t_excel_blkord-ernam
    t_excel_blkord-vbeln
    t_excel_blkord-posnr
    t_excel_blkord-erdat
    t_excel_blkord-vdatu
    t_excel_blkord-reqdat
    t_excel_blkord-condat
    t_excel_blkord-lifsk
    t_excel_blkord-txt30
    t_excel_blkord-lifsp
    t_excel_blkord-dispo
    t_excel_blkord-dsnam
    t_excel_blkord-vmsta
    t_excel_blkord-kunnr
    t_excel_blkord-cname
    t_excel_blkord-regio
    t_excel_blkord-cufd
    t_excel_blkord-bstnk
    t_excel_blkord-bsark
    t_excel_blkord-matnr
    t_excel_blkord-maktx
    t_excel_blkord-t200
    t_excel_blkord-vtext
    t_excel_blkord-matkl
    t_excel_blkord-zzbomind
    t_excel_blkord-ostat
    t_excel_blkord-cmgst
    t_excel_blkord-inco1
    t_excel_blkord-oqty
    t_excel_blkord-pqty
    t_excel_blkord-unit
    t_excel_blkord-onet
    t_excel_blkord-pnet
    t_excel_blkord-curr
    t_excel_blkord-so_bezei
    t_excel_blkord-sg_bezei
    t_excel_blkord-bname
    t_excel_blkord-contact
    t_excel_blkord-telf1
    t_excel_blkord-reqqty
    t_excel_blkord-reqval
    t_excel_blkord-conqty
    t_excel_blkord-conval
    t_excel_blkord-zzrev
    t_excel_blkord-bezei
    t_excel_blkord-vgbel
    t_excel_blkord-0008text
    into it_3
    separated by deli.
    append it_3.
        clear it_3.
    endloop.
      if h_excel-header = space or h_excel-handle = -1.
    start Excel
        create object h_excel 'EXCEL.APPLICATION'.
      endif.
    PERFORM err_hdl.
    *--- get list of workbooks, initially empty
      call method of h_excel 'Workbooks' = h_mapl.
    PERFORM err_hdl.
      set property of h_excel 'Visible' = 1.
    add a new workbook
      call method of h_mapl 'Add' = h_map.
    PERFORM err_hdl.
    *GV_SHEET_NAME = '1st SHEET'.
    gv_sheet_name = 'Back Orders'.
      get property of  h_excel 'ACTIVESHEET' = worksheet.
    set property of worksheet 'Name' = gv_sheet_name .
    *--Formatting the area of additional data 1 and doing the BOLD
    call method of h_excel 'Cells' = w_cell1
    exporting
    #1 = 1
    #2 = 1.
    call method of h_excel 'Cells' = w_cell2
    exporting
    #1 = 1
    #2 = 50.
    call method of h_excel 'Range' = h_cell
    exporting
    #1 = w_cell1
    #2 = w_cell2.
    *CALL METHOD OF gs_cells 'Select' .
    get property of h_cell 'Font' = gs_font .
    set property of gs_font 'Bold' = 1 .
            data l_rc type i.
      call method cl_gui_frontend_services=>clipboard_export
        importing
          data                 = it[]
        changing
          rc                   = l_rc
        exceptions
          cntl_error           = 1
          error_no_gui         = 2
          not_supported_by_gui = 3
          others               = 4.
      call method of h_excel 'Cells' = w_cell1
        exporting
          #1 = 1
          #2 = 1.
      call method of h_excel 'Cells' = w_cell2
        exporting
          #1 = 1
          #2 = 1.
    PERFORM err_hdl.
       call method of h_excel 'Range' = range
        exporting
          #1 = w_cell1
          #2 = w_cell2.
      call method of range 'Select'.
    PERFORM err_hdl.
      call method of worksheet 'Paste'.
    PERFORM err_hdl.
    CALL METHOD OF h_excel 'QUIT'.
    *GV_SHEET_NAME = '2ND SHEET'.
    gv_sheet_name = 'Backlog'.
    get property of h_excel 'Sheets' = h_sheet2 .
      call method of h_sheet2 'Add' = h_map.
    set property of h_map 'Name' = gv_sheet_name .
      get property of  h_excel 'ACTIVESHEET' = worksheet.
    *--Formatting the area of additional data 1 and doing the BOLD
    call method of h_excel 'Cells' = w_cell1
    exporting
    #1 = 1
    #2 = 1.
    call method of h_excel 'Cells' = w_cell2
    exporting
    #1 = 1
    #2 = 50.
    call method of h_excel 'Range' = h_cell
    exporting
    #1 = w_cell1
    #2 = w_cell2.
    get property of h_cell 'Font' = gs_font .
    set property of gs_font 'Bold' = 1 .
      call method cl_gui_frontend_services=>clipboard_export
        importing
          data                 = it_2[]
        changing
          rc                   = l_rc
        exceptions
          cntl_error           = 1
          error_no_gui         = 2
          not_supported_by_gui = 3
          others               = 4.
      call method of h_excel 'Cells' = w_cell1
        exporting
          #1 = 1
          #2 = 1.
      call method of h_excel 'Cells' = w_cell2
        exporting
          #1 = 1
          #2 = 1.
    PERFORM err_hdl.
       call method of h_excel 'Range' = range
        exporting
          #1 = w_cell1
          #2 = w_cell2.
      call method of range 'Select'.
    PERFORM err_hdl.
      call method of worksheet 'Paste'.
    *GV_SHEET_NAME = '3rd SHEET'.
    gv_sheet_name = 'Blocked Orders'.
    get property of h_excel 'Sheets' = h_sheet3 .
      call method of h_sheet3 'Add' = h_map.
    set property of h_map 'Name' = gv_sheet_name .
      get property of  h_excel 'ACTIVESHEET' = worksheet.
    *--Formatting the area of additional data 1 and doing the BOLD
    call method of h_excel 'Cells' = w_cell1
    exporting
    #1 = 1
    #2 = 1.
    call method of h_excel 'Cells' = w_cell2
    exporting
    #1 = 1
    #2 = 50.
    call method of h_excel 'Range' = h_cell
    exporting
    #1 = w_cell1
    #2 = w_cell2.
    get property of h_cell 'Font' = gs_font .
    set property of gs_font 'Bold' = 1 .
      call method cl_gui_frontend_services=>clipboard_export
        importing
          data                 = it_3[]
        changing
          rc                   = l_rc
        exceptions
          cntl_error           = 1
          error_no_gui         = 2
          not_supported_by_gui = 3
          others               = 4.
      call method of h_excel 'Cells' = w_cell1
        exporting
          #1 = 1
          #2 = 1.
      call method of h_excel 'Cells' = w_cell2
        exporting
          #1 = 1
          #2 = 1.
    PERFORM err_hdl.
       call method of h_excel 'Range' = range
        exporting
          #1 = w_cell1
          #2 = w_cell2.
      call method of range 'Select'.
    PERFORM err_hdl.
      call method of worksheet 'Paste'.
    *--- disconnect from Excel
      free object h_zl.
      free object h_mapl.
      free object h_map.
      free object h_excel.

  • Download greater than 255 characters from alv into excel sheet

    Hi,
    I have an ALV grid display report where the last field contains close to 600 characters of text.
    When I use the Export -> Local File -> Spreadsheet option and save it in an excel sheet, only first 255 characters are getting downloaded into excelsheet and rest is not gettting downloaded.
    Solution I have is: Keep a button on the screen. If that button is clicked, use GUI_DOWNLOAD FM  and the entire text (all 600 chars) gets downloaded.
    Is there any other solution to the above problem?
    I tried downloading the alv report into XML format and opened as an excel document, but even then only first 255 characters are apearing in excel cell.
    The domain has length 2048 chars for the final internal table in alv, so there is no problem with data element or domain.
    OIn debugging mode, I am able to see all the 600 chars in the final internal table before alv display.
    It looks like there is a constraint in alv that is can display only 255 characters in a cell.
    ALso, I tried converting the grid display to list display and then download into excel , but the result is same.
    Please help.

    please search first:
    http://www.sdn.sap.com/irj/scn/advancedsearch;jsessionid=%28J2EE3417400%29ID0634234250DB10563517489488469157End?query=downloadmorethan255char

  • Downloading records in in excel sheet from ALV.

    Hi,
    I am downloading Records from ALV GRID DIsplay to Excel sheet but i am unable to get all records that are displayed in ALV report.
    I am getting only 73 records if i have only 180
    Any inputs please for correctine the error
    Regards
    Rasheed.

    hi
    you can follow these stapes and get ur work done
    go to List > select Export  > Spreadsheet or just click the excel icon from the tool bar.This would download the data to excel.
    hope this helps
    regards
    Aakash Banga

  • How to download the ALV output with colors into the excel sheet

    Hi,
      I'm having an ALV Grid report output where each and every row has some colors in it. When i download it to an excel sheet whatever the colors that comes on the output of the report the same should come in the excel sheet. When i download the output to an excel sheet using List --> Export -->Local file . If i open the excel files no colors are coming in the excel sheet.
    can anyone tell how to get the colors in the excel sheet also. thanks...
    Regards,
    Rose.

    Hi Camila,
    Use the OLE concept.
    Check the below threads:
    Colors in Excel Sheet
    colors in alv
    Regards,
    Soumya.

  • Avoid splitting of columns ALV report while download output to Excel sheet

    Hi friends,
                  I have 170 columns in my ALV report
    while downloading the report to Excel sheet
    the column descriptions and values are splitting in two lines.
    How can i avoid the problem.
    before calling REUSE_ALV_GRID_DISPLAY function module in my code
    for the Layout i assigned LS_LAYOUT-MAX_SIZE = 1023.
    but still the problem is not solved.
    Please help me in this Issue.
    Thanks in Advance,
    Ganesh

    Hi friends,
    I dont want to use and Keyboard shiftcntrl....
    or dont want to change any code in ALV report
    by simply assigning some value to any of the export parameter in ALV function module
    can we achieve the functionality
    Thanks in Advance,
    Ganesh

Maybe you are looking for

  • Invalid Number exception

    Hi experts, I have a very strange problem. I have a query to which I am binding a value. The datatype of the value is number. Whenever I am executing the VO for the second time it is throwing ORA-01722: invalid number exception. The value that is bei

  • In Adobe premiere elements 12 it wont let me add a m4a file. It says that "the importer reported a generic error". Please help.

    please help, I need to make a video and cant get in my music.

  • Data recovery from a disk that is unmounted

    Here is my problem: disk utility had indicated that I had a couple of bad blocks in my start up disk and recommended that it be replaced. Since I already had a second internal hard drive with plenty of room on it, I simply installed OS 10.4 on the se

  • ADF & Spring: Application Module

    Hi! Im testing a mix of ADF and Spring. I create an Bean in the Spring Context that is an ApplicationModule <bean id="myAM" class="oracle.jbo.client.Configuration" factory-method="createRootApplicationModule"> <constructor-arg><value>mypkg.myAM</valu

  • Opne hub (info spoke) delta reset

    hi gurus, how to reset the infospoke delta becoz when i was loading to infospoke it has failed due to no data for selection records.the status change to red. Next day again loading to same infospoke ( daily load) becoz of that red status again it fai