How to read attachment content of activity in crm

Hi, experts
  I want read a excel content into internal table who is
  attachment of activity in crm, but it is not successful.
  I use the class 'CL_CRM_DOCUMENTS'.
  Thanks you for your help!

Hi, experts
  This issue is very urgent!
  Who can help me?
  Thanks you very much!

Similar Messages

  • How to read the contents of attached files

    Hi,
    I am designing a Form using LiveCycle Designer 8.0
    Scenario:
    User can attach the file through "Attachments" facility provided on Adobe  Reader.
    The requirement is to attach 3 documents and post it to SAP system using Web services.
    I am using the following code(which i got from this forum only) to find the number of files user has attached.
    d = event.target.dataObjects;
    n =  d.length;
    xfa.host.messageBox("Number  of Attachments: "+n);
    //Displaying  the names of the Attached files
    for( i =  0; i < n; i++ )
    xfa.host.messageBox("Name  of the file: "+d[i].name);
    My problem: is how to read the contents of the attached files so that I post it to SAP using Web services
    Thanks in advance!!
    Taha Ahmed

    In order to read the content of the Redo Log files, you should use Logminer Utility
    Please refer to the documentation for more information:
    [Using LogMiner to Analyze Redo Log Files|http://download.oracle.com/docs/cd/B19306_01/server.102/b14215/logminer.htm#SUTIL019]
    Kamran Agayev A. (10g OCP)
    http://kamranagayev.wordpress.com
    [Step by Step install Oracle on Linux and Automate the installation using Shell Script |http://kamranagayev.wordpress.com/2009/05/01/step-by-step-installing-oracle-database-10g-release-2-on-linux-centos-and-automate-the-installation-using-linux-shell-script/]

  • Help on how to read the content of an XML file from the payload

    I have a receiver channel / mail adapter, that sends e-mails with a XML attachment.
    I’m trying to write a Bean, that should make it possible to rename the attached XML file dynamically.
    In the Bean I want to read the content of the attached XML file, it could be the “order number”.
    The filename should then be “Order number”.XML.
    <u><i>Can anyone help me with how to read the content of the XML file from the payload.</i></u>
    <i><b>Frank</b></i>

    hi,
    check this: http://jakarta.apache.org/poi/

  • How to read attachment data in mapping

    Hi,
    In my scenario I receive an XML file with another file as attachment. I need to map both the content of the XML file and the attachment to the target which will be sent as an attachment in a mail.
    I have used JavaMapping and I'm now able to send the mail with the attachment. But i'm not sure how to  read the contents of the attachment in the mapping.
    Any help would be appreciated.
    Thanks,
    Bhargav
    Edited by: Bhargav Srinadh Gundabolu on Feb 12, 2009 10:03 PM

    Hello Bhargav,
    It depends on the version of SAP PI you have,
    Prior to Version 7.1 there was no support to access attachments in a Mapping Programm, so in that
    case the only way to handle it is e.g. to access it in an adapter module (dependent on your scenario).
    In SAP PI 7.1 you can easily access an attachment within a mapping.
    Within a Java mapping program this can be done with the TransformationInput Class, calling the method getInputAttachments() which will give you all available attachments.
    Also see the SAP PI 7.1 javadocs (com.sap.aii.mapping.api):
    https://help.sap.com/javadocs/pi/SP3/xpi/index.html
    In a graphical mapping you can access attachments within a UDF through the GlobalContainer parameter:
    GlobalContainer globalContainer = container.getGlobalContainer();
    InputAttachments inputAttachments = globalContainer.getInputAttachments();
    With best regards
                Sebastian

  • How to read the content in one node of XML in Java? Pls help

    My dear brothers,
    I am a newbie of XML, I have a exercise which is creating a Tree View from XML file. But the trouble is I do not know how to read the content in one node of XML file. I decide to use the algorithm as following:
    1. Create a GUI form which gives the ability for user to choose a XML file (ok)
    2. Load XML and return the file (ok)
    3. Read the file from node to node to create the node in Tree View (?!)
    Please help me, and if you are enough kind, please give me an small example to easy understand. Thanks in advance.
    Hoang Yen Binh

    I hope this one helps you.
         <ABC Type="ProductBased" ProdName="One" Location="India">
              <CEO>Raj</CEO>
              <Finance>Vikram</Finance>
              <HR>Karthik</HR>
              <Technical>Satish</Technical>
         </ABC>
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.NamedNodeMap;
    import org.w3c.dom.Attr;
    import org.w3c.dom.NodeList;
    import org.w3c.dom.Node;
    import org.w3c.dom.DOMException;
    import javax.xml.parsers.ParserConfigurationException;
    import org.xml.sax.SAXException;
    import java.io.File;
    import java.io.IOException;
    public class XmlReading {
         Document doc;
         Element element;
         public static void main(String[] args) throws Exception{
              XmlReading xr = new XmlReading();
              xr.getXmlParser(args);
         public void getXmlParser(String[] args) {
              DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
                   if(args.length != 1) {
                        System.err.println("Argument Required");
              try {
                   DocumentBuilder builder = factory.newDocumentBuilder();
                   doc = builder.parse(new File(args[0]));
              }catch(ParserConfigurationException e1) {
              }catch(SAXException e2) {
              }catch(IOException e3) {
              getAttributes();
         public void getAttributes() {
              // Retrive the entire Document from the Dom Tree
              element = doc.getDocumentElement();
    //          System.out.println(element);
              NamedNodeMap attrs = element.getAttributes();
              // Get number of attributes in the element
         int numAttrs = attrs.getLength();
         // Process each attribute
              for (int i=0; i<numAttrs; i++) {
                   Node node = attrs.item(i);
                   // Get attribute name and value
                   String attrName = node.getNodeName();
                   String attrValue = node.getNodeValue();
                   System.out.println(attrName + ": " + attrValue);
              String s1 = element.getTagName();
              System.out.println(s1);
              // To get all the elements in a DOM Tree
              NodeList nl1 = element.getElementsByTagName("*");
              int i2 = nl1.getLength();
              System.out.println(i2);
              for(int i=0; i<i2; i++) {
                   System.out.println(nl1.item(i) + "\n");
    }

  • Help me...How to read the content if "Transfer-Encoding:chunked" is used?

    I am doing a project for internet control using Java,PHP and MySql.All sites should go through the proxy server only.If the HTTP header contains Content-Length,am getting the content length as below:
    public class HTTPResponseReader extends HTTPMessageReader
        String statusCode;
        public HTTPResponseReader(InputStream istream) throws IOException,                     NoSuchElementException
      BufferedInputStream distream = new BufferedInputStream(istream);
      retrieveHeader(distream);
      StringTokenizer st =  new StringTokenizer(new String(HTTPMessageReader.toArray(header)));
      versionProtocol = st.nextToken();
      statusCode = st.nextToken();
      String s;
      while (st.hasMoreTokens())
            s = st.nextToken();
            if (s.equals("Transfer-Encoding:"))
           transferEncoding = new String(st.nextToken());
         if (s.equals("Content-Length:"))
           contentLength = Integer.parseInt(st.nextToken());
         if (s.equals("Connection:"))
          connection = new String(st.nextToken());
          if (connection.equals("keep-alive")) mustCloseConnection = false;
       retrieveBody(distream);     
    }After getting the Content-Length,i used read method to read the content upto that content length.Then i concatenated the HTTP header and body and the requested site was opened.But some sites dont have Content-Length.Instead of that,Transfer-Encoding is used.I got the HTTP Response header as "Transfer-Encoding:chunked" for some sites.If this encoding is used how to get the length of the message body and how to read the content.
    Can anybody help me.
    Thanks in advance...
    Message was edited by:
    VeeraLakshmi

    Why don't you use HttpUrlConnection class to retrieve data from HTTP server? This class already supports chunked encoding...
    If you want to do anything by yourself then you need to read HTTP RFC and find all required information. Well in two words you may reject advanced encoding by specifying HTTP 1.0 in your request or download chunked answer manually. Read RFC anyway :)

  • How to read the content of a text file (by character)?

    Guys,
    Good day!
    I'm back just need again your help. Is there anyone knows how to read the content of a text file not by line but by character.
    Please help me. Thank you so much in advance.
    Jojo

    http://java.sun.com/javase/6/docs/api/index.html
    package java.io
    InputStream.read(): int
    Reads the next byte of data from the input stream.
    Implementation:
    InputStreamReader
    An InputStreamReader is a bridge from byte streams to character streams: It reads bytes and decodes them into characters using a specified charset. The charset that it uses may be specified by name or may be given explicitly, or the platform's default charset may be accepted.

  • How to read the content of ms-word file use pure java???

    how to read the content of ms-word file use pure java???

    hi,
    check this: http://jakarta.apache.org/poi/

  • How to Read Attached Document In oracle apps.

    Hi All,
    how to read attached document in Oracle apps.
    Select * from   fnd_attached_documents.
    Regards,
    Mohan Reddy

    Hi Husseein,
    how to read pdf file in blob data type column
    i have tried below query but in this part utl_file.fopen asking directory name i don't have directory name.
    could you give any another solution.
    DECLARE
      l_file      UTL_FILE.FILE_TYPE;
      l_buffer    RAW(32767);
      l_amount    BINARY_INTEGER := 32767;
      l_pos       NUMBER := 1;
      l_blob      BLOB;
      l_blob_len  NUMBER;
    BEGIN
      SELECT FILE_DATA
        INTO   l_blob
        FROM   fnd_lobs
         where file_name = 'est-1.pdf' and FILE_ID = 332810;
      l_blob_len := DBMS_LOB.getlength(l_blob);
      -- Open the destination file.
      l_file := UTL_FILE.fopen('IRB','STD_FlipBook_Religion2013.doc','wb',18306);  --(Here I don't have Directory name)
      DBMS_LOB.read(l_blob, l_amount, l_pos, l_buffer);
      UTL_FILE.put_raw(l_file, l_buffer, TRUE);
      l_pos := l_pos + l_amount;
      -- Close the file.
      UTL_FILE.fclose(l_file);
    END;
    Regards,
    Mohan Reddy

  • Read attachment content in Mapping

    Hi,
    In PI 7.1 there is one option to read attachment content inside mapping using the api: "com.sap.aii.mapping.api".
    To do that in operation mapping we have to check the option "ReadAttachments", to get the attachments in addition to the payload. If I check the Readattachments check box, message goes into the queue and the queue status is running.
    Please help me to read the attachment content in mapping.
    Thanks & Regards,
    Yuga

    Hi,
    That issue has been solved,the problem is with the syntax.
    Now I was able to get the attachment details,but i was not able to read the content of the attachment.
    Here is my code:
    String Content = "";
    String AttachmentID ="";
    GlobalContainer globalContainer = container.getGlobalContainer();
    InputAttachments inputAttachments = globalContainer.getInputAttachments();
    if(inputAttachments.areAttachmentsAvailable())
         Collection<String> CollectionIDs = inputAttachments.getAllContentIds(true);
         Object[] arrayObj = CollectionIDs.toArray();
         int attachmentCount = arrayObj.length;
         for(int i =0;i<attachmentCount;i++)
                AttachmentID =(String) arrayObj<i>;
                  Attachment attachments =inputAttachments.getAttachment(AttachmentID);
              Content = Content + attachments.getContent().toString();
    return Content;
    My requirement is to read all the attachment's.Attachment has XML content, so after reading I need to parse the xml content inside graphical mapping itself is there is any option to do like this.
    Thanks & Regards,
    Yuga

  • About pre-populationg the data in the survey Attached to an activity in CRM

    Hello Gurus,
    I have a question regarding Pre-Populating the header data in the survey attached to an activity in CRM Mobile 4.0. That in can we define a Functional module for a PBO (Process Before Output) for a survey  u201CZ_SVY_Templateu201D  in CRM 4.0.
    So that when a Sales rep opens the Survey in CRM Mobile 4.0 the Organizationu2019s Header data should automatically be displayed in the u201CZ_SVY_Templateu201D, so that he just needs to fill out only the remaining additional blank fields in the survey.
    << Moderator message - Please do not offer points >>
    Thanks,
    Siddhu
    Edited by: Rob Burbank on Oct 8, 2010 2:15 PM

    Moderator message - Welcome to SCN
    Please read [Rules of Engagement|https://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement], How to post code in SCN, and some things NOT to do... and [Asking Good Questions in the Forums to get Good Answers|/people/rob.burbank/blog/2010/05/12/asking-good-questions-in-the-forums-to-get-good-answers] before posting again.

  • Pre-Populating the header data in the survey attached to an activity in CRM

    Hello Gurus,
    I have a question regarding Pre-Populating the header data in the survey attached to an activity in CRM Mobile 4.0. That in can we define a Functional module for a PBO (Process Before Output) for a survey u201CZ_SVY_Templateu201D in CRM 4.0.
    So that when a Sales rep opens the Survey in CRM Mobile 4.0 the Organizationu2019s Header data should automatically be displayed in the u201CZ_SVY_Templateu201D, so that he just needs to fill out only the remaining additional blank fields in the survey.
    << Moderator message - Please do not offer points >>
    Thanks,
    Siddhu
    Edited by: Rob Burbank on Oct 8, 2010 2:16 PM

    Moderator message - Cross post locked
    Rob

  • How to read attachment via function module??

    Hi All,
    I have to Read the content of attachment of standard task TS00407864.
    For that i have used a function module SAP_WAPI_GET_ATTACHMENTS.
    and i got this.
    OBJECT_ID                                SOFM      FOL32000000000004RAW340
    DESCRIPT                       Office Document
    SHORTTEXT                      Office Document
    DEF_ATTRIB                     Document Not as per Accounting Stantard
    OBJECT_TYP                     AT
    Now i have to read it in internal table which function i should use and how can i pass the value to it.
    Please Help!
    Regards,
    Purvesh Patel.

    Hi,
    use method cl_swf_utl_convert_por=>convert_bor_to_ibf( ). Also properly defined structures will parse data without need of offset reading/parsing.
    Example:
         data:
             lt_attachment         type  swrtobject,
             lt_wapi_message       type  swr_msgtab,
             ls_docid              type  soentryi1,
             lv_subrc              type  sy-subrc,
             lv_doc_id             type  sofolenti1-doc_id
         field-symbols:
             <ls_attachment>       type  swr_object
         call function 'SAP_WAPI_GET_ATTACHMENTS'
             exporting
                 workitem_id     = me->mv_workitem_id
                 user            = me->mv_username
                 language        = me->mv_language
             importing
                 return_code     = lv_subrc
             tables
                 attachments     = lt_attachment
                 message_struct  = lt_wapi_message
         if ( lv_subrc <> 0 ).
             "! Handle error / messages
         endif.
         loop at       lt_attachment
             assigning <ls_attachment>
             lv_doc_id = cl_swf_utl_convert_por=>convert_bor_to_ibf( i_bor_por = <ls_attachment>-object_id ).
             ls_docid  = lv_doc_id.
         endloop.

  • 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

  • WebDynpro: How to read file content?

    Hi,
    My business scenario requires:
    1, The file name is passed in through inbound plug parameter
    2, I need to read the file content and then attach it to my CRM transaction
    Please share with me how to read the file content.
    The following approaches do not fit my scenario:
    1, UI element: FileUpload
    The reason is obvious: there is only file name parameter instead of any UI interface
    2, Function Module: GUI_UPLOAD
    The reason is that dump will happen in WebDynpro environment
    Thanks & Best Regards,
    David

    HI,
    Refer these links  -
    Get content document in WD abap
    Excel File to Internal Table

Maybe you are looking for