Hi: working with excel sheet

HI,
   Please i need the code to activate the excel worksheet
cells after dowloading it to the desktop. I will appreciate your help.
rgs
p.kp

Hi,
<b>Demo Program</b>
RSOLETT1
RSDEMO01
XXLTTEST
XXLSTEST
XXLFTEST
Check this source Code ; Hope it helps
REPORT  y_man_excel                             .
* this report demonstrates how to send some ABAP data to an
* EXCEL sheet using OLE automation.
INCLUDE ole2incl.
* handles for OLE objects
DATA: o_excel       TYPE ole2_object,        " Excel object
      o_workbooks   TYPE ole2_object,         " list of workbooks
      o_worksheet   TYPE ole2_object,          " workbook
      h_zl TYPE ole2_object,           " cell
      h_f TYPE ole2_object.            " font
TYPES: BEGIN OF ty_header,
          create_date  TYPE char20 ,
          nomship_ref  TYPE char20 ,
          offer        TYPE char20 ,
          conf_ref_no  TYPE char20 ,
          con_eff_date TYPE char20 ,
          status_date  TYPE char20 ,
          rej_text     TYPE char20 ,
          trf_date     TYPE char20 ,
          mprn         TYPE char20 ,
          mprn_status  TYPE char20 ,
          mam_app      TYPE char20 ,
          open_read    TYPE char22 ,
       END OF ty_header.
CONSTANTS :
       lc_file_type  TYPE char10 VALUE 'DAT'.
DATA : lit_ty_header TYPE TABLE OF ty_header,
       wa_ty_header  LIKE LINE  OF lit_ty_header,
       lv_file_name  TYPE string.
CLEAR: lit_ty_header[],
       wa_ty_header,
       lv_file_name.
* Table of Coulumn Names.
wa_ty_header-create_date    = 'Column one' .
wa_ty_header-nomship_ref    = 'Column Two' .
wa_ty_header-offer          = 'Column there' .
wa_ty_header-conf_ref_no    = 'Column Four' .
wa_ty_header-con_eff_date   = 'Column five' .
wa_ty_header-status_date    = 'Column Six' .
wa_ty_header-rej_text       = 'Column Seven' .
wa_ty_header-trf_date       = 'Column Eight' .
wa_ty_header-mprn           = 'Column Nine' .
wa_ty_header-mprn_status    = 'Column Ten' .
wa_ty_header-mam_app        = 'Column Eleven' .
wa_ty_header-open_read      = 'Column 12' .
APPEND wa_ty_header TO lit_ty_header.
* File Name
CONCATENATE text-033
            sy-uname
            sy-datum
            sy-uzeit
            text-034
INTO lv_file_name.
CONDENSE lv_file_name.
*&   Event START-OF-SELECTION
START-OF-SELECTION.
*----start Excel
  CREATE OBJECT o_excel 'EXCEL.APPLICATION'.
*----Set non visible
  SET PROPERTY OF o_excel  'Visible' = 1.
*----get list of workbooks, initially empty
  CALL METHOD OF o_excel 'Workbooks' = o_workbooks.
  PERFORM err_hdl.
*----add a new workbook
  CALL METHOD OF o_workbooks 'Add' = o_worksheet.
*  CALL METHOD OF o_worksheet 'Activate'.
*  SET PROPERTY OF o_worksheet  'Name' = 'Page 1'.
  PERFORM err_hdl.
* output column headings to active Excel sheet
  PERFORM fill_cell USING 1 1 1 'Flug'(001).
  PERFORM fill_cell USING 1 2 0 'Nr'(002).
  PERFORM fill_cell USING 1 3 1 'Von'(003).
  PERFORM fill_cell USING 1 4 1 'Nach'(004).
  PERFORM fill_cell USING 1 5 1 'Zeit'(005).
  CALL METHOD OF o_worksheet 'SAVEAS'
    EXPORTING
      #1 = 'c:kis_excel.xls'.
  FREE OBJECT o_excel.
  PERFORM err_hdl.
*       FORM FILL_CELL                                                *
*       sets cell at coordinates i,j to value val boldtype bold       *
FORM fill_cell USING i j bold val.
  CALL METHOD OF o_excel 'Cells' = h_zl
    EXPORTING
      #1 = i
      #2 = j.
  PERFORM err_hdl.
  SET PROPERTY OF h_zl 'Value' = val .
  PERFORM err_hdl.
  GET PROPERTY OF h_zl 'Font' = h_f.
  PERFORM err_hdl.
  SET PROPERTY OF h_f 'Bold' = bold .
  PERFORM err_hdl.
ENDFORM.                    "FILL_CELL
*&      Form  ERR_HDL
*       outputs OLE error if any                                       *
*  -->  p1        text
*  <--  p2        text
FORM err_hdl.
  IF sy-subrc <> 0.
    WRITE: / 'error:-', sy-subrc.
    STOP.
  ENDIF.

