Contents for .XLS excel file attachment missing in FM SO_DOCUMENT_SEND_API1

Hi all,
I checked the lt_attachment in debugging. It has around 87 lines and this FM run without any error. SY-subrc = 0.
But when I opened the excel file it only have 4 lines of records. Anyone have any idea on this? Thanks.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
    EXPORTING
      document_data              = gd_doc_data
      put_in_outbox              = 'X'
      sender_address             = 'email address'
      sender_address_type        = 'INT'
      commit_work                = 'X'
    IMPORTING
      sent_to_all                = gd_sent_all
    TABLES
      packing_list               = it_packing_list
      contents_bin               = lt_attachment
      contents_txt               = it_message
      receivers                  = it_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.

Hi Siong,
Did you passing correct parameter in the 'packing list' for the attachment?
doc_size should be represent your message size.
Perhaps you pass wrong value.
* Describe the body of the message
  clear gs_packing_list.
  refresh gt_packing_list.
  gs_packing_list-transf_bin  = space.
  gs_packing_list-head_start  = 1.
  gs_packing_list-head_num    = 0.
  gs_packing_list-body_start  = 1.
  describe table gt_message lines gs_packing_list-body_num.
  gs_packing_list-doc_type    = 'RAW'.
  append gs_packing_list to gt_packing_list.
* Create attachment notification
  gs_packing_list-transf_bin   = 'X'.
  gs_packing_list-head_start   = 1.
  gs_packing_list-head_num     = 1.
  gs_packing_list-body_start   = 1.
  describe table gt_attachment lines gs_packing_list-body_num.
  gs_packing_list-doc_type   =  ld_format.
  gs_packing_list-obj_descr  =  ld_attdescription.
  gs_packing_list-obj_name   =  ld_attfilename.
  gs_packing_list-doc_size   =  gs_packing_list-body_num * 255.
  append gs_packing_list to gt_packing_list.
Regards,
Dondi.

