Add Attachment from ABAP Mapping

Hi Gurus,
is it possible to add an attachment during a ABAP mapping? Like it is possible for proxy!
I want to attach a jpg file during the mapping. I found also class interface CL_MAPPING_ATTACHMENTS with a
few method e.g. SET_ATTACHMENT but it does not wotk.
Anyone of you knows some solutions or hinds?
Thanks in advance.

HI,
I found an other solution or lets say I found an error in my interface call. IF_MAPPING_ATTACHMENTS -> set_attachment is working, sorry!!!
  TRY.
      CALL METHOD attachments->set_attachment
        EXPORTING
          content_id   = '1.jpg'
          content_type = if_xms_resource=>mimetype_jpeg
          content      = l_data.
    CATCH cx_xms_system_error .
  ENDTRY.
The Attachment is in the Payload, but now I get an error from the adapter, when I use file or mail receiver adapter! For a little test I used http receiver and there it is working!?
"com.sap.engine.interfaces.messaging.api.exception.MessagingException: Could not queue receive for message df9cc710-62c9-85f1-b25f-005056c00008(INBOUND). Reason: java.lang.NullPointerException: while trying to invoke the method com.sap.aii.af.sdk.xi.lang.Binary.getBytes() of an object returned from com.sap.aii.af.sdk.xi.mo.xmb.XMBPayload.getContent() "
I get it in FILE and EMAIL Adapter!? Do you know the reason? I'm still looking for it.
Edited by: Michael Kulak on Jul 30, 2010 8:50 PM
Edited by: Michael Kulak on Jul 30, 2010 9:04 PM