Similar Messages

  • Urgent: Sending an Email with Excel sheet attachment

    Hi All,
    I am preparing a report and has to send mail with excel sheet attachement. In report i am getting everything fine. But in the mail i am not getting the data, data is passing to the FM succesfully. But in the mail, excel is not having full data.
    the below mentioned is my code.
    i_texts-line = c_stern.
      i_texts-line+254(1) = c_newline.
      APPEND i_texts.
      LOOP AT i_texc.
        i_att_line-line = i_texc.
        APPEND i_att_line.
      ENDLOOP.
      DATA: wa_doc_chng LIKE sodocchgi1.
      DATA: w_tab_lines LIKE sy-tabix.
      STATICS: c_body_start TYPE i VALUE '1'.
      CONSTANTS: lc_filename(10) TYPE c VALUE 'Attachment',
                 lc_atthead(30)  TYPE c VALUE 'Manually released invoices'.
      DATA: i_objpack LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE.
      DATA: w_doc_name(30) TYPE c.
      DATA: l_text1(15),
            l_text2(12),
            l_text3(15),
            l_text4(15),
            l_text5(14),
            l_text6(17),
            l_text7(10),
            l_text8(20),
            l_text9(19),
            l_text10(19),
            l_text11(19),
            l_text12(16),
            l_text13(20),
            l_text14(19),
            l_text15(19),
            l_text16(30).
      DATA: DATE(10),
            DT(2),
            MON(3),
            YR(4),
            lc_final(50).
      CLEAR: i_texts, i_reci,i_att_line.                "i_bname,
      REFRESH: i_texts, i_reci,i_att_line.              "i_bname,
      WRITE sy-datum TO w_datex.
      WRITE sy-uzeit TO w_timex.
      l_text1 = text-003.
      l_text2 = text-004.
      l_text3 = text-005.
      l_text4 = text-006.
      l_text5 = text-007.
      l_text6 = text-008.
      l_text7 = text-009.
      l_text8 = text-010.
      l_text9 = text-011.
      l_text10 = text-012.
      l_text11 = text-013.
      l_text12 = text-014.
      l_text13 = text-015.
      l_text14 = text-016.
      l_text15 = text-017.
      l_text16 = text-026.
      CONCATENATE
      l_text1
      l_text2
      l_text3
      l_text4
      l_text5
      l_text6
      l_text7
      l_text8
      l_text9
      l_text10
      l_text11
      l_text12
      l_text13
      l_text14
      l_text15
      l_text16
      INTO i_texts SEPARATED BY
      c_horz_tab.
      i_texts-line+254(1) = c_newline.
      APPEND i_texts.
      CLEAR  i_texts.
      LOOP AT i_texc.
        i_att_line-line = i_texc.
        APPEND i_att_line.
      ENDLOOP.
      LOOP AT so_rec.
        i_reci-receiver = so_rec-low.
        i_reci-express = 'X'.
        i_reci-rec_type = 'U'.
        APPEND i_reci.
      ENDLOOP.
      DESCRIBE TABLE i_texts LINES w_tab_lines.
      READ TABLE i_texts INDEX w_tab_lines.
      wa_doc_chng-doc_size = ( w_tab_lines - 1 ) * 255 + STRLEN( i_texts ).
      wa_obj_name   = 'ZFI_XX_REL_BLOCKED_INVOICE_01'.
      DT  = SY-DATUM+6(2).
      MON = SY-DATUM+4(2).
      YR  = SY-DATUM+0(4).
      CONCATENATE DT MON YR INTO DATE SEPARATED BY '-'.
      CONCATENATE lc_atthead date into lc_final separated by ' '.
      MOVE lc_final
                   TO wa_obj_descr .
      wa_doc_chng-obj_name  = wa_obj_name.
      wa_doc_chng-obj_descr = wa_obj_descr.
      CLEAR i_objpack-transf_bin.
      i_objpack-head_start = 1.
      i_objpack-head_num = 0.
      i_objpack-body_start = 0.
      i_objpack-body_num = w_tab_lines.
      i_objpack-doc_type = 'RAW'.
      APPEND i_objpack.
      APPEND LINES OF i_att_line TO i_texts.
      LOOP AT i_arseg INTO wa_arseg.
        i_xmplt_d-belnr = wa_arseg-belnr.
        i_xmplt_d-budat = wa_arseg-budat.
        i_xmplt_d-bukrs = wa_arseg-bukrs.
        i_xmplt_d-lifnr = wa_arseg-lifnr.
        i_xmplt_d-name1_lifnr = wa_arseg-name1_lifnr.
        i_xmplt_d-wrbtr = wa_arseg-wrbtr.
        i_xmplt_d-waers = wa_arseg-waers.
        i_xmplt_d-ebeln = wa_arseg-ebeln.
        i_xmplt_d-ebelp =  wa_arseg-ebelp.
        i_xmplt_d-reason = wa_arseg-reason.
        i_xmplt_d-dmeng = wa_arseg-dmeng.
        i_xmplt_d-dwert = wa_arseg-dwert.
        i_xmplt_d-bname = wa_arseg-bname.
        i_xmplt_d-name_text = wa_arseg-name_text.
        i_xmplt_d-udate = wa_arseg-udate.
        i_xmplt_d-comment =  wa_arseg-comment.
        APPEND i_xmplt_d.
      ENDLOOP.
      LOOP AT i_xmplt_d.
        CONCATENATE i_xmplt_d-belnr
                    i_xmplt_d-budat
                    i_xmplt_d-bukrs
                    i_xmplt_d-lifnr
                    i_xmplt_d-name1_lifnr
                    i_xmplt_d-wrbtr
                    i_xmplt_d-waers
                    i_xmplt_d-ebeln
                    i_xmplt_d-ebelp
                    i_xmplt_d-reason
                    i_xmplt_d-dmeng
                    i_xmplt_d-dwert
                    i_xmplt_d-bname
                    i_xmplt_d-name_text
                    i_xmplt_d-udate
                    i_xmplt_d-comment
                    INTO i_texts SEPARATED
                    BY c_horz_tab.
        i_texts-line+254(1) = c_newline.
        APPEND i_texts.
        CLEAR i_texts.
      ENDLOOP.
      DESCRIBE TABLE i_texts LINES w_tab_lines.
      READ TABLE i_texts INDEX w_tab_lines.
      wa_doc_chng-doc_size = ( w_tab_lines - 1 ) * 255 + STRLEN( i_texts ).
      DESCRIBE TABLE i_texts LINES w_tab_lines.
      i_objpack-transf_bin = ' '.
      i_objpack-head_start = 0.
      i_objpack-head_num = 0.
      i_objpack-body_start = 1.
      i_objpack-body_num = w_tab_lines.
      i_objpack-doc_type = 'XLS'.
      i_objpack-obj_name = 'Attachment'.
    i_objpack-obj_descr = w_doc_name.
      i_objpack-obj_descr = lc_filename.
      i_objpack-doc_size = w_tab_lines * 255.
      APPEND i_objpack.
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        EXPORTING
          document_data              = wa_doc_chng
        TABLES
          packing_list               = i_objpack
          contents_txt               = i_texts
          receivers                  = i_reci
        EXCEPTIONS
          too_many_receivers         = 1
          document_not_sent          = 2
          operation_no_authorization = 4
          OTHERS                     = 99.
      IF sy-subrc = 0.
        COMMIT WORK.
      ELSE.
        WRITE: / 'Error in send E-Mail' .
      ENDIF.
    please revert me asap. It is very urgent to me. thanks in advance.
    Bye

    hI
    Have you build your Excel Data table to get attachement in Mail? If no then please find the Eg. code for your reference to send Excel attachment..
    * End of Selection Event : Displaying the selected data                *
    END-OF-SELECTION.
        PERFORM EMAIL_EXCEL_ATTACHMENT.
    ******///form
    FORM EMAIL_EXCEL_ATTACHMENT .
    * Populate table with detaisl to be entered into .xls file
      PERFORM BUILD_XLS_DATA_TABLE.
    * Populate message body text
      PERFORM POPULATE_EMAIL_MESSAGE_BODY.
    * Send file by email as .xls speadsheet
      PERFORM SEND_FILE_AS_EMAIL_ATTACHMENT
                                   TABLES IT_MESSAGE
                                          IT_ATTACH
                                    USING S_EMAIL
                                          TEXT-042
                                          C_XLS
                                          'filename'
                                 CHANGING GD_ERROR
                                          GD_RECIEVER.
    *   Instructs mail send program for SAPCONNECT to send email(rsconn01)
      PERFORM INITIATE_MAIL_EXECUTE_PROGRAM.
    ENDFORM.                    " EMAIL_EXCEL_ATTACHMENT
    ********///form BUILD_XLS_DATA_TABLE
    FORM BUILD_XLS_DATA_TABLE .
      DATA :    LV_NETWR(20)     TYPE C,
                LV_BOL_DATE(20)  TYPE C,
                LV_KAWRT(20)     TYPE C,
                LV_FKDAT(20)     TYPE C,
                LV_WAERK(20)     TYPE C,
                LV_KURRF(20)     TYPE C,
                LV_SHIPDATE(20)  TYPE C,
                LV_DEPTDATE(20)  TYPE C.
      CONSTANTS:
          CON_TAB  TYPE C VALUE CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB,
          CON_CRET TYPE C VALUE CL_ABAP_CHAR_UTILITIES=>CR_LF.  "#EC *
      DATA STR TYPE STRING.
    **********/ this parameter concatenate to get headers
      CONCATENATE STR
      'SLNO'
      'OWNER'
      'SERIAL NO'
      'FROM'
      'DESTINATION'
      'INVOICE VALUE'
      'DESCRIPTION'
      'CUSTOMER NAME'
      'BL NUMBER'
      'BL DATE'
      'VESSEL NAME/AIRLINE DETAILS'
      'MODE OF TRANSIT'
      'SHIPPING MARKS'
      'DUTY SUM INSURED'
      'FLAG'
      'OPEN COVERNO'
      'INVOICE DATE'
      'INVOICE NO'
      'LC WORDING'
      'QUANTITY'
      'PACKAGING DETAILS'
      'BASIS OF VALUATION'
      'EXCLUDE WAR SRCC'
      'CURRENCY'
      'EXCHANGE RATE'
      'ADDRESS'
      'VESSEL BUILT YEAR'
      'VESSEL FLAG'
      'VOYAGE NO'
      'SHIPMENT DATE'
      'DEPARTURE DATE'
      'SURVEYOR COUNTRY'
      'SURVEYOR CITY'
      'SURVEYOR AGENT'
      'SURVEYOR ADDRESS'
      'EXPORT CONSIGNMENT'
      'CONTAINER DETAILS'
      CL_ABAP_CHAR_UTILITIES=>CR_LF INTO STR SEPARATED BY CON_TAB.
      LOOP AT IT_FINAL.
    *******/ this is to pass body / row data
        WRITE : IT_FINAL-NETWR    TO LV_NETWR,              "#EC UOM_IN_MES
                IT_FINAL-BOL_DATE TO LV_BOL_DATE,
                IT_FINAL-KAWRT    TO LV_KAWRT,              "#EC UOM_IN_MES
                IT_FINAL-FKDAT    TO LV_FKDAT,
                IT_FINAL-WAERK    TO LV_WAERK,
                IT_FINAL-KURRF    TO LV_KURRF,
                IT_FINAL-SHIPDATE TO LV_SHIPDATE,
                IT_FINAL-DEPTDATE TO LV_DEPTDATE.
        CONCATENATE
               STR
               IT_FINAL-SLNO
               IT_FINAL-OWNER
               IT_FINAL-SRNO
               IT_FINAL-PORT_LOAD
               IT_FINAL-PORT_DSCHR
               LV_NETWR
               IT_FINAL-DESCRIP
               IT_FINAL-CUSTNAME
               IT_FINAL-BOL_NUM
               LV_BOL_DATE
               IT_FINAL-VESSELNAME
               IT_FINAL-SHP_TYPE
               IT_FINAL-SHP_MARK
               LV_KAWRT
               IT_FINAL-FLAG
               IT_FINAL-OPEN_CONO
               LV_FKDAT
               IT_FINAL-VBELN
               IT_FINAL-LC_WORD
               IT_FINAL-QUANT
               IT_FINAL-PACKDETL
               IT_FINAL-INCO1
               IT_FINAL-EXCWSR
               LV_WAERK
               LV_KURRF
               IT_FINAL-ADDPAY
               IT_FINAL-VESSBYR
               IT_FINAL-VESSFLG
               IT_FINAL-VOY_FLY_NO
               LV_SHIPDATE
               LV_DEPTDATE
               IT_FINAL-SURCOUNT
               IT_FINAL-INCO2
               IT_FINAL-EXPORT_CON
               IT_FINAL-SURAGT
               IT_FINAL-SURADD
               IT_FINAL-CONTRNO
       CL_ABAP_CHAR_UTILITIES=>CR_LF INTO STR SEPARATED BY CON_TAB.
      ENDLOOP.
      CALL FUNCTION 'SCMS_STRING_TO_FTEXT'
        EXPORTING
          TEXT      = STR
        TABLES
          FTEXT_TAB = IT_ATTACH.
    ENDFORM.                    " BUILD_XLS_DATA_TABLE
    ******// form POPULATE_EMAIL_MESSAGE_BODY
    FORM POPULATE_EMAIL_MESSAGE_BODY .
      REFRESH IT_MESSAGE.
      IT_MESSAGE = TEXT-043.  " Please find attached Insurance Certificate details
      APPEND IT_MESSAGE.
    ENDFORM.                    " POPULATE_EMAIL_MESSAGE_BODY
    *******'/ form SEND_FILE_AS_EMAIL_ATTACHMENT
    *&      Form  SEND_FILE_AS_EMAIL_ATTACHMENT
    *       text
    *      -->PIT_MESSAGE           text
    *      -->PIT_ATTACH            text
    *      -->P_EMAIL               text
    *      -->P_MTITLE              text
    *      -->P_FORMAT              text
    *      -->P_FILENAME            text
    *      -->P_ATTDESCRIPTION      text
    *      -->P_SENDER_ADDRESS      text
    *      -->P_SENDER_ADDRES_TYPE  text
    *      -->P_ERROR               text
    *      -->P_RECIEVER            text
    FORM SEND_FILE_AS_EMAIL_ATTACHMENT TABLES PIT_MESSAGE
                                              PIT_ATTACH
                                        USING P_EMAIL
                                              P_MTITLE
                                              P_FORMAT
                                              P_FILENAME
                                              P_ATTDESCRIPTION
                                              P_SENDER_ADDRESS
                                              P_SENDER_ADDRES_TYPE
                                     CHANGING P_ERROR
                                              P_RECIEVER.       "#EC *
      DATA: LD_ERROR    TYPE SY-SUBRC,                          "#EC *
    *        LD_RECIEVER TYPE SY-SUBRC,
            LD_MTITLE LIKE SODOCCHGI1-OBJ_DESCR,
    *        LD_EMAIL LIKE  SOMLRECI1-RECEIVER,
            LD_FORMAT TYPE  SO_OBJ_TP ,
            LD_ATTDESCRIPTION TYPE  SO_OBJ_NAM ,
            LD_ATTFILENAME TYPE  SO_OBJ_DES ,
            LD_SENDER_ADDRESS LIKE  SOEXTRECI1-RECEIVER,
            LD_SENDER_ADDRESS_TYPE LIKE  SOEXTRECI1-ADR_TYP,
            LD_RECEIVER LIKE  SY-SUBRC.                         "#EC *
    *  ld_email   = p_email.
      LD_MTITLE = P_MTITLE.
      LD_FORMAT              = P_FORMAT.
      LD_ATTDESCRIPTION      = P_ATTDESCRIPTION.
      LD_ATTFILENAME         = P_FILENAME.
      LD_SENDER_ADDRESS      = P_SENDER_ADDRESS.
      LD_SENDER_ADDRESS_TYPE = P_SENDER_ADDRES_TYPE.
    * Fill the document data.
      W_DOC_DATA-DOC_SIZE = 1.
    * Populate the subject/generic message attributes
      W_DOC_DATA-OBJ_LANGU = SY-LANGU.
      W_DOC_DATA-OBJ_NAME  = 'SAPRPT'.
      W_DOC_DATA-OBJ_DESCR = LD_MTITLE .
      W_DOC_DATA-SENSITIVTY = 'F'.
    * Fill the document data and get size of attachment
      CLEAR W_DOC_DATA.
      DESCRIBE TABLE IT_ATTACH LINES W_CNT.
      READ TABLE IT_ATTACH INDEX W_CNT.
      W_DOC_DATA-DOC_SIZE =
         W_CNT * 255 + STRLEN( IT_ATTACH ).
      W_DOC_DATA-OBJ_LANGU  = SY-LANGU.
      W_DOC_DATA-OBJ_NAME   = 'SAPRPT'.
      W_DOC_DATA-OBJ_DESCR  = LD_MTITLE.
      W_DOC_DATA-SENSITIVTY = 'F'.
      CLEAR T_ATTACHMENT.
      REFRESH T_ATTACHMENT.
      T_ATTACHMENT[] = PIT_ATTACH[].
    * Describe the body of the message
      CLEAR T_PACKING_LIST.
      REFRESH T_PACKING_LIST.
      T_PACKING_LIST-TRANSF_BIN = SPACE.
      T_PACKING_LIST-HEAD_START = 1.
      T_PACKING_LIST-HEAD_NUM = 0.
      T_PACKING_LIST-BODY_START = 1.
      DESCRIBE TABLE IT_MESSAGE LINES T_PACKING_LIST-BODY_NUM.
      T_PACKING_LIST-DOC_TYPE = 'raw'.
      APPEND T_PACKING_LIST.
    * Create attachment notification
      T_PACKING_LIST-TRANSF_BIN = 'X'.
      T_PACKING_LIST-HEAD_START = 1.
      T_PACKING_LIST-HEAD_NUM   = 1.
      T_PACKING_LIST-BODY_START = 1.
      DESCRIBE TABLE T_ATTACHMENT LINES T_PACKING_LIST-BODY_NUM.
      T_PACKING_LIST-DOC_TYPE   =  LD_FORMAT.
      T_PACKING_LIST-OBJ_DESCR  =  LD_ATTDESCRIPTION.
      T_PACKING_LIST-OBJ_NAME   =  LD_ATTFILENAME.
      T_PACKING_LIST-DOC_SIZE   =  T_PACKING_LIST-BODY_NUM * 255.
      APPEND T_PACKING_LIST.
    * Add the recipients email address
      CLEAR T_RECEIVERS.
      REFRESH T_RECEIVERS.
      LOOP AT S_EMAIL.
        T_RECEIVERS-RECEIVER = S_EMAIL-LOW.
        T_RECEIVERS-REC_TYPE = 'U'.
        T_RECEIVERS-COM_TYPE = 'INT'.
        T_RECEIVERS-NOTIF_DEL = 'X'.
        T_RECEIVERS-NOTIF_NDEL = 'X'.
        APPEND T_RECEIVERS.
      ENDLOOP.
      CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
        EXPORTING
          DOCUMENT_DATA              = W_DOC_DATA
          PUT_IN_OUTBOX              = 'X'
          SENDER_ADDRESS             = LD_SENDER_ADDRESS
          SENDER_ADDRESS_TYPE        = LD_SENDER_ADDRESS_TYPE
          COMMIT_WORK                = 'X'
        IMPORTING
          SENT_TO_ALL                = W_SENT_ALL
        TABLES
          PACKING_LIST               = T_PACKING_LIST
          CONTENTS_BIN               = T_ATTACHMENT
          CONTENTS_TXT               = IT_MESSAGE
          RECEIVERS                  = T_RECEIVERS
        EXCEPTIONS
          TOO_MANY_RECEIVERS         = 1
          DOCUMENT_NOT_SENT          = 2
          DOCUMENT_TYPE_NOT_EXIST    = 3
          OPERATION_NO_AUTHORIZATION = 4
          PARAMETER_ERROR            = 5
          X_ERROR                    = 6
          ENQUEUE_ERROR              = 7
          OTHERS                     = 8.
    * Populate zerror return code
      LD_ERROR = SY-SUBRC.
    * Populate zreceiver return code
      LOOP AT T_RECEIVERS.
        LD_RECEIVER = T_RECEIVERS-RETRN_CODE.
      ENDLOOP.
    ENDFORM.                    " SEND_FILE_AS_EMAIL_ATTACHMENT
    *******/form
    *&      Form  INITIATE_MAIL_EXECUTE_PROGRAM
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM INITIATE_MAIL_EXECUTE_PROGRAM .
      WAIT UP TO 2 SECONDS.
      SUBMIT RSCONN01 WITH MODE = 'INT'
                    WITH OUTPUT = 'X'
                    AND RETURN.
    ENDFORM.                    " INITIATE_MAIL_EXECUTE_PROGRAM
    *********end of code to trigger mail in excel format....
    If any other help please let me know......
    I am sure this example code will help you to resolve your problem...
    please analyse above code for your requirement...
    In my scenario the message you said is not displaying.....
    Reward Points

  • Working with Excel spreadsheet embedded in access table

    Hello!
    I have Access DB which contain Excel spreadsheet objects embedded in table. To work with DB I use ADO-Tool based on ActiveX. Data passed to my program from GetRows method as 2D array of variants. As I understand I should convert variant to object refnum and then use this refnum with property and invoke nodes to get data from spreadsheet. How to select data type for VariantToData to work with Excel spreadseet?

    Hi,
    Isn't it the same that using Index Array function? I believe that problem is in conversion of variant to refnum. For example, if I change refnum data type to string in Variant To Data, no error appears, and I've got some text data (see the attachment).
    Attachments:
    Temp.zip ‏25 KB

  • Essbase Add-In v6.2 not working with Excel 97

    I am running client Windows NT 4.0sp6 with Excel 97 and just tried to upgrade the Essbase Excel Add-In to version 6.2.1 from 6.0. The add-in appears to work fine for all Essbase functions except Essbase-Options. When I select Essbase-Options, I immediately get an Excel.exe application error as follows:The instruction at "0x01e412b5" referenced memory at "0x0000003c". The memory could not be read.My upgraded v6.2.1 Application manager appears to run fine. Anybody got any ideas?? According to Hyperion documentation, v6.2.1 works with Excel 97.

     

  • What´s the best approach to work with Excel, csv files

    Hi gurus. I got a question for you. According to your experience what's the best approach to work with Excel or csv files that have to be uploaded through DataServices to you datawarehouse.
    Let's say your end-user, who is not a programmer, creates a group of 4 excel files with different calculations in a monthly basis, so they can generate a set of reports from their datawarehouse once the files have been uploaded to tables in your DWH. The calculations vary from month to month. The user doesn't have a front-end to upload the excel files directly to Data Services. The end user needs to keep a track of which person uploaded the files for a determined month.
    1. The end user should place their 4 excel files in a shared directory that will be seen by DataServices.
    2. DataServices will execute certain scheduled job that will read the four files and upload them to the Datawarehouse at a determined time, lets say at 9:00pm.
    It makes me wonder... what happens if the user needs to present their reports immediately so they can´t wait until 9:00pm.  Is it possible for the end user to execute some kind of action (out of the DataServices Environment) so DataServices "could know" that it has to process those files right now, instead of waiting for the night schedule?
    Is there a way that DS will track who was the person who uploaded those files?
    Would it be better to build a front-end for the end user so they can upload their four files directlyto the datawarehouse?
    Waiting for your comments to resolve this dilemma
    Best Regards
    Erika

    Hi,
    There are functions in DS that captures the input files automatically. You could use file_exists() or wait_for_file() option to do that. Schedule the job to run every certain minute and if the file exists then run. This could be done by using a certain file name with date and timestamp etc or after running move the old files to archive and DS wait for new files to show up.
    Check this - Selective Reading and Postprocessing - Enterprise Information Management - SCN Wiki
    Hope this helps.
    Arun

  • F2 key does not work with excel

    Dear Friends,
    when i am working with excel, f2 key does not work as its shortcut. can you please help me how i can solve this. thanks a lot

    what if you press Fn + F2? Does anything pop up?
    Regards,
    Jin Li
    May this year, be the year of 'DO'!
    I am a volunteer, and not a paid staff of Lenovo or Microsoft

  • Ill.CS3 - Why can I only work with one sheet on the desktop? I want to design a multi page document...

    ill.CS3 - Why can I only work with one sheet on the desktop? I want to design a multi page document...

    Use this ancient work-around:
    Create mutli-page PDF | Illustrator

  • Working with excel What is the Best free app?

    What is the Best free app for Working with excel on the iPad 3?

    Here is one , I Googled your question
    http://blogs.computerworld.com/20102/excel_on_my_ipad_free

  • Does ADI 11i version work with Excel XP ?

    Hi,
    If anyone knows how to get ADI version for 11i to work with Excel XP, It would be a mirical.
    I have been getting problems running the software on some PC's. And on some it will get as far as trying to create the template journal in Excel then run time error out.
    Best regards,

    Afternoon I was wondering if you could explain how you got ADI. I am curently running Windows XP with Office XP and Oracle 9i client. The ADi ver is 7.1.12.10.05. I am told that you need to install Oracle SQLNET 7, 2.3.4 and Oracle Sqlnet 8 NET 806 to allow ADI to work. Is that correct ?

  • What apple software allows me to open and work with excel files?

    What Apple software allows me to open and work with Excel files?

    Numbers, OpenOffice, Microsoft Office 2008 or newer, or similar products. Microsoft Office 2004 doesn't work in 10.7.
    (86805)

  • Working with excel files in C#, in a web farm

    I am creating a excel file uploader that after the upload, searches for specific columns, saves data to SQL Server, then gets rid of the excel file.
    I will be accepting .xls & xlsx file types.  The internal file structure should be all fairly standard because this is an internal company app.  So for example, the sheet with the data I am searching for may not always be the first in the book,
    but it will always have the same name.
    From the research I have done, it seems I can use the Interop library or OpenXML.  I am leaning towards interop.  Because we are on a web farm, I think it would be best to not save the file, just work with it in memory. Would this be a concern
    if the files are only only around 50kb? I am only expecting 100 uploads a month.
    If it is preferred or required I save the file before pulling the data out, should I save it to the application directory on the web server and expect it to be ok because I am saving/processing/deleting in one request? Or is there a better solution?  I
    thought of saving to our file share but that opens a whole new bucket of worms because of having to send credentials with the file when saving.
    Simon.

    Hi Simon,
    Open XML SDK can only manipulate Office 2007 and above versions. Since your web form accepts Excel 2003 file, it's not a good choice. But if you want to use the PIA(Primary Interop Assembly) to automate the excel files, it's also not recommened. Neither
    of these two options are suitable in your case, you need to use some 3rd-party library to help you, as recommened in this Microsoft KB article.
    http://support.microsoft.com/kb/257757/en-au
    If your business requires the server-side creation of the Office 97,   Office 2000, Office XP, and Office
    2003 binary file formats, third-party   vendors offer components that can help you. Microsoft does not provide any   such components, so you will need to either build a solution yourself or   purchase one from a third-party vendor. Many different
    third-party products   are available. You should investigate each solution to best match the vendor   to your business needs.If you want to build your own solution that edits the   Office 97, Office 2000, Office XP, and Office 2003 binary file
    formats   directly, you can obtain the file format specifications for free under the   terms of the Microsoft Open Specification Promise (OSP). No technical support   is available for the documentation or for the products that you create, but
      documentation is available. For more information, visit the following Web   site:
    http://www.microsoft.com/interop/docs/officebinaryformats.mspx
    As far as I know, NPOI is a good choice for you. You can search and try it. But as it's a 3rd-party library, we don't provide support for it. It also provide ability to process the worksheet in the memory.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • ColdFusion Search with Excel Sheet creation

    I created a form search with two buttons - one for results on the web page and one to create an excel sheet.
    Problem: When a user conducts a search with results on the web page - the user would have to select the criteria again then click the create excel button to create the sheet.
    How can I work it, so the user after conducting a search can just click one button to create the excel sheet?
    (Using "Post" for the form - will change to get if needed will your help)

    I'm still freshman with CF - this means I have a lot of questions.
    When I tried using the excel.cfm page I receive: Variable MRESULTS is undefined.
    How do I send "mresults" to the excel page?
    Search Page Link:
       <a href="javascript:document.
    getElementById('yourForm').submit()">Excel</a>
          <form id="yourForm" action="excel.cfm" method="post">
                 <!--- save search values sent via POST --->
                 <cfoutput>
                 <input name="ship" value="#mresults.ship#">
                 </cfoutput>
          </form>
    Excel page:
    <cfquery name="MResults"
             datasource="support">
    select *
    from table1
    <cfform action="/msr/excel.cfm" method="post"> 
    <cfset sObj=SpreadsheetNew()>
    <!--- Create header row --->
    <cfset SpreadsheetAddRow(sObj, "Name,address")>
    <cfset SpreadsheetFormatRow(sObj, {bold=TRUE,fgcolor="grey_25_percent", alignment="center"}, 1)>
    <cfset SpreadsheetFormatColumn(sObj, {alignment="left", dataformat="mm/dd/yyyy"}, 14)>
    <cfset SpreadsheetAddRows(sObj, MResults)>
    <cfspreadsheet action="write" name="sObj" filename="C:Orders.xls" overwrite="true">
    <cfheader    name="Content-Disposition"
                            value="inline; filename=Orders.xls">
                <cfcontent    type="application/csv"
                            file="C:\Orders.xls"
                            deletefile="yes">
    </cfform>
    </cfquery>

  • Working with Excel 2008

    Couple of questions... can't seem to activate different worksheets within a workbook. Do I just call them by name? i.e.
    <pre style="
    font-family: Monaco, 'Courier New', Courier, monospace;
    font-size: 10px;
    margin: 0px;
    padding: 5px;
    border: 1px solid #000000;
    width: 720px;
    color: #000000;
    background-color: #FFDDFF;
    overflow: auto;"
    title="this text can be pasted into the Script Editor">
    activate object workbook "09-10 Teacherdata.xlsx"
    activate worksheet "sheet 1" </pre>
    if I have multiple ones is it just sheet1, sheet 2... or whatever I name them?
    2nd question...I'd like to open an excel file using a list to allow me the ability to call different file names within a loop. Can;t quite get it to work...something like this?
    <pre style="
    font-family: Monaco, 'Courier New', Courier, monospace;
    font-size: 10px;
    margin: 0px;
    padding: 5px;
    border: 1px solid #000000;
    width: 720px;
    color: #000000;
    background-color: #FFDDFF;
    overflow: auto;"
    title="this text can be pasted into the Script Editor">
    set deptname to {"English", "Humanities", "Mathematics", "Language", "Science", "Arts"}
    set deptnamefile to {"MacBook HD:Users:Dano:Desktop:English Schedules 10-11.xlsx", "MacBook HD:Users:Dano:Desktop:Humanities Schedules 10-11.xlsx", "MacBook HD:Users:Dano:Desktop:Mathematics Schedules 10-11.xlsx", "MacBook HD:Users:Dano:Desktop:Language Schedules 10-11.xlsx", "MacBook HD:Users:Dano:Desktop:Science Schedules 10-11.xlsx", "MacBook HD:Users:Dano:Desktop:Arts Schedules 10-11.xlsx"}
    repeat with i from 1 to 6
    if item 5 of cvalue = item i of deptname then
    copy item 2 of cvalue to slotvalue
    tell application "Microsoft Excel"
    activate
    open file item i of deptnamefile
    activate object workbook item i of deptname & "Schedules 10-11.xlsx"
    </pre>
    Thanks in advance for the help!
    dan

    Hi Bernard,
    Thanks for the response. You helped me about a year ago on some iCal scripting that worked out great, Thanks again! With Excel I have a set of data that looks like this 20501,B,T1441,101 where the items are unique id # for an academic class, slot during the day when the class is taught (ranges from A to H), Teacher id #, second unique id # for the academic class. I have written a script that puts in a 5th piece of info of the academic department name based on the unique id (works fine), and was then trying to move the data into an series of worksheets (one for each academic department) which would give me a visual of the teacher's schedule during the week. The excel file is set up to do this based on the occurrence of the teaching slots that show up in row 3, columns J through Q. So I have 6 different Excel files (6 academic departments) with each file having 10 or so sheets in them (each sheet for a unique teacher). Looking to get the data out of the original Excel file (20501,B,T1441,101) and into the department files, specifically into row 3, columns J through Q. Here is the full script of what I have attempted. I disabled the "open file item i of deptnamefile" since I couldn't get it to work and was playing around with just getting the script to move some of the data over into those department specific files when I posted the question. Any insight would be appreciated.
    dan
    <pre style="
    font-family: Monaco, 'Courier New', Courier, monospace;
    font-size: 10px;
    margin: 0px;
    padding: 5px;
    border: 1px solid #000000;
    width: 720px; height: 340px;
    color: #000000;
    background-color: #FFDDFF;
    overflow: auto;"
    title="this text can be pasted into the Script Editor">
    -- Works with an already opened Excel file [csv is ok] to move a scheduled sections into a daily Schedule  for the courses taught by a teacher.  Each Excel file will be dept based and have multiple workbooks
    tell application "Microsoft Excel"
    activate
    open file "MacBook HD:Users:Dano:Desktop:09-10 Teacherdata.xlsx"
    activate object workbook "09-10 Teacherdata.xlsx"
    activate object worksheet "Sheet 1"
    get value of used range of worksheet 1 of file "MacBook HD:Users:Dano:Desktop:09-10 Teacherdata.xlsx"
    copy the result to wholedata
    set lvalue to length of wholedata
    set counter to lvalue
    set cellnum to 1
    set cellid to ""
    set slotvalue to ""
    repeat with i from 2 to counter
    set cvalue to {0, 0, 0, 0, 0}
    copy item i of wholedata to cvalue
    set deptname to {"English", "Humanities", "Mathematics", "Language", "Science", "Arts"}
    set deptnamefile to {"MacBook HD:Users:Dano:Desktop:English Schedules 10-11.xlsx", "MacBook HD:Users:Dano:Desktop:Humanities Schedules 10-11.xlsx", "MacBook HD:Users:Dano:Desktop:Mathematics Schedules 10-11.xlsx", "MacBook HD:Users:Dano:Desktop:Language Schedules 10-11.xlsx", "MacBook HD:Users:Dano:Desktop:Science Schedules 10-11.xlsx", "MacBook HD:Users:Dano:Desktop:Arts Schedules 10-11.xlsx"}
    set columnchoices to {"J", "K", "L", "M", "N", "O", "P", "Q"}
    set teachingslot to {"A ", "B ", "C ", "D ", "F ", "G ", "H "}
    repeat with i from 1 to 6
    if item 5 of cvalue = item i of deptname then
    copy item 2 of cvalue to slotvalue
    tell application "Microsoft Excel"
    activate
    open file "MacBook HD:Users:Dano:Desktop:English Schedules 10-11.xlsx"
    ---open file item i of deptnamefile---
    activate object workbook "MacBook HD:Users:Dano:Desktop:English Schedules 10-11.xlsx"
    activate object workbook item i of deptname & "Schedules 10-11.xlsx"
    repeat with i from 1 to 7
    if slotvalue = item i of teachingslot then
    set cellid to item i of columnchoices & "3"
    set formula of cell cellid to item i of teachingslot
    end if
    end repeat
    end tell
    end if
    end repeat
    end repeat
    set onepiece to {}
    set lastrow to {}
    set courseID to {}
    end tell </pre>

  • Working with Excel

    Hello,
    Over the past few days I have began working with exporting data into an excel file.
    I have noticed that I needed to generate an Object through the CreateObject command
    Dim Excel Set Excel = CreateObject("Excel.Application")
    I have found how to open an existing file
    Excel.Visible = True Call Excel.Workbooks.Open("file/location.xls")
    write to close and save an excel file.
    I was wondering if anyone has a list f the object commands associated with excel for example I can set and excel sheet number by using  
    Set ExcelSheetNumber = Excel.Sheets(whatever)
    but how do I check if the excel file even exists?  or how do I create one if one doesn't?  It appears to me the API allows me to link things as .Cells or .Open to the application object but I have no idea where I can find additional commands.
    Any help would be appreciated.
    Tim
    Solved!
    Go to Solution.

    Hi Smooth,
    I have also faced the same groping-around-in-a-black-box feeling when using Microsoft Office's ActiveX methods.  I don't have answers to those specific questions.  Ultimately these are questions whose answers should be documented by Microsoft at MSDN.  Whatever methods and properties are available with Microsoft's ActiveX layer can be used by DIAdem VBScript.
    It is possible to add some intellisense from Microsoft's type libraries to the DIAdem-SCRIPT panel, but I warn you not to get your hopes up-- the intellisense usually ends way before you get to the item of interest.  You can select the DIAdem-SCRIPT menu "Script>>Type Libraries..." to add Microsoft Intellisense to DIAdem-SCRIPT.
    Brad Turpin
    DIAdem Product Support Engineer
    National Instruments

  • Help needed in working with Excel

    i have a ms excel template with n number of columns.
    I need to add a new column using sql code. Can anyone tell me what is the code??? thx in advance...

    Erm i tink the final db is excel and no more.
    the db given to me is in excel and i can do whatever with it but the final output have to be in excel.
    ( i initially imported the excel db to access and everything is out running fine. But as i wont be using the application after i had it out. So i thought it would be better to allow it to work on excel thus saving the trouble of importing and exporting)
    I have to work with a few db(all excel) and they each contains 40 000 - 80 000 records...(i dun knw if that is considered small or large)
    I have limited knowledge on access macros and sql and the knowledge i had on them does not permit me to carry out the operations i wan.(and im required to develop an application with GUI)
    thx for all helps and comments guyz...

Maybe you are looking for

  • Unable to locate original files in a second library

    Hi everyone! I just got a new christmas cd, and opened my second itunes library (which I use to keep all my holiday music separate from everything else), only to find that itunes is unable to find the original files of all my music (with the little !

  • Error msg when trying to open PDF attachment

    Why am I getting error message "Prop Res DLL not loaded" when I try to open a PDF attachment on an email?  I have downloaded Adobe Reader XI.

  • Viewer Problems. HELP!! PLEASE!!!

    I just upgraded my computer to1 GB of RAM and it didn't fix my problem so i came on here for help. PLEASE HELP ME! When i try to play clips in the viewer they only play for a few frames and then the video freezes and the audio stays going. The slider

  • Node crash

    We had a node reboot in the cluster. It looks like Oracle (CRS) forced the reboot. (We recently patched our 2-node RAC database from 10.2.0.1 to 10.2.0.4.) From the Linux messages log: Nov 18 10:49:31 servernameora02 kernel:ocssd.bin[17186] general p

  • XCM changes in the custom app is reflecting in standard b2b xcm!!

    Hi All, We have scenario, that we have 4 applications. Two B2B and two BOB. We have used 4 tracks for creating custom applications. The applications are getting build and deployed successfully on J2EE  engine. The XCM links for the custom application