Reading attachments in PI map

Hi,
I have a scenario where, i have attachment (PDF) are getting attached through Proxy. I need to save these attachments to Live Link Folder.
I have seen some posts here where they have explained the java code used in UDF to read the attachments. I have implemented that. The problem is Message mapping when i test is working fine, no errors. But the operation mapping throws the error. I have checked the "Read Attachments" Flag but still it doesn't work.
Can any body please help me with some blog or steps that explains the steps.
Also i read on SDN that only XML attachments can be read, but that also didn't worked for me.
Any help will be really appreciated
Thanks
-Kulwant

Hi,
>>>I have a scenario where, i have attachment (PDF) are getting attached through Proxy. I need to save these attachments to Live Link Folder.
why don't you use swappayload bean to put the PDF into the folder ?
Regards,
Michal Krawczyk

Similar Messages

  • Read Attachments in Operations Mapping called by Transformation Step

    Hello,
    I would like to read the attachment of my input message. I created an UDF that assigns the attachment to to a target field, furthermore I have activated the option "Read Attachments" in operation mapping.
    But when I call the operation mapping in a transformation step in BPM, the target field is not filled. Is it not possible to read attachments in BPM?
    Thank you for your advice.

    Attachments are not available inside BPM.
    Try to do the mapping outside BPM.

  • Read Attachments using Java Mapping API

    Hello,
    after investigating the Java Mapping API a little deeper I found some very interesting Interfaces "InputAttachments" and "Attachments" which could do exactly what is required:
    Reading attachments and convert them into base64 code.
    As I am not an experienced Java Programmer howeve, I am note sure how to use those interfaces.
    For example there is a method defined in interface "InputAttachments":
    Attachment getAttachment(String contentID)
    How do I use it? If I use it in a way like "InputAttachments.getAttachment("abc");" then I get the error that it is not a static method. However how do I instantiate "InputAttachments".? As it is an interface I am not sure how to do this.
    Any idea how to handle these methods?

    Hi,
    I am working on the similar. I am able to attach txt files and csv files but have trouble attaching xcel and pdf's. Any input is appreciated. Thanks

  • Problem by adding attachments in Java Mapping

    Hi,
    we have to add some attachments in Java Mapping.
    So we are using the Java Mapping API.
    But it doesn't work correctly.
    We got the following error in sxmb_moni:
    Attribute Manifest ExampleAttachment is initial
    So we checked what happened in the Manifest and in the SAP SOAP Envelope and we see that there is an inconsistence.
    In the SAP Manifest we find the following entries:
    <SAP:Manifest xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:wsu="http://www.docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="wsuid-manifest-5CABE13F5C59AB7FE10000000A1551F7">
         <SAP:Payload xlink:href="cid:payload-79a6e3c088db11dfa4dd0017a477c1e8<at>sap.com">
              <SAP:Name>MainDocument</SAP:Name>
              <SAP:Description/>
              <SAP:Type>Application</SAP:Type>
         </SAP:Payload>
         <SAP:Payload xlink:href="ExampleAttachment">
              <SAP:Name>ExampleAttachment</SAP:Name>
              <SAP:Description/>
              <SAP:Type>ApplicationAttachment</SAP:Type>
         </SAP:Payload>
    </SAP:Manifest>
    For us it seems the entry for our ExampleAttachment is wrong. I think there must be a real content id for the attachment like the cid for the MainDocument. In the SOAP Envelope you can find the following entry for the attachment:
    content-type:text/plain
    content-length:45
    content-id:payload-79a6e3c088db11dfa4dd0017a477c1e8<at>sap.com
    This is an example for an attachment!
    --SAP_0017A477C1EC1DEFA3D200A5CB55CE04_END--
    So here you can see a real content ID, but you can't find it in the Manifest.
    So do we anything wrong in our source code or is it a bug of the SAP API?
    Do you have any ideas?
    Here the Java Mapping we're using for adding an attachment (as a test):
    import java.io.BufferedReader;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    import java.io.Reader;
    import com.sap.aii.mapping.api.AbstractTransformation;
    import com.sap.aii.mapping.api.DynamicConfiguration;
    import com.sap.aii.mapping.api.DynamicConfigurationKey;
    import com.sap.aii.mapping.api.StreamTransformationException;
    import com.sap.aii.mapping.api.TransformationInput;
    import com.sap.aii.mapping.api.TransformationOutput;
    import com.sap.aii.mapping.api.Attachment;
    public class SUSAttaHandler extends AbstractTransformation {
         private static final DynamicConfigurationKey KEY_FILENAME    = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
         // Transform Method
         public void transform(TransformationInput in, TransformationOutput out)
                   throws StreamTransformationException {
              // An info message is added to trace
              getTrace().addWarning("JAVA Mapping AttaHandler called!");
              // Input payload
              String inData = convertStreamToString(in.getInputPayload().getInputStream());
              // dynamic configuration
              DynamicConfiguration conf = in.getDynamicConfiguration();
              String fileName          = conf.get(KEY_FILENAME);
              getTrace().addWarning("AttaHandler: FileName = " + fileName);
              String text = new String("This is an example for an attachment!");
              Attachment atta = out.getOutputAttachments().create("ExampleAttachment", "text/plain", text.getBytes());
              out.getOutputAttachments().setAttachment(atta);
              String outData = inData;
              try {
                   out.getOutputPayload().getOutputStream().write(outData.getBytes("UTF-8"));
              catch(Exception exception1) { }
         // convert Stream to String
         public String convertStreamToString(InputStream in){
              StringBuffer sb = new StringBuffer();
              try {
                   InputStreamReader isr = new InputStreamReader(in);
                   Reader reader = new BufferedReader(isr);
                   int ch;
                   while((ch = in.read()) > -1) {
                        sb.append((char)ch);}
                        reader.close();
              } catch(Exception exception) { }
              return sb.toString();
    Thanks for your help,
    Thorsten

    Hi,
    we created an OSS ticket for this problem and SAP created a SAP note.
    Here the number of the note: 0001501345
    I hope this will help you.
    Thorsten

  • 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

  • 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

  • MDM API to read the Record Key Mapping table

    Hi,
    Does anybody know what class/method I can use to read the Record Key Mapping table?
    For the Business Partner table the Key Mapping table has this columns:
    <u>Default / MDM Partner ID / Remote System / Key</u>
    I have everything but the Key. How can I read it?
    Thanks in advance,
    Diego.

    GetKey Mapping is one of the available Web Services as of SP4.
    Else you could use the Java API to get the Key Mapping.
    <b>CatalogData class</b> has the following method
    <b>GetKeyMapping</b>
    public java.lang.String[][] GetKeyMapping(java.lang.String agency,
                                              java.lang.String table,
                                              int[] recordIDs,
                                              boolean isDefaultKeyOnly)
                                       throws StringExceptionRetrieves the key mapping for each record.
    Parameters:
    agency - the agency name.
    table - the table name.
    recordIDs - the list of records.
    isDefaultKeyOnly - True to retrieve only the default value, False to all key values.
    Returns: the key values for each record.

  • Reading files from a mapped drive

    Hello,
    I am trying to pull image files off of a network share in Oracle Forms.
    Everytime I do this, I get error FRM-47109 Cannot locate image file..... i
    have tried accessing this drive with 2 methods:
    1. Button trigger calls with READ_IMAGE_FILE(:datablock.imagelocation ||
    :datablock.filename || '.tif', 'ANY', BLOCK7.IMAGE_ITEM);
    2. Button trigger calls with READ_IMAGE_FILE('\\server\images\'
    ||:CRASH_IMAGES.folder || '\' || :crash_images.docno ||'.tif',
    'ANY', 'BLOCK7.IMAGE_ITEM');
    Both of these calls work on the development side where the T:\ drive is mapped.
    When the form is put on the production server with the same T:\ drive mapping,
    the image is unable to be located.
    I have also found Microsoft article Q122702, which explains how network shares
    are distributed to services. I have edited the registry key
    RestrictNullSessAccess to a value of 0, and remapped the drive using: NET USE
    T: \\server\images /user:Administrator password.
    None of this has worked for me so far, and I have been informed of possible
    issues with forms and mapped network drives. Has anyone seen this before or know of a fix?
    Thanks,
    Jordan

    I'm not too familiar with Windows user accounts.
    I'm having this problem of not being able to read files from a mapped drive.
    Using 10.1.2 Forms Service on a XP machine.
    How do i check to see which user is running the forms service and/or how do I change the settings a user has access to?
    Check in server-info and User/Group: #-1(1)/1, what the heck??
    Thanks.

  • Reading attachments within attachments

    Hi,
    I tested this code that I found and I was wondering if it's possible to read attachments within attachments. We are receiving forwarded messages that have an attachment of type message. The attachment then has its own attachment of type doc. We can break it into 2 parts but we don't know how to break it into 3 parts. I'm sure this sounds confusing so here is the code example:
    Object content = message.getContent();
    if (content instanceof Multipart) {
    handleMultipart((Multipart)content,msgName, mailFr, mailTo);
    } else {
    handlePart(message[i],msgName, mailFr, mailTo);
    public static void handleMultipart(Multipart multipart, String msgName, String mailFr, String mailTo)
    throws MessagingException, IOException {
              for (int i=0, n=multipart.getCount(); i<n; i++) {
                                  handlePart(multipart.getBodyPart(i),msgName, mailFr, mailTo);
    public static void handlePart(Part part, String msgName, String mailFr, String mailTo)
    throws MessagingException, IOException {
    String disposition = part.getDisposition();
    String contentType = part.getContentType();
    if (disposition == null) { if ((contentType.length() >= 10) &&
    (contentType.toLowerCase().substring(
    0, 10).equals("text/plain"))) {
    //part.writeTo(System.out);
    } else {
    //part.writeTo(System.out);
         saveFile(part.getFileName(), part.getInputStream(),msgName, mailFr, mailTo);
    } else if (disposition.equalsIgnoreCase(Part.ATTACHMENT)) {
                   saveFile(part.getFileName(), part.getInputStream(),msgName, mailFr, mailTo);
                   System.out.println("This is an attachment");
    } else if (disposition.equalsIgnoreCase(Part.INLINE)) {
                        saveFile(part.getFileName(), part.getInputStream(),msgName, mailFr, mailTo);

    If you have an attachment that's a message, then try to cast it to something of class Message or MimeMessage, then you can get parts from that.

  • IPhone 6 Plus 16GB blue screen crashes: Read, error type:Address map hole or size mis-match

    Hi folks,
    Some time ago I had a 16GB 6+ and it crashed with the blue screen, so I returned it. I now have a brand new one that I got from Tmobile ($75 return fee) and although it has mostly worked just fine, I have gotten 2 blue screen crashes. Below are the details from the phone's log.
    What strikes me is the message "Read, error type:Address map hole or size mis-match".
    Does anyone know if this could be caused by a hardware defect?
    I've gotten one of these crashes running iOS 8.1.2 and another in 8.1.3.
    Thanks.
    Incident Identifier: 20304759-E90B-453F-BDC5-176AF4E30041
    CrashReporter Key:   fcf18d230005749957728546dea3221a0c588330
    Hardware Model:      iPhone7,1
    Date/Time:           2015-01-25 19:43:44.913 -0800
    OS Version:          iOS 8.1.2 (12B440)
    panic(cpu 0 caller 0xffffff8008cd45d0): L2C PIO error (src:core0-AF snoop, address:0x1202030208, access:Read, error type:Address map hole or size mis-match, L2C_ERR_STS:100003fc00000202, L2C_ERR_ADR:0x1108e1202030208, L2C_ERR_INF:0x2107)
    Debugger message: panic
    OS version: 12B440
    Kernel version: Darwin Kernel Version 14.0.0: Mon Nov  3 22:27:30 PST 2014; root:xnu-2783.3.22~1/RELEASE_ARM64_T7000
    iBoot version: iBoot-2261.3.33
    secure boot?: YES
    Paniclog version: 3
    Kernel slide:     0x0000000006000000
    Kernel text base: 0xffffff8008002000
    Epoch Time:        sec       usec
      Boot    : 0x54bc22ef 0x00000000
      Sleep   : 0x54c58398 0x0002abb4
      Wake    : 0x54c583ae 0x000f08df
      Calendar: 0x54c5b7e3 0x00025045

    same with my iPhone 4s 16gb
    {"os_version":"iOS 8.1.3 (12B466)","bug_type":"110"}
    Incident Identifier: 582496DB-6999-468C-9504-3D1C191B9F4B
    CrashReporter Key: 623a577555e51ed110b937358adfa66fba3ea447
    Hardware Model: iPhone4,1
    Date/Time: 2015-02-20 04:17:50.830 +0300
    OS Version: iOS 8.1.3 (12B466)
    panic(cpu 0 caller 0x83dc8347): "i2c1::_checkBusStatus Bus is still in a bad state; last write status 00010110 xfer 00000000 fifo 00000000 for device als"
    Debugger message: panic
    OS version: 12B466
    Kernel version: Darwin Kernel Version 14.0.0: Mon Jan 12 21:30:11 PST 2015; root:xnu-2783.3.26~3/RELEASE_ARM_S5L8940X
    Kernel slide: 0x0000000003400000
    Kernel text base: 0x83401000
    Boot : 0x54e68884 0x00000000
    Sleep : 0x54e68a7e 0x000dd6ac
    Wake : 0x54e68b19 0x00035c02
    Calendar: 0x54e68b1d 0x00040927
    Panicked task 0x84a87c60: 13773 pages, 122 threads: pid 0: kernel_task
    panicked thread: 0xc5066e80, backtrace: 0x81a33ca0
    0x834ad94d
    0x834adcb1
    0x8341d5bd
    0x83dc8347
    0x83dc8059
    0x83dc7e35
    0x8389c601
    0x8389c513
    0x836f6f65
    0x8389cc6d
    0x8389ccc5
    0x83a9f18d
    0x83a9c27f
    0x83a9c73f
    0x83a9c90d
    0x836f6f65
    0x83a9c8e5
    0x836e91e7
    0x8343ed9b
    0x834ab59c
    Task 0x84a87c60: 13773 pages, 122 threads: pid 0: kernel_task
    Task 0x84a87948: 771 pages, 3 threads: pid 1: launchd
    Task 0x84a87000: 2016 pages, 13 threads: pid 17: UserEventAgent
    Task 0x84a87630: 481 pages, 4 threads: pid 18: misd
    Task 0x84a87318: 4114 pages, 22 threads: pid 19: CommCenter
    Task 0x87a62948: 349 pages, 2 threads: pid 21: keybagd
    Task 0x87a62318: 574 pages, 4 threads: pid 23: iaptransportd
    Task 0x87a62000: 868 pages, 9 threads: pid 24: configd
    Task 0x87a7ac60: 793 pages, 4 threads: pid 25: lockdownd
    Task 0x87a7a948: 1218 pages, 6 threads: pid 26: imagent
    Task 0x87a7a630: 2771 pages, 4 threads: pid 27: atc
    Task 0x87a7a318: 792 pages, 2 threads: pid 28: fairplayd.H1
    Task 0x87a7a000: 1571 pages, 14 threads: pid 29: aggregated
    Task 0x87c4ac60: 1069 pages, 4 threads: pid 30: routined
    Task 0x87c4a318: 707 pages, 5 threads: pid 33: timed
    Task 0x87d23c60: 646 pages, 2 threads: pid 35: installd
    Task 0x87d23948: 2383 pages, 11 threads: pid 36: mediaserverd
    Task 0x87d23318: 1279 pages, 11 threads: pid 38: ubd
    Task 0x87d23000: 249 pages, 7 threads: pid 39: syslogd
    Task 0x87d6ac60: 410 pages, 2 threads: pid 40: softwareupdated
    Task 0x87d6a948: 851 pages, 5 threads: pid 41: mediaremoted
    Task 0x87d6a630: 1877 pages, 7 threads: pid 42: identityservices
    Task 0x87d6a318: 9938 pages, 16 threads: pid 43: SpringBoard
    Task 0x87d6a000: 453 pages, 2 threads: pid 44: fileproviderd
    Task 0x87e25c60: 609 pages, 4 threads: p

  • Cannot Read Attachments in Email

    I have had my iPhone since December. I use my iphone for my work e-mail which is a Microsoft exchange server that I use Synchronica. At first I was able to read attachments, but no longer. Has anyone had any issues not being able to read attachments. Nor is there anything to indicate that there is an attachment in this email.

    if your signature is correct : Windows Xp is not supported.

  • Hoe to read attachments of type MESSAGE/RFC822

    hi,
    How to read attachments in mails of type MESSAGE/RFC822
    this occurs when somebody puts "Forwarded mails" directly as an attachment inside the mail body itself..
    guyz ur help for this will be very much helpful..
    thanks
    sriram.B

    Hi,
    I am also struggling the same problem. When I am reading part of type message/rfc822 I am not able to get right content.
    Waiting for some reply.
    Subhash

  • How to read Attachments files using POP

    Hello Every One
    I am wondering that, is there any tool available that reads Attachments files from the Email.
    I have POP tool that allows me to read regular Text message, but what if I want to read some files from the attachments.
    Any help is appreciated
    Thank you
    Amit

    Hi Amit,
    I have found a LV program that reads a .txt attachment from an email in this discussion forum posted.  I hope this helps.
    Regards,
    Nadim
    Applications Engineering
    National Instruments

  • My windows friends cannot read attachments from my e-mails

    My Windows friends cannot read attachments from my e-mails

    If the attachments are common files that your recipients should be able to read (PDF, DOC, TXT) then what is the setting when you select the menu command Edit > Attachments > Always Send Windows-Friendly Attachments (checked or unchecked).
    If it's unchecked you should check that setting and retry.

  • How to read the attribute in mapping..

    Hi,
    My source XML looks like this
    <GLDEBITACCT>
                <VALUE>0545-K-2006605-5500001</VALUE>
                <GLCOMP glorder="0">0545</GLCOMP>
                <GLCOMP glorder="1">K</GLCOMP>
                <GLCOMP glorder="2">2006605</GLCOMP>
                <GLCOMP glorder="3">5500001</GLCOMP>
      </GLDEBITACCT>
    Where glorder is the attribute of GLCOMP. Now I have requirement to read the attribute ( atleast 2 of them)
    I have to map to target field checking the value in glorder="1
    For e.g. with above XML, if the value in glorder="1 is K than map value from glorder="2 (2006605) to Target 1.
    IF the glorder="1 is P map the value in glorder="2 to Target 2 and goes on for another one
    How can i acheive this mapping. When I tried putting the value of glorder, i am not getting anything.
    Regards,

    Hi,
    You can use below UDF. Please make sure to select context parameter while creating UDF. There will be 3 input arguments for this function:
    1. GLCOMP (a)
    2 @glorder   (b)
    3 Constant   (c)  --depending upon the target node
    Also conext of attribute @glorder should be same as that of GLCOMP.
    //write your code here
    for(int i=0;i<a.length;i++)
        if(b<i>.equals("1")&&c[0].equals(a<i>))
        for(int j=0;j<a.length;j++)
              if(b[j].equals("2"))
         result.addValue(a[j].toString());
                            break;
    For target node target1 use K as 3rd argument, for target node target2 use P and so on.
    Let me know how it works.
    Regards,
    Anirudh.

Maybe you are looking for

  • Hyperlinks don't work in Visio Web Access

    Hi guys, I need a little help here. I'm using Visio Web Access (Sharepoint 2010). My shapes have 1 hyperlink each. When I publish these files, sometimes it's possible to simple click on the shape to go to the hyperlink, but sometimes it doesn't work

  • Clearing Charts and Graphs Programmat​ically

    I must be overlooking something simple because it seems that clearing charts programmatically would be such a common thing, but where then is the attribute to do this?

  • Should I go back to 24in from my problematic 21.5in iMac?

    I happened to swap my 24in iMac to one of the new generation iMacs about a week ago and have faced the problems that every other 21.5in & 27in user has come up against: slow performance after a few hours, slow internet connection etc. As I am new to

  • Importing iPhoto library in Aperture

    Hello this is the step that i follow to import the iPhoto library in Aperture 1- File>Import>iPhoto Library 2- Store Files in the apeture library 3- Import When the importing process is finished from the image folder in Finder I can see that my iphot

  • MRP Planning and AV Check

    Hi, During MRP run for a FG will Availabilitycheck be carried out..?? I have a FG with MRP type ND(No Planning) and Availability check KP(No Check) with these settings if I run MRP I know that Material will not be considered for MRP run, but will Ava