Read a file sent as an attachment from CPSC

                   I have a requirement where in CPO has to read a text file sent as an attachment from portal (cisco prime service catalog), Is there a way to query RCdatabase to fetch Document ID and retrive the file and read the file. If this approach is not feasible, is there an alternate way to host the text file in an external location and pulled from there?

Hi,
is the next part of the code correct.
What i mean is packing of the attachment, finding out the size of pdf file and doc type as PDF.
You can also try below link..
Link: [http://wiki.sdn.sap.com/wiki/display/Snippets/SENDALVGRIDASPDFATTACHMENTTOSAPINBOXUSINGCLASSES]
Hope this helps.
Regards,
-Sandeep

Similar Messages

  • Why has my Adobe X suddenly stopped reading PDF files sent to me?

    Why has my Adobe X suddenly stopped reading PDF files sent to me?

    How are you trying to read them? What process are you using and what applications are involved?

  • Error while opening a pdf file sent as an attachment in mail

    Dear All,
            We have converted a alv grid into pdf and sent a mail with the attached pdf file. When the attachment is opened in the received mail we get an error " File does not begin with %pdf-". I am pasting the code.
    Select single
      from
        TSP01
      where
        RQIDENT = wa_listident.
      if sy-subrc <> 0.
         exit.
      endif.
      client = tsp01-rqclient.
      name   = tsp01-rqo1name.
    *BREAK-POINT.
      CALL FUNCTION 'RSTS_GET_ATTRIBUTES'
             EXPORTING
                  AUTHORITY     = 'SP01'
                  CLIENT        = client
                  NAME          = name
                  PART          = 1
             IMPORTING
              CHARCO        =
              CREATER       =
              CREDATE       =
              DELDATE       =
              MAX_CREDATE   =
              MAX_DELDATE   =
              NON_UNIQ      =
              NOOF_PARTS    =
              RECTYP        =
              SIZE          =
              STOTYP        =
                  TYPE          = type
                  OBJTYPE       = objtype
             EXCEPTIONS
                  FB_ERROR      = 1
                  FB_RSTS_OTHER = 2
                  NO_OBJECT     = 3
                  NO_PERMISSION = 4.
      if objtype(3) = 'OTF'.
        is_otf = 'X'.
      else.
        is_otf = space.
      endif.
    *BREAK-POINT.
    CALL FUNCTION 'RSPO_RETURN_SPOOLJOB'
             EXPORTING
                  rqident              = wa_listident
                  desired_type         = desired_type
             IMPORTING
                  real_type            = real_type
             TABLES
                  buffer               = l_objcont
             EXCEPTIONS
                  no_such_job          = 14
                  type_no_match        = 94
                  job_contains_no_data = 54
                  no_permission        = 21
                  can_not_access       = 21
                  read_error           = 54.
        IF sy-subrc EQ 0.
          attach_type = real_type.
        ENDIF.
    if is_otf = 'X'.
    CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
            EXPORTING
              SRC_SPOOLID                    = wa_listident
              NO_DIALOG                      = c_no
          DST_DEVICE                     =
          PDF_DESTINATION                =
            IMPORTING
              PDF_BYTECOUNT                  =  gd_bytecount
              PDF_SPOOLID                    = pdfspoolid
          OTF_PAGECOUNT                  =
              BTC_JOBNAME                    = jobname
              BTC_JOBCOUNT                   = jobcount
            TABLES
              PDF                            = it_pdf_output
            EXCEPTIONS
              ERR_NO_OTF_SPOOLJOB            = 1
              ERR_NO_SPOOLJOB                = 2
              ERR_NO_PERMISSION              = 3
              ERR_CONV_NOT_POSSIBLE          = 4
              ERR_BAD_DSTDEVICE              = 5
              USER_CANCELLED                 = 6
              ERR_SPOOLERROR                 = 7
              ERR_TEMSEERROR                 = 8
              ERR_BTCJOB_OPEN_FAILED         = 9
              ERR_BTCJOB_SUBMIT_FAILED       = 10
              ERR_BTCJOB_CLOSE_FAILED        = 11
      CHECK sy-subrc = 0.
      ENDIF.
    Transfer the 132-long strings to 255-long strings
      LOOP AT it_pdf_output.
        TRANSLATE it_pdf_output USING ' ~'.
        CONCATENATE gd_buffer it_pdf_output INTO gd_buffer.
      ENDLOOP.
      TRANSLATE gd_buffer USING '~ '.
      DO.
        it_mess_att = gd_buffer.
        APPEND it_mess_att.
        SHIFT gd_buffer LEFT BY 255 PLACES.
        IF gd_buffer IS INITIAL.
          EXIT.
        ENDIF.
      ENDDO.
    Please guide me to resolve this issue.
    Thanks & Regards,
    Anand

    Hi,
    is the next part of the code correct.
    What i mean is packing of the attachment, finding out the size of pdf file and doc type as PDF.
    You can also try below link..
    Link: [http://wiki.sdn.sap.com/wiki/display/Snippets/SENDALVGRIDASPDFATTACHMENTTOSAPINBOXUSINGCLASSES]
    Hope this helps.
    Regards,
    -Sandeep

  • How to read a file and pickup some information from  a file

    Hai all,
    I wrote a beloe program to read a file and write it into another file
    import java.io.*;
    public class Rdata {
    /** Creates a new instance of Rdata */
    public Rdata() {
    public static void main(String a[])throws Exception
    FileReader fr=new FileReader("c:\\java\\attach\\attach2\\resume1.doc");
    FileWriter fw=new FileWriter("C:\\java\\attach\\abc2.doc");
    char ch;
    int i;
    while((i=fr.read())!=-1)
    ch=(char)i;
    fw.write(ch);
    fw.close();
    This program reads the content from resume1.doc and write it into abc2.doc . But in my project I want to read the resume1.doc and and write only peace of information like "keyskills are java,jsp,javamail"
    I mean how to read the entaire file and how to write into another file whisc i require
    Thanks&regards
    radhs

    http://java.sun.com/docs/books/tutorial/essential/io/

  • Reading XML file having various foreign languages from web application.

    Greeting..
    I'm dealing with a so-called serious problem where-in:
    I've to read one of the configuration files(XML files) having values in different foreign languages (like Chinese, Japanese, Arabic etc). I've to read that file contents, in as it is form, in such a way that user can read / change the data from the web application.
    I'm showing the XML file inside the TextArea (the HTML <textarea> tag. While reading this file, it got converted to junk values instead of actual ones. While saving this file it changes those original values to junk in file as well.
    I'm using SAX parser with DefaultHandler.
    Better suggestions are welcome.
    Thanks in advance
    Regards

    rikslovein wrote:
    Better suggestions are welcome.You have a number of places where data corruption could occur. You have not yet identified where it occurs. When you know where it occurs it would be much easier to determine a solution.
    Do NOT display the characters to determine the problem. Instead take a small sample and print the numeric values. And do that at each stage/layer until they do not match.

  • File name of an attachment from HttpURLConnection

    Hi
    I am using HttpURLConnection to download an attachment. Pls someone tell me how to get the file name of the attachment that's to be downloaded.
    Regards
    Faisal

    Well the <b>Content-Disposition</b> header is not always set by the servers when they write the file to the OutputStream. I find that only when the URL itself doesn't given an hint of the File name, a value for <b>Content-Disposition</b> is given.
    For E.g. URL's like <u>http://somehost/context/somefile.zip</u> doesn't give a value for Content-Disposition, where as <u>http://somehost/context/somefile</u> would give a value for <b>Content-Disposition</b>.

  • Minimnum requirement system to read pdf files with 3d model attachement in acrobat 7 or 8

    I would like to know what is the minimum system requirement(mac and pc) to read a file by a user of pdf acrobat reader 7 or 8.
    Does it necessary to have a graphic card, minimum processor needed and screen resolution. If the computer accept the installation of release acrobat 7 or 8 , dose it mean it can read the 3d file attachment.
    I heard that it is possible to install acrobat 7 or 8 only on xp or vista, is it the same for apple computers.
    thanks

    >I would like to know what is the minimum system requirement(mac and pc) to read a file by a user of pdf acrobat reader 7 or 8.
    The product is no longer called Acrobat Reader. It is now called Adobe
    Reader.
    >
    >Does it necessary to have a graphic card, minimum processor needed and screen resolution. If the computer accept the installation of release acrobat 7 or 8 , does it mean it can read the 3d file attachment.
    >
    >I heard that it is possible to install acrobat 7 or 8 ...
    You mean Reader? Acrobat Professional? Acrobat 3D?
    >only on xp or vista, is it the same for apple computers?
    No, you cannot install Vista or XP on Apple computers.
    I think you may want to look at
    http://www.adobe.com/products/reader/productinfo/systemreqs/
    Aandi Inston

  • Read pdf files stored in icloud drive from ios8

    Ok. So how do I Access and read my PDF files stored in icloud drive from my ipad?
    I´ve read that there´s no icloud drive App like dropbox and that it has to be done from a third party App. (strange enough), but I can´t seem to find a third party App that connects to icloud drive yet.
    Thanks.

    The Apple website specifically states "Because with iCloud Drive, you can safely store all your presentations, spreadsheets, PDFs, images and any other kind of document in iCloud and access them from your iPhone, iPad, iPod touch, Mac or PC.".
    Now, howe do I "store my PDF" and "access them from my iPhone"?

  • How to read only files with a certain format from folder with java

    I have this folder on the server and I only want to read files from this folder on the server... I only want to read files with the files format starting with error_ and ending with xml... an example of a file would be..
    error_123.xml
    I want something like this
    if(fileName.startsWith("error_") && fileName.endsWith(".xml")){
    but which java package will I have to use to read the file from the directory...

    Create an implementation of the java.io.FilenameFilter interface to match the pattern you need.
    Create a java.io.File object for the folder.
    Use the File.listFiles(FilenameFilter) method to get an array of File objects for the files in the folder that match the pattern.
    For each file in the array, create a FileInputStream, wrap it in an InputStreamReader, and wrap that in a BufferedReader (assuming you want to read the XML files as character streams).

  • How to read multiple files of a specified format from a selected folder?

    i want to read multiple files of specified format from a selected folder, even if the selected folder contains multiple sub-folders, is it possible, if so please provide me a sample.

    try this:
    foreach (string dirPath in Directory.GetDirectories(WriteYourPathHere, "*",SearchOption.AllDirectories))
    string[] files = System.IO.Directory.GetFiles(dirPath, "*.txt");
    //loop over files array and do what you want with .txt files picked up during the loop
    OR in one line also:
    foreach (string file in Directory.GetFiles(WriteYourPathHere,
    "*.txt", SearchOption.AllDirectories))
    Fouad Roumieh

  • Pdf file sent via email attachment gets a webloc extension

    Someone sent an email with a pdf attachment to our entire school via our google mail account. People with PCs were able to open the pdf files. Mac users received the pdf files with a webloc extension (i.e. - filename.pdf.webloc) and were unable to open it. How did this happen and how can we prevent it from happening again? I had 2 of the pdf files on my mac (one of which I created) and they did not have a webloc extension. Any help would be great. Thank you!!

    Hi Kappy.
    I tried that and received a message from Adobe Acrobat that read "Adobe Reader could not open 'Absentee Ballot.pdf' because it is either not a supported file type or because the file has been damaged (for example, it was sent as an email attachment and wasn't correctly decoded).
    Since we have 300+ families who receive these emails and I don't know who has a mac and who doesn't I would rather be able to send the pdf attachments and prevent the webloc from being applied at all versus letting everyone know how to remove it once they receive it.
    Thanks for replying.
    Christina

  • Setting up the File Name of email Attachment from Received File Name

    Hello All,
    I have to send the Received File in attachment to an Email if there is any exception. Here I can attach the file, but I cannot set the file name of attachment as the Received File Name. Is there anyway of doing this without using custom pipeline component.
    Here I am using the Orchestration and SMTP Adapter.Any help is greatly appreciated.
    Thanks

    It might work if you use a custom pipeline component on your send port and in the Execute method populate the MIME.FileName property of the body part.
    Something like:
    public IBaseMessage Execute(IPipelineContext pc, IBaseMessage inmsg)
    string filename = inmsg.Context.Read("ReceivedFileName", "http://schemas.microsoft.com/BizTalk/2003/file-properties");
    inmsg.BodyPart.PartProperties.Write( "FileName", "http://schemas.microsoft.com/BizTalk/2003/mime-properties", "filename);
    return inmsg;
    You can take reference from similar post here
    SMTP - Setting attachment filename
    Anther good article with MIME is here
    Setting attachment filename with the SMTP Adapter
    For MIME case your SMTP message construct statement would be like below
    multipartMessage.MessagePart_1= InMSG;
    multipartMessage.MessagePart_2="This is message part2 as a string";
    multipartMessage(SMTP.Subject) ="Email From Dynamic Port";
    multipartMessage(SMTP.From) ="[email protected]";
    multipartMessage(SMTP.SMTPHost) ="yoursmypserver.com";
    multipartMessage.MessagePart_2(MIME.FileName) = "Attachment_Name";
    multipartMessage(SMTP.SMTPAuthenticate) =0;
    Thanks
    Abhishek

  • Problem Reading pdf files sent thru e-mail

    I saved some software output prints to pdf files (software has option for saving to pdf) and e-mailed to a co-worker.  I can see and print fine from my hard drive but recipient got only dots on the pages.  Should have been numbers and text.  I have Adobe 8.1.2.  Do you have any idea why this happened or what to do?  Thanks.

    Some email servers corrupt PDF files because they use the wrong encoding for them. Try zipping them up before sending them.

  • How to read xml file present in the UCMS from  webcenter portal application

    Hi,
    I'm new to webcenter portal and would like to know how to read an xml file which is present in UCMS 11g(contributors folder) from webcenter portal application.
    Thanks in advance

    I guess I had mentioned that I want to read it via my webcenter portal app rather than login to ucms and searching it via url.
    I want text labels and button names being stored in the xml file which I'm going to keep in the UCMS.
    After reading that from the xml will be placed at appropriate locations like the button values and label feilds, so that we dont need to deploy entire app for this kind of simple changes.
    Now can anyone provide some help with the api's related to this?

  • Cannot read pdf files sent to Nokia N76 phone

    i just got my n76 and when i transfered my pdf file to it, it managed to open but no words could be seen. every page was a blank one. bookmarks were present but just no words. anyone has such a problem? can anybody help? thanks

    Hi,
    What is your OS, browser version and Adobe Reader version.
    Can you view the following PDF : http://helpx.adobe.com/content/dam/help/attachments/Acrobat_Reader_ReleaseNote_10.1.3.pdf
    What exactly happens when you open PDF attachments. Can you post a screenshot of any error, if any

Maybe you are looking for