Similar Messages

  • To Send HTML Format and excel file attachment  in same mail

    Dear All,
            Have requerment ,to send a mail options HTML table format and same data in excel file attachement.have capable to do the html format using methods BCS .but how to send excel format attachment in same  mail.
    Please guide me how to do it.
    Regards ,
    Santhu
    Edited by: santosh jajur on Apr 9, 2010 1:54 PM

    Santhosh,
    please check the code:
    report bcs_example_7.
    This report provides an example for sending an Excel
    attachment in Unicode Systems
    constants:
      gc_tab  type c value cl_bcs_convert=>gc_tab,
      gc_crlf type c value cl_bcs_convert=>gc_crlf.
    parameters:
      mailto type ad_smtpadr
       default 'ur mail id'.                    "#EC *
    data send_request   type ref to cl_bcs.
    data document       type ref to cl_document_bcs.
    data recipient      type ref to if_recipient_bcs.
    data bcs_exception  type ref to cx_bcs.
    data main_text      type bcsy_text.
    data binary_content type solix_tab.
    data size           type so_obj_len.
    data sent_to_all    type os_boolean.
    start-of-selection.
      perform create_content.
      perform send.
    form send.
      try.
          send_request = cl_bcs=>create_persistent( ).
        create document object from internal table with text
          append 'Hello world!' to main_text.                   "#EC NOTEXT
          document = cl_document_bcs=>create_document(
            i_type    = 'RAW'
            i_text    = main_text
            i_subject = 'Test Created By BCS_EXAMPLE_7' ).      "#EC NOTEXT
        add the spread sheet as attachment to document object
          document->add_attachment(
            i_attachment_type    = 'xls'                        "#EC NOTEXT
            i_attachment_subject = 'ExampleSpreadSheet'         "#EC NOTEXT
            i_attachment_size    = size
            i_att_content_hex    = binary_content ).
        add document object to send request
          send_request->set_document( document ).
        --------- add recipient (e-mail address) -----------------------
        create recipient object
          recipient = cl_cam_address_bcs=>create_internet_address( mailto ).
        add recipient object to send request
          send_request->add_recipient( recipient ).
        ---------- send document ---------------------------------------
          sent_to_all = send_request->send( i_with_error_screen = 'X' ).
          commit work.
          if sent_to_all is initial.
            message i500(sbcoms) with mailto.
          else.
            message s022(so).
          endif.
      endtry.
    endform.                    "send
    form create_content.
      data lv_string type string.
      data ls_t100 type t100.
    columns are separated by TAB and each line ends with CRLF
      concatenate 'This Is Just Example Text!'                  "#EC NOTEXT
                  gc_crlf gc_crlf
                  into lv_string.
    header line
      concatenate lv_string
                  'MSGID'    gc_tab
                  'MSGNO'    gc_tab
                  'Language' gc_tab                             "#EC NOTEXT
                  'Text'     gc_crlf                            "#EC NOTEXT
                  into lv_string.
    data lines
      select * from t100 into ls_t100
        where arbgb = 'SO' and msgnr = '182'.
        concatenate lv_string
                    ls_t100-arbgb gc_tab
                    ls_t100-msgnr gc_tab
                    ls_t100-sprsl gc_tab
                    ls_t100-text  gc_crlf
                    into lv_string.
      endselect.
      select * from t100 into ls_t100
        where arbgb = 'SO' and msgnr = '316'.
        concatenate lv_string
                    ls_t100-arbgb gc_tab
                    ls_t100-msgnr gc_tab
                    ls_t100-sprsl gc_tab
                    ls_t100-text  gc_crlf
                    into lv_string.
      endselect.
      try.
          cl_bcs_convert=>string_to_solix(
            exporting
              iv_string   = lv_string
              iv_codepage = '4103'  "suitable for MS Excel, leave empty
              iv_add_bom  = 'X'     "for other doc types
            importing
              et_solix  = binary_content
              ev_size   = size ).
        catch cx_bcs.
          message e445(so).
      endtry.
    endform.                    "create_content
    Thanks.

  • After I Update to IOS 7.1 I can't open the excel file attached in  my email

    After I updated my Iphone 5s from IOS7.0.6 to IOS7.1 when i check my email i can't open excel file attached in my email i check with my frineds phone thy have same issoue

    David_PDX wrote:
    Hi Alex,
    The trick to this whole thing is to scroll to the bottom of the message. There should be a dashed line at the bottom of the email message with text underneath it that says, "This message was downloaded as plain text." Underneath that it should say (in blue hyperlink text) "Download full message". Select that hyperlink, and the Excel file should download completely. You should then be able to select the document and have it open correctly.
    I have had the same concern regardless of file format that is sent, so I do not believe your issue is with file format. Hope this helps.
    I've seen the same thing happen with images, which it displays in a corrupted form. It's fixed by downloading the full message.
    There's a more serious side effect of this, which I've now seen with several types of files. If one FORWARDS the email to someone else, the attached files it sends them are CORRUPTED and unopenable too. In the case of a Word files I looked at, it had dropped the last two bytes of the file.
    The workaround for that is to download the full message before forwarding.
    I'm seeing this happening with so many types of attachments that I'm assuming it affects them all. Please everyone report this to Apple feedback (http://www.apple.com/feedback/). It's one thing not being able to open a file on your device, it's another to have files corrupted permanently just by forwarding.

  • How to read the content of this excel file in LV

    Hi could you please let me know how can I read the content of this excel file using the Read From Speardsheet function. It contains text and numbers
    Thanks
    The excel file is attached
    Attachments:
    Datalogging.zip ‏307 KB

    Check attached VI.
    I am not allergic to Kudos, in fact I love Kudos.
     Make your LabVIEW experience more CONVENIENT.
    Attachments:
    ReadFromExcel.vi ‏27 KB

  • Excel file attachment withiout losing leading zeros

    Hi Expert,
    Can anybody tell me how to create the Excel file attachment for email generation without losing the leading zeros.
    Regards,
    Jyotsna

    Hi,
    If you want to pass a variable with leading zeros to excel sheet, please use the following:
      CONCATENATE  '=TEXT('  l_variable ',"000")'  INTO g_errcode1.
    It will display the leading zeros in excel sheet. I have done the same way in one of my program and it is working fine..
    Thanks & Regards
    Rocky Agarwal

  • Open data set for reading excel file on application server in back ground

    open data set for reading excel file on application server in back ground

    hi Vijay,
    I am afraid you won't be able to read from Excel file on Appl. Server.
    ec

  • Customised module for reading Excel files.

    Hi Gurus,
    I have to develop a customsed java module for reading Excel files from PI. I downloaded NWDS 7.31 from following location NWDS Download links - Java Development - SCN Wiki. I have installed it on my local laptop. For developing the module I need following Jar files.
    com.sap.aii.af.ms.svc_api
    com.sap.aii.proxy.svc_api.jar
    com.sap.aii.sec.svc_api.jar
    com.sap.aii.utilxi.server.jar
    com.sap.aii.utilxi.core.jar
    com.sap.xi.mapping.tool.lib_api.jar
    sap.com~tc~bl~txmanagerimpl~plb~impl.jar
    sap.com~tc~je~appcontect_api~API.jar
    com.sap.aii.af.cpa.svc.api
    com.sap.aii.af.lib.mod
    com.sap.aii.af.ms.ifc_api
    com.sap.aii.af.svc_api
    com.sap.xpi.ib.mapping.lib
    1. Where can i get these jar files. I checked these files in my downloaded NWDS 7.31  package, but cold not find them.
    Thanks in advance

    Hi.
    Check this thread.
    Where to get the libraries for XI development - Process Integration - SCN Wiki
    Regards
    Lucho

  • End the result of an sql query by Email as an excel file attachement

    Hi,
    I would like to create a PL/SQL function that send the result of an sql query by Email as an excel file attachement.
    i'm newbie in pl/sql an d i dont know if it's possible to do such task.
    regards,

    i think a regular expression is he way to go in your case...
    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com

  • Java API for reading Excel Files.

    Hi,
    Can you please suggest me any api for reading excel files.
    Right now i am using jxl.jar for this purpose but i am searching for an open source java api better than this.
    Whether POI gives better than this ?
    Thanks,
    Amit Shah.

    Can you please suggest me any api for reading excel
    files.
    Right now i am using jxl.jar for this purpose
    but i am searching for an open source java api better
    than this.
    Whether POI gives better than this ?i don't know about jxl but poi has several features which an excel can contain and it has been vastly improved in the past few versions.

  • Creating an e-mail with excel file attachment

    Morning,
    Does anyone know how to create an e-mail with a spreadsheet attachment (in foreground and background). I can create an e-mail (in foreground and background) with a text (tab delimited) file attachment with a suffix of .xls. I have created the file by writing text to a string and then putting it into a text format using the function module SCMS_STRING_TO_FTEXT.
    Thanks and regards
    John.

    See the following simple ex:
    DATA: P_EMAIL TYPE SOMLRECI1-RECEIVER.
    DATA: T_PACKING_LIST LIKE SOPCKLSTI1 OCCURS 0 WITH HEADER LINE,
    T_CONTENTS LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
    T_RECEIVERS LIKE SOMLRECI1 OCCURS 0 WITH HEADER LINE,
    T_ATTACHMENT LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
    T_OBJECT_HEADER LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
    W_CNT TYPE I,
    W_SENT_ALL(1) TYPE C,
    W_DOC_DATA LIKE SODOCCHGI1,
    GD_ERROR TYPE SY-SUBRC,
    GD_RECIEVER TYPE SY-SUBRC.
    DATA: IT_ATTACH TYPE STANDARD TABLE OF SOLISTI1 INITIAL SIZE 0
    WITH HEADER LINE.
    DATA: IT_MESSAGE TYPE STANDARD TABLE OF SOLISTI1 INITIAL SIZE 0
    WITH HEADER LINE.
    ***Sending mail to the receipients
      if not it_final[] is initial.
        PERFORM SUB_GET_MAIL_ADDR.
    Populate table with detaisl to be entered into .xls file
        PERFORM BUILD_XLS_DATA_TABLE.
        PERFORM POPULATE_EMAIL_MESSAGE_BODY.
    Send file by email as .xls speadsheet
        PERFORM SEND_FILE_AS_EMAIL_ATTACHMENT
        TABLES IT_MESSAGE
        IT_ATTACH
        USING P_EMAIL
        'Sales Register Report - Set Top Box / Accessories'
        'XLS'
        'SSTB'
        CHANGING GD_ERROR
        GD_RECIEVER.
    Instructs mail send program for SAPCONNECT to send email(rsconn01)
        PERFORM INITIATE_MAIL_EXECUTE_PROGRAM.
      endif.
    *&      Form  BUILD_XLS_DATA_TABLE
          text
    -->  p1        text
    <--  p2        text
    FORM BUILD_XLS_DATA_TABLE .
      data: wa_itab like it_final.
      CONSTANTS:
      CON_TAB TYPE C VALUE CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB,
      CON_CRET TYPE C VALUE CL_ABAP_CHAR_UTILITIES=>CR_LF.
      CONCATENATE 'Business Place' 'Region Code' 'Region' 'Branch Code'
                  'Branch' 'Material Desc' 'Area off Code'
                  'Area Name' 'Zone code' 'Zone Name' 'Cust No' 'Cust Name'
                  'Bill Doc No' 'Bill Date' 'Base Val' 'Total Val' 'Quantity'
      INTO IT_ATTACH SEPARATED BY CON_TAB.
      CONCATENATE CON_CRET IT_ATTACH INTO IT_ATTACH.
      APPEND IT_ATTACH.
      LOOP AT IT_FINAL INTO WA_ITAB.
        CONCATENATE   WA_ITAB-BUSINESS_PLACE
                  WA_ITAB-KVGR1
                  WA_ITAB-REGION
                  WA_ITAB-VKBUR
                  WA_ITAB-SALES_OFF
                  WA_ITAB-ARKTX
                  WA_ITAB-vkgrp
                  WA_ITAB-sales_grp
                  WA_ITAB-bzirk
                  WA_ITAB-zone
                  WA_ITAB-kunnr
                  WA_ITAB-name
                  WA_ITAB-vbeln
                  WA_ITAB-fkdat
                  WA_ITAB-base_value
                  WA_ITAB-total_value
                  WA_ITAB-fkimg
        INTO IT_ATTACH SEPARATED BY CON_TAB.
        CONCATENATE CON_CRET IT_ATTACH INTO IT_ATTACH.
        APPEND IT_ATTACH.
      ENDLOOP.
    ENDFORM.                    " BUILD_XLS_DATA_TABLE
    *&      Form  POPULATE_EMAIL_MESSAGE_BODY
          text
    -->  p1        text
    <--  p2        text
    FORM POPULATE_EMAIL_MESSAGE_BODY .
      REFRESH IT_MESSAGE.
      CONCATENATE SY-DATUM6(2) '/' SY-DATUM4(2) '/' SY-DATUM+0(4) INTO G_DATE.
      IT_MESSAGE = 'Please find attached excel sheet.'.
      APPEND IT_MESSAGE.
      IT_MESSAGE = 'Report'.
      APPEND IT_MESSAGE.
      Concatenate 'Report generated date' ':' G_Date '.' into IT_MESSAGE.
      APPEND IT_MESSAGE.
      clear it_message.
      append it_message.
      IT_MESSAGE = 'This is an autogenerated mail, please do not reply'.
      APPEND IT_MESSAGE.
    ENDFORM.                    " POPULATE_EMAIL_MESSAGE_BODY
    *& Form SEND_FILE_AS_EMAIL_ATTACHMENT
    Send email
    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.
      DATA: LD_ERROR TYPE SY-SUBRC,
      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.
      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.
      READ TABLE IT_ATTACH INDEX W_CNT.
      W_DOC_DATA-DOC_SIZE =
      ( W_CNT - 1 ) * 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.
      T_PACKING_LIST-OBJ_NAME = 'stb'.
      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-DOC_TYPE = 'XLS'.
    T_PACKING_LIST-OBJ_DESCR = LD_ATTDESCRIPTION.
      T_PACKING_LIST-OBJ_DESCR = 'Sales_STB'.
    T_PACKING_LIST-OBJ_NAME = LD_ATTFILENAME.
      T_PACKING_LIST-OBJ_NAME = 'stb'.
      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 IT_RECV.
        T_RECEIVERS-RECEIVER = IT_RECV-EMAIL.
        T_RECEIVERS-REC_TYPE = 'U'.
       T_RECEIVERS-COM_TYPE = 'INT'.
    T_RECEIVERS-COPY = 'X'.
       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  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 = ''
      AND RETURN.
    ENDFORM.                    " INITIATE_MAIL_EXECUTE_PROGRAM

  • Saving excel file attachment on phone

    I received and excel file via email on my phone and would like to save it for later to use with the office plus program. I can open the file from my phone but do not know how to save it. Can anyone help.

    Prakash,
              I have followed your weblog and set the content dispostion.
    HttpServletResponse res = request.getServletResponse(true);
                   try {
                        res.setContentType("application/vnd.ms-excel");
                        res.setHeader("Content-disposition", "inline; filename=report.xls");
                        wb.write(res.getOutputStream());
                   } catch (Exception e) {
                        e.printStackTrace();
    When I test this on my pc, I get file download window and I can choose 'open' or'save'. I also have tested this on some of my collegues PCs successfully. But the some of the end users are not getting this window.
    when the same is file is downloaded by running an asp page the enire MSExcel application with standard tool bar and menus(file edit etc..) is showing up.
    Why is it not poosible to get the same result using HSSF api?

  • Reading contents of uploaded excel file in web dynpro java

    Hi All.
    I am aware how to provide facility to upload files in web dynpro java. But my requirement is that on uploading a particular file (for eg. an excel file having 10 columns), I need to read the contents of that file and store it in a table in R/3.Can anyone suggest a way how I can read the contents of the uploaded file?
    Thanks and Regards,
    Saurabh.

    Hi.
    I am having the following requirement : I have a FileUpload UI element where user clicks Browse button, selects a file from the local system and presses a Upload button. Upon pressing Upload, the name of the selected file and the contents of the file should be shown.
    In the View context, I have two value attributes: FileName of type String and FileResource of type binary.
    This is the code that I have in the Upload button action handler :
      public void onActionUpload(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionUpload(ServerEvent)
        IWDAttributeInfo attributeInfo = wdContext.getNodeInfo().getAttribute(
                 IPrivateReadExcelView.IContextElement.FILE_RESOURCE);
        IWDModifiableBinaryType binaryType = (IWDModifiableBinaryType)attributeInfo.
                 getModifiableSimpleType();
        IPrivateReadExcelView.IContextElement element = wdContext.createContextElement();
        String fname = binaryType.getFileName();
        wdComponentAPI.getMessageManager().reportSuccess("File selected - "+fname);  //Statement 1
         try {
              wdComponentAPI.getMessageManager().reportSuccess("Successful");    // Statement 2
              InputStream in = new FileInputStream(fname);
              HSSFWorkbook wb = new HSSFWorkbook(in);
              wdComponentAPI.getMessageManager().reportSuccess("Successful");    //Statement 3
              int sheetsNo = wb.getNumberOfSheets();
              for (int i=0;i<sheetsNo;i++) {
                   HSSFSheet sheet = wb.getSheetAt(i);
                   Iterator rowsNo = sheet.rowIterator();
                   while(rowsNo.hasNext()) {
                        HSSFRow rows = (HSSFRow)rowsNo.next();
                        Iterator colsNo = rows.cellIterator();
                        while(colsNo.hasNext()) {
                             HSSFCell cell = (HSSFCell)colsNo.next();
                             wdComponentAPI.getMessageManager().reportSuccess("File uploaded" +
                                  "successfully");
                             if(cell.getCellType()==1) {
                                  wdComponentAPI.getMessageManager().reportSuccess("00000"+
                                       cell.getStringCellValue());
                             else if(cell.getCellType()==0) {
                                  String str=""+cell.getNumericCellValue();
                                  wdComponentAPI.getMessageManager().reportSuccess("11111"+str);
         catch(Exception e) { wdComponentAPI.getMessageManager().raisePendingException();
        //@@end
    On pressing Upload button, name of selected file is being shown(Statement 1). I am also getting Statement 2 in the output. However I am not getting Statement 3 onwards.
    Where am I going wrong? Can anyone shed some light on this?

  • How to read the contents in the excel file on the basis of colunm heading?

    Hi,
    Here is my requirement like that  in excel file i got the customer number , amount etc....
    And my required fields are customer and amount. In file customer nr is under the heading 'CUSTOMER' and amount is under the heading 'AMOUNT'.
    Is there any FM for reading the contents under the colunm heading of excel?
    Please suggest me.
    Thanks,
    Harshal kulkarni

    Hi Harshal ,
    I dont think there is such function module /BAPI/Class-Method .
    but if your excel file is dynamic you can write your own logic using field - symbols.
    Regards ,
    Praveen

  • XSLT Mapping for creating Excel files

    Hi ,
    I am following the blog /people/michal.krawczyk2/blog/2005/12/10/xi-generating-excel-files-without-the-java-nor-the-conversion-agent-not-possible by Michal regarding conversion of Flat files to Excel file format.
    My input xml format is
             <?xml version="1.0" encoding="utf-8"?>
             <FILE>
                  <Record>
         <Name>Navin</Name>
                         <EmpID>123456</EmpID>
                         <Location>Bangalore</Location>
                  </Record>
                 <Record>
         <Name>Ravi</Name>
                         <EmpID>789456</EmpID>
                         <Location>Hyderabad</Location>
                  </Record>
             </FILE>
    i need to convert this file into an Excel format with each record in single rows with Column Header names as Name,EmpID,Location.
    Could you please suggest how the XLST mapping should be done for this as i am very new to XSLT mapping concept.
    Please suggest how we can attain the target structure(datatype) and  steps to do this XSLT mapping.
    Note:- We are not doing Adapter module for this conversion.
    Thanks,
    Navin

    > i need to convert this file into an Excel format with each record in single rows with Column Header names as Name,EmpID,Location.
    This can be done with file content convertion. Use delimiter ; for excel
    > Could you please suggest how the XLST mapping should be done for this as i am very new to XSLT mapping concept.
    If you do not understand XSLT, you you want to maintain your development, in case if an error?
    http://w3schools.com/xsl/default.asp

  • Trying to open an Excel file attached to a Designer form

    Hello everybody.
    I am trying to open an excel form attached to a PDF file I created using Designer. The script I am using is attached to the click event of a button and reads "app.openDoc(MCFormPath.rawValue);" MCFormPath is a text fiel with a default value that reads: z:\009\Source documents\Meal challenge.xls (location of the document) Unfortunately nothing happens when I click on the button. Any ideas why?
    Thanks in advance.

    [email protected] wrote:
    > Hello everybody.
    >
    > I am trying to open an excel form attached to a PDF file I created using Designer. The script I am using is attached to the click event of a button and reads "app.openDoc(MCFormPath.rawValue);" MCFormPath is a text fiel with a default value that reads: z:\009\Source documents\Meal challenge.xls (location of the document) Unfortunately nothing happens when I click on the button. Any ideas why?
    >
    > Thanks in advance.
    If you are trying to open an Excel form that is attached to the PDF file (via the attachments tab in
    Acrobat), then this is the wrong script to use. You should consult the Acrobat Javascript reference:
    http://partners.adobe.com/public/developer/en/acrobat/sdk/pdf/javascript/AcroJS.pdf
    You may want to try the Adobe Acrobat Scripting forum as well.
    Justin Klei
    Cardinal Solutions Group
    www.cardinalsolutions.com

Maybe you are looking for

  • Variable for Query

    Hai Gurus, I have a report which gives all the requisitions with differrent status in the report based on Req. start date. In addition to this i got a requirement in the same report where user can enter date interval.. Based on the user date interval

  • How to get name of missing font

    Hi, I'm sure this is an easy one but..my pc crashed and i lost loads of fonts. when I now open old work, it naturally tells me fonts are missing. problem being, that i can't remember which fonts i used on every piece of work. Is there a way of firewo

  • Separate thread for input stream and output stream.

    Hi Techies, In a socket connection, can we run the input stream and output stream in separate threads. actually in my case, the input stream will be getting the input regularly and output stream will send data very rare. so if i impelment them in one

  • Query regarding naming of program

    With what name we should save the program having three different classes. One class is with main method. Normally we save the program with the name of class having main method. My query is whether we can have three different classes in the same progr

  • Read currently running workflow information

    Hi everybody, Please let me know if anyone came across a situation where we need to read the currently running workflow information.. To be precise, I have a workflow which starts a method, which in turn executes code present in an include.. Now, in