Similar Messages

  • Access MIME from ABAP Mapping for Attachment

    Hi,
    I am adding an attachment in ABAP Mapping and sending that message to Ariba System through HTTP Adapter channel.
    I am able to send the message successfully and also I can see the attachment in the PI RWB But I am not able to see any
    attachment in the Receiver's end along with the message.Ariba is able to receive the message successfully though.
    It looks like I need to change MIME Header a bit before sending the message.
    I check this link.
    XI Attachment and main document MIME sequence
    But Its about SOAP Adapter with PayloadSwap Bean. Since HTTP adapter is on ABAP we can not use the Module
    Tab of the channel.
    I need to know how can I use ABAP Mapping to access the MIME HEADER to change/ check Content Disposition and
    other properties.
    Thanks,
    Vijay
    Edited by: tech.info012 on Oct 12, 2010 6:33 PM

    When I tried the 2nd option It is giving me this error in response message. Do you have any idea what problem can cause this.
    <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/"
    SOAP:mustUnderstand="1">
      <SAP:Category>XIAdapterFramework</SAP:Category>
      <SAP:Code area="MESSAGE">GENERAL</SAP:Code>
      <SAP:P1 />
      <SAP:P2 />
      <SAP:P3 />
      <SAP:P4 />
      <SAP:AdditionalText>com.sap.engine.interfaces.messaging.api.exception.MessagingException: Could not queue receive
    for message 4cb474bf-00c1-02af-e100-80000aa00d4b(INBOUND). Reason: java.lang.NullPointerException:
    </SAP:AdditionalText>
      <SAP:Stack />
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error>
    Thanks,
    Vijay

  • Creating a PDF-Mail-Attachment via Abap Mapping possible ?

    Hi folks,
    I am trying to build a szenario like: Getting an Idoc -> sending it to abap mapping -> map a pdf from smartforms in abap -> map the from/to for the mail payload -> come back from abap mapping -> send it with the mail adapter .
    But now I am stuck at the point "coming back from abap mapping", because the pdf -data seems to become unreadable because of conversion. I am using Ixml and trying to attach the create pdf (looks hex-right at that point) by method create_simple_element as content-tag of the mail. But after rendering and coming back out of mapping, it seams that that data is not converted from xstring back in the right way. Can someone give a hint ? Is that way by IXML not possible for data including binary-data ? Have I to go another way?
    Thanks in advance
    Detlef

    > as content-tag of the mail.
    Sometimes I have to read the request several times to find the issue:
    No you cannot put a binary as part of an XML element.
    You can only send a plain binary as payload, so the whole mail would be nothing besides the PDF.
    In PI 7.1 you can create also an additional attachment out of mapping, but I do not know if this works for ABAP mapping also.
    The whole "I want to send an email with attachment out of PI" topic is not supported from PI development in any way.
    So you have to write a lot of code (especially Java code) to achieve this.
    > Regarding your opinion. Its based on customer requirements to have central focal point in dezentral landscape.
    The PI expert has to advise the customer for the scenarios. That is part of the job.

  • Get Message ID and namespace from ABAP Mapping

    Hi XI Expert,
    Please advise how to get the message ID and namespace from ABAP Mapping.
    Thank You and best Regards
    Fernand

    Hi,
    To access the message ID, use the method GET_MESSAGE_ID of the controller object:
           1.      Fetch a protocol instance for the protocol IF_WSPROTOCOL_MESSAGE_ID.
           2.      To have the system return the message ID after the sender has sent a request message or the receiver has received a request message, use the method GET_MESSAGE_ID of this instance. This returns the ID by using the parameter MESSAGE_ID of type SXMSGUID.
    Also you could do the same by this way also:
    IF_WSPROTOCOL_XI_HEADER
    has attributes messageid and interface namespace.
    using this  you can read the XI message header

  • Separating Java add-in from ABAP Stack server

    I have installed an ABAP Stack and added the JAVA add-in on the same physical server.  Now I would like to have the JAVA add-in run on a physically different server.  ABAP on Server1 and JAVA add-in on server2.
    What is the process to move the add-in to the new server?  What parameters/values need to be changed?
    Thanks!
    Steve E.

    Hi Stephen,
    I think Java Standalone is the only (official) option you have, I don't know the way of physically separating J2EE add-in from ABAP stack in dual-stack systems (you can separate CI from DB, or SCS in the cluster env but not add-in from ABAP).
    Regards,
    Mike
    Message was edited by:
            Mike Puzankov

  • Email XLS excel attachment from ABAP

    Hi,
    I am trying to email an excel attachment from ABAP, but when I open in excel, it says not a recognizable format, but when I click OK it does open as a tab-delimited file and look OK.
    Any ideas please?

    Hi,
    Please check this link
    http://www.sapdevelopment.co.uk/reporting/email/attach_xls.htm
    aRs

  • User add attachment from notification

    Hi
    I am using EBS R12, i need to allow user to add attachment from notification.
    This is the scenario:
    HR will submit workflow to user, this user will open the notification and the user must add attachment and then return it to HR. So can we do that?
    Thanks

    please see
    http://oracle-latest-technology.blogspot.com/2010/04/sending-attachment-using-oracle.html
    ApPsMaStI
    sharing is Caring

  • How to extract attachment from ABAP proxy and store in archive link....

    Hi Experts,
    I need to consume an incoming email attachment in the ABAP Proxy program (POP Mail  --> PI --> ABAP Proxy) and then store this file in the IBM content management server through the Archvie Link connection.
    Any idea how to implement this piece of code in ABAP?
    Regards,
    Shobhit

    Hi Shobhit
    You can get the files from Sender Mail adapter. In proxy implement the method of protocol IF_WSPROTOCOL_ATTACHMENTS as said above.
    Archive Link supports HTTP, RFC etc depends on the system you are going to use for archiving. For your case you have IBM server i think you have to do HTTP synchronous. This will be like an interface again for you.
    Why are you using ERP system in middle. I think you can directly dump data to IBM server.
    Thanks
    Gaurav

  • SOAP call with attachment from ABAP

    Dear ABAP guru's
    We have a requirement to trigger a SOAP call from the ABAP stack. We have used the instructions from SAP as specified in the SAP help as specified in this link:
    http://help.sap.com/saphelp_47x200/helpdata/en/2d/64d029e74911d6b2e400508b6b8a93/frameset.htm
    This works fine. However, we would like to send an attachment with the call and don't see a method available for this. Is there anybody who knows how to achieve this?
    Thanks a lot in advance,
    Rudy Claassen

    Dear ABAP guru's
    We have a requirement to trigger a SOAP call from the ABAP stack. We have used the instructions from SAP as specified in the SAP help as specified in this link:
    http://help.sap.com/saphelp_47x200/helpdata/en/2d/64d029e74911d6b2e400508b6b8a93/frameset.htm
    This works fine. However, we would like to send an attachment with the call and don't see a method available for this. Is there anybody who knows how to achieve this?
    Thanks a lot in advance,
    Rudy Claassen

  • My Thuderbird has stopped allowing me to add attachements from my desktop.

    Today for some reason my Thunderbird will not allow me to attach documents from my desktop. I have been doing this for some time as I find it is the easiest way to attach a document to an email. When I have attached a document I move the file into it's required folder. I think the default setting is to open the most recently opened folder, but if this happens I have always been able to click on the 'back' button to go back to the desktop and find and attach the file I want. For some reason today Thunderbird has stopped listing the desktop as an option and doesn't show the desktop on the files or libraries list, and will only attach files from the most recent folder opened. There is no option to go back to the desktop. Why is this happening and how do I reset this so that Thunderbird gives me the option of attaching files from my desktop? Help !!

        @ednwnj,
    That's a great question. Let's get those tones back on. Here are the steps to turn on the dial tones when using the dial pad.
    1. Go to Settings.
    2. Select Sound Settings.
    3. Turn on Audible Touch Tones.
    Let us know if you need anything else.
    NidiaA_VZW
    Please follow us on Twitter @vzwsupport

  • Create Attachment within Graphical Mapping using UDF

    Hi!
    We want to create an attachment witihn a graphical mapping using an UDF function.
    I use that function:
    public String addAttachment(String filename, String mimeType, String content, Container container) throws StreamTransformationException{
         BASE64Decoder decoder=new BASE64Decoder();
         try {
              GlobalContainer globalContainer = container.getGlobalContainer();
              OutputAttachments outputAttachments = globalContainer.getOutputAttachments();
              Attachment attachments = outputAttachments.create(filename, mimeType,decoder.decodeBuffer(content));
              outputAttachments.setAttachment(attachments);
              return "Adde1: "+filename;
         } catch (Exception e) {
              return e.toString();
    (SDN helped me much in creating that
    This function has no compiling errors, anything workes fine:
    It takes 3 input-parameters, see also: http://help.sap.com/javadocs/pi/SP3/xpi/com/sap/aii/mapping/api/OutputAttachments.html
    filename (ok, more or less contentID)
    mimeType (more or less contentType)
    content: Base64-encoded String which should be set as content
    In my sample I use the following constants for that function:
    filename = "fn1.txt"
    mimeType="application/xml"
    content = "UG9seWZvbiB6d2l0c2NoZXJuZCBhw59lbiBNw6R4Y2hlbnMgVsO2Z2VsIFLDvGJlbiwgSm9naHVydCB1bmQgUXVhcms=" --> cames directly from http://de.wikipedia.org/wiki/Base64
    When using the message, I got this error within SXMB_MONI:
    <SAP:AdditionalText>com.sap.engine.interfaces.messaging.api.exception.MessagingException: Could not queue receive for
    message 0022642d-b106-02df-8e8c-f41c243bd112(INBOUND). Reason: java.lang.NullPointerException: while trying to
    invoke the method com.sap.aii.af.sdk.xi.lang.Binary.getBytes() of an object returned from
    com.sap.aii.af.sdk.xi.mo.xmb.XMBPayload.getContent()</SAP:AdditionalText>
    This looks pretty much the same as Add Attachment from ABAP Mapping but this tread is also not answered.
    Adding attachment from PI level looks also in that direction, again, no answer.
    So, I was wondering if someone has solved such problem?

    Hi Divyesh!
    We did it that way:
    1. Choosing the XML-Mailstructure as Destination as described in Configuring the Receiver Mail Adapter - Advanced Adapter Engine - SAP Library -  Example (XI payload with mail package)
    2. now we have created a UDF for creating the "content"
    public void getContent(String[] text, String[] attFname, String[] attType, String[] attContent, ResultList result, Container container) throws StreamTransformationException{
    // vergleich ob alle att-Arrays selbe anzahl haben
    if (attFname.length!=attType.length || attFname.length!=attContent.length) {
        result.addValue(Integer.parseInt("Fehler: alle Attachment-Eingänge müssen die selbe Anzahl an Elementen haben!"));
        String CRLF = "\r\n";
        String output="This is a multi-part message in MIME format."+CRLF+CRLF+
        "--"+getBoundary(container)+CRLF+
        "Content-Type: text/plain; charset=UTF-8"+CRLF+
        "Content-Disposition: inline" + CRLF + CRLF +
        text[0]+CRLF;
    for (int i=0;i<attFname.length;i++) {
        output+="--"+getBoundary(container)+CRLF+
        "Content-Type: "+attType[i]+"; name="+((char)34)+attFname[i]+((char)34)+CRLF+
        "Content-Disposition: attachment; filename="+((char)34)+attFname[i]+((char)34)+CRLF+
        "Content-Transfer-Encoding: Base64"+CRLF+CRLF+attContent[i]+CRLF;
    output+="--"+getBoundary(container)+CRLF;
    result.addValue(output);
    This UDF is configured as "QUEUE"
    We have configured this input-structure
    The Content itself is allready base64.
    So we can call this mapping and it creates a Multipart-Mail for us.

  • Adding attachment through ABAP screen

    Hi experts,
    I have a requirement where i need to add attachment from a ABAP screen or through SM30 screen. That is, we provide a transaction code for the users to maintain table entries. In additon to maintain values, the user wants to add attachment. The attachment is a image of a map of the house plan.
    So can someone tell me how to add attachment and the path or URL of the attachment need to be stored in a separate field in the Z table?
    Is that can be done through OAAR transaction?

    Look for GOS Attachments in the forum - probably it should help your need

  • Dynamic Configuration - CC Receiver - Abap Mapping

    How can I add info in the xml message in Dynamic Configuration from Abap Mapping ?
    Thanks in advance.

    Hi,
    The following should do the trick:
    data: l_dyn_record type MPP_DYNAMIC.
    l_dyn_record-namespace = 'http://sap.com/xi/XI/System/File'.
    l_dyn_record-name = 'FileName'.
    l_dyn_record-value = 'myFileName'.
    CALL METHOD dynamic_configuration->add_record
      EXPORTING
        record = l_dyn_record.
    Regards,
    Daniel

  • SOFM: Dsiplay method is not working when called from ABAP Webdynpro

    Hi All,
    I want to open an attachment from ABAP Webdynpro.
    I have approached in this fashion:
    1) Get the attachments as SOFM object key
    2) On Click of a link on Webdynpro, I am calling a function module within which I am creating an instance of the SOFM object
    3) Then I am calling the DISPLAY method
    It is not opening.
    But, if it opens when I driectly execute the function module. It open when I directly test the business object.
    Any Idea ?
    Thanks & Regards,
    Deb

    Display Method uses the Dialogue Module, You should not access such methods in web dynpro which are SAPGUI specific.
    Web Dynpro Applications are run in Browser environment which cannot understand Dialog, it can understand only HTML.
    Read the attachments and get the content and use FileDownload UI element to show it to user.
    Abhi

  • When we wil go for abap mapping ??

    Hi,
    As we know there are graphical, XSLT, JAVA mappings are there apart from ABAP mapping. I have gone through below weblog.
    /people/udo.martens/blog/2006/08/23/comparing-performance-of-mapping-programs
    and also help.
    http://help.sap.com/saphelp_nw04/helpdata/en/12/05731a10264057badc32d3d3957015/frameset.htm
    None of them says ABAP mapping is either faster or stable as compared to other mappings. Even though it is the case, still when we will go for abap mapping ??
    Is it like that it is totally depend on the available resources in hand ??
    thanks
    kumar

    > The SAP XI/PI mapping is the most efficient as it
    > only loads the part of the source message that are
    > used to create the target message(s) at runtime.
    >
    > Java and XSLT have to load the whole message into
    > memory to process the message. This can be
    > inefficient and if dealing with large messages can
    > cause issues.
    About your statement.
    If you consider the field mapping (or UDF) runtime, then you are correct. But if you consider the whole mapping runtime, you also have to "load" the full message in message mapping, obviously. What happens is that it is transparent to the developer, since loading and parsing is done by standard. But message mapping also deals with loading and parsing the whole message (and it is done with Java underneath). Then I don't think message mapping will have a significantly better/worse performance, when compared with Java mappings (performing normal xml processing methods).
    As for XSLT, the performance problems happens because you have a XSLT processor running over Java VM. Then, if you have heavy load on it, the mapping runtime will consume the resources necessary to run the xslt processor (which is, by itself, very resource consuming) and also to treat that heavy input.
    Regards,
    Henrique.

Maybe you are looking for

  • ITunes 9.0.3.15 does not recognize iPhone 3G on Win 7

    Used to work on Win 7 and previous version of iTunes. Request assistance. Below is the diagnostics report. If anyone has a solution please write to me Microsoft Windows 7 Business Edition (Build 7600) Hewlett-Packard HP ProBook 4410s iTunes 9.0.3.15

  • Email saved as draft has vanished but shows up in iPad search

    Hi guys, Last night I wrote an email and saved it as a draft to send later in the mail app on my iPad. This morning I went to send the email and it had disappeared from the drafts folder. I have checked every folder in the mail app and it doesn't sho

  • What you think ?, if you were not system admin ??????????

    I'd go back to Electronic Engineering from whence I came. I only fell into this gig because I had the most IT knowledge of the senior engineers here and, as our company expanded, our IT guy just disappeared one night - quite literally, he resurfaced

  • Error when installing packages: .../xorg-fonts-cyrillic-1.0.0-1/des

    Hi, I am completely new to Arch Linux, and under my first installation I got this error: error: /mnt/var/lib/pacman/current/xorg-fonts-cyrillic-1.0.0-1/des error: /mnt/var/lib/pacman/current/xorg-fonts-cyrillic-1.0.0-1/des error: /mnt/var/lib/pacman/

  • Can we condense the two ODBC forums

    Under Technologies | Windows, there are two different forums for discussing ODBC and nothing, apparently, to differentiate the two forums. Under the old structure, this at least accomplished the objective of having ODBC discussions with two different