Sending PO with attachment from SRM to ERP

Hi Experts,
My requirement is to Send PO with attachment from SRM to ERP.
I can get the attachment in the payload as mentioned in https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/3509. [original link is broken] [original link is broken] [original link is broken]
But how to post this attachment into the target ERP system so that it gets saved as an attachment in the Purchase Order.
Thanks & Regards,
Shobhit

Hi Shobhit,
I asume, the PO is send as an IDOC to ERP?
In this case, you have no chance to attach the attachment.
A wortkaoud would be to extract the needed date from the attachment and map the values into correcponding fields of the PO-Idoc.
Regards Mario

Similar Messages

  • Send mail with attachment from webdynpro application

    hi,
    From a webdynpro application, the user will upload any files through the File upload ui element.These uploaded files has to go as an attachment in the mail which is being send to a particular ID ,when the user clicks the submit button in the form.
    can you please give me the code regarding this and help me in sending mail with attachment from a webdynpro application.
    Thanks in advance,
    shami.

    Hai,
    Properties props = System.getProperties();
           props.put("mail.smtp.host", "xx.xx.x.xx");
           Session session = Session.getDefaultInstance(props, null);
           Message msg = new MimeMessage(session);
           msg.setFrom(new InternetAddress("[email protected]"));
           msg.setRecipients(Message.RecipientType.TO,
           InternetAddress.parse("[email protected]", false));
           msg.setSubject(subject);
           msg.setText(body);
           msg.setHeader("X-Mailer", " Email");
           msg.setSentDate(new Date());
           MimeBodyPart messageBodyPart = new MimeBodyPart();
           messageBodyPart.setText("Hai , This mail Generated By the  Program");
          Multipart multipart = new MimeMultipart();
           multipart.addBodyPart(messageBodyPart);
            messageBodyPart = new MimeBodyPart();
            DataSource source = new FileDataSource("C:\nag.xls");//Here you need to give the Path of uploaded File
            messageBodyPart.setDataHandler( new DataHandler(source));
            messageBodyPart.setFileName("nag.xls");
            multipart.addBodyPart(messageBodyPart);
            // Put parts in message
            msg.setContent(multipart);
           Transport.send(msg);
    Regards,
    Naga

  • Sending Mail with attachment from WD

    Hi all,
    I wan't to send an email from webdynpro with an attached pdf-document. I had a look at Tutorial 31, but i will only use the first part, sending email with attached interactive form. So I decided to build a new project. I did everything as in the tutorial described, but when entering the following code into the wdDoInit method from the SendView an error occurs.
    //@@begin wdDoInit()
         //     @TODO Enter your email address for the setFrom and setTo methods by replacing the text in angle brackets.
         wdContext.currentEmailElement().setFrom("[email protected]");
         wdContext.currentEmailElement().setTo("[email protected]");
         wdContext.currentEmailElement().setCc("");
         wdContext.currentEmailElement().setBcc("");
         wdContext.currentEmailElement().setSubject("Travel Request Form");
         wdContext.currentEmailElement().setBody("BlaBlaBla");   
        //@@end
    In the coding is no error. In the Context node of the SendView I created a new value node with the value attributes. When writing the code and using strg+space i can complete automatically, so no writing errors.
    When deploying and running the application I get always a NullPointerException, if make no difference if i delete one entry or which line of code i insert, the same error.
    java.lang.NullPointerException
         at com.ao.test.emailtest.SendView.wdDoInit(SendView.java:99)
         at com.ao.test.emailtest.wdp.InternalSendView.wdDoInit(InternalSendView.java:127)
         at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.doInit(DelegatingView.java:61)
         at com.sap.tc.webdynpro.progmodel.controller.Controller.initController(Controller.java:215)
         at com.sap.tc.webdynpro.progmodel.view.View.initController(View.java:274)
         at com.sap.tc.webdynpro.progmodel.controller.Controller.init(Controller.java:200)
    I've compared my project with the one from tutorial but i found no differences.
    Have anybody have an idea what to do?
    Thanks
    Mathias

    Hi,
    NullpOinter excepttion could be bcose of "currentEmailElement()".
    Please create an element of EmailNode before these statements.
    IPrivate<ViewName>.IEmailElement ele=wdContext.createEmailElement();
    wdContext.NodeEmail().addElement(ele);
    You can use the following for sending attachments :
    BodyPart messageBodyPart = new MimeBodyPart();
    messageBodyPart.setText(Attachment);
    Multipart multipart = new MimeMultipart();
    multipart.addBodyPart(messageBodyPart);
    messageBodyPart = new MimeBodyPart();
    DataSource source = new FileDataSource(Attachment);
    messageBodyPart.setDataHandler(new DataHandler(source));
    messageBodyPart.setFileName(Attachment);
    multipart.addBodyPart(messageBodyPart);
    msg.setContent(multipart);
    Regards, Anilkumar
    Message was edited by: Anilkumar Vippagunta

  • Send mail with attachment from the uploaded file

    hi,
    From a form thread i got the following code to send mail with attachment with the file uploaded from the file upload ui element.
    public void onActionLoadFile(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionLoadFile(ServerEvent)
         WDWebResourceType FileType = null;
         String FileName = new String();
              //get attribute info for context attribute 'FileUpload'
              IWDAttributeInfo attributeInfo =
                   wdContext.getNodeInfo().getAttribute(
                        IPrivateEmailView.IContextElement.FILE_UPLOAD);
              //get modifiable binary type from the attribute info,requires type cast.
              IWDModifiableBinaryType binaryType =
                   (IWDModifiableBinaryType) attributeInfo.getModifiableSimpleType();
              IPrivateEmailView.IContextElement element =
                   wdContext.currentContextElement();
              //if a file in the 'FileResource' attribute exists
              if (element.getFileUpload() != null) {
                   try {
                        String mimeType = binaryType.getMimeType().toString();
                        byte[] file = element.getFileUpload();
                        //get the size of the uploaded file
                        element.setFileSize(this.getFileSize(file));
                        //get the extension of the uploaded file
                        element.setFileExtension(binaryType.getMimeType().getFileExtension());
                        //NOTE: context attribute 'FileName' must not be set
                        //because the FileUpload-UI-element property 'fileName'
                        //is bound to it. Consequently the fileName is automatically
                        //written to the context after file upload.
                        //report success message
                        wdComponentAPI.getMessageManager().reportMessage(
                        IMessageEmailComp.SF_UPLOAD,
                             new Object[] { binaryType.getFileName()},
                             false);
                        FileType = binaryType.getMimeType();
                        FileName = binaryType.getFileName();
                   } catch (Exception e) {
                        throw new WDRuntimeException(e);
              //if no file in the 'FileResource' attribute exists
              else {
                   //report error message
                   IWDMessageManager msgMgr = wdComponentAPI.getMessageManager();
                   msgMgr.reportContextAttributeMessage(
                        element,
                        attributeInfo,
                        IMessageEmailComp.NO_FILE,
                        new Object[] { "" },
                        true);
              //clear the FileResource context value attribute
              //element.setFileUpload(null);
              String URL;
              URL = this.CreateAndGetPathFileUpload(
                                  wdContext.currentContextElement().getFileUpload(),
                                                      FileName);
    //          if (URL.length() == 1){
    //               //ERRORE
         wdContext.currentContextElement().setPATHFileUploaded(URL);
        //@@end
      public boolean send( java.lang.String subj, java.lang.String mess, java.lang.String dest, java.lang.String attach, java.lang.String FileName )
        //@@begin send()
         InitialContext ctx = null;
         Address[] address = null;
         Message msg = null;
         Session sess = null;
         MimeBodyPart bodyPart = null;
         Multipart mp = null;
         // "141.29.193.71" == milvl2ja.icn.siemens.it (SMTP di Siemens)
           try {
              Properties props = new Properties();
              props.put("domain","true");
              ctx = new InitialContext(props);
              sess = (Session) ctx.lookup("java:comp/env/mail/MailSession");
              msg = new MimeMessage(sess);
              IWDClientUser utente = WDClientUser.getCurrentUser();
              String senderEmail = utente.getSAPUser().getEmail();
              InternetAddress addressFrom = new InternetAddress(senderEmail);
              msg.setFrom(addressFrom);     
              String EmailDEST = dest;
              InternetAddress addressTo = new InternetAddress(EmailDEST);
              msg.setRecipient(Message.RecipientType.TO, addressTo);
              msg.setSubject(subj);
    //          if ((mess != null) && (mess.length()>0)) {
    //                 msg.setContent(mess, "text/plain");
    //            } else {
    //                 msg.setContent("", "text/plain");
              //Gestione ATTACHMENT...
              String attachedFileName = new String(wdContext.currentContextElement().getFileName());
              boolean hasAttachment = (attachedFileName != null) && (attachedFileName.length() > 0);
              boolean isMultiPart = (mess != null) && (mess.length() > 1);
              //adding an attachment makes the message multipart
                 if (isMultiPart || hasAttachment) {
                    mp = new MimeMultipart();
                    // add text parts
                      if (mess != null) {
                         for (int i = 0; i < mess.length(); i++) {
                           bodyPart = new MimeBodyPart();
                           bodyPart.setContent(mess,"text/plain");
                           mp.addBodyPart(bodyPart);
                    //attach the file to the message if needed
                    if (hasAttachment) {     // avoid the case with no text parts
                         bodyPart = new MimeBodyPart();
                           bodyPart.setContent("Allegato incluso nel messaggio.","text/plain");
                           mp.addBodyPart(bodyPart);
                           // the part with the file
                           FileDataSource fds = new FileDataSource(attach);
                           MimeBodyPart attachmentBodyPart = new MimeBodyPart();
                        attachmentBodyPart.setDataHandler(new DataHandler(fds));
                        //URL URLattachedFileName = new URL(attach);
                        //attachmentBodyPart.setDataHandler(new DataHandler(URLattachedFileName));
                           attachmentBodyPart.setFileName(FileName);
                           mp.addBodyPart(attachmentBodyPart);
                    msg.setContent(mp);
                 } else {
                    if ((mess != null) && (mess.length() > 0)) {
                         msg.setContent(mess, "text/plain");
                    } else {
                         msg.setContent("", "text/plain");
              //fine ATTACHMENT 
              msg.setSentDate(new GregorianCalendar().getTime());
              msg.saveChanges();
              address = msg.getAllRecipients();
              Transport.send(msg, address);
           } catch (Exception e) {
                 e.printStackTrace();
                 return false;
           return true;
        //@@end
    When i used the same code in my application i am gett ing error in many places..
    1)FileDataSource fds = new FileDataSource(<b>attach</b>);
    attach cannot be resolved
    2)attachmentBodyPart.setFileName(<b>FileName</b>);
    fliename cannot be resolved
    3)byte[] file = element.getFileUpload();
    type mismatch cannot convert sting to byte[]
    4)element.setFileSize(this.getFileSize(file));
    method getFileSize() is undefined
    5)element.setFileExtension(binaryType.getMimeType().getFileExtension());
    method getFilExtension() is undefined
    6)URL = this.CreateAndGetPathFileUpload(wdContext.currentContextElement().getFileUpload(),FileName);
    method CreateAndGetPathFileUpload() is undefined.
    7)wdContext.currentContextElement().setPATHFileUploaded(URL);
    from the above error i can understand that only i have got the part of the code.
    Please send me the complete coding.
    some method definitions are missing....
    Please help me to send the mail with attachment from the file uploaded from the file upload ui element.
    Thanks in advance,
    shami.

    hi,
    I got this from the following link
    Re: Attaching an excel file
    plz help me ...
    I am using 2004s with nwds 7.0.06.
    also tell me what should be the type of the context variable FileUpload
    Thanks in advance,
    shami.

  • Sending email with attachment from iCloud

    when i am sending email with attachment, when i am sending email with attachment I found that the mail was send and still on draft on the client software on my mac book pro. Any solution please??

    That happens at times.  Don't know why.  Just delete the email in the drafts folder, as long as you are sure it was sent (check the sent folder).  I've wondered whether it's a timing issue.

  • Sending mail with attachment from OIM

    Hi Experts,
    We have a requirement to send mail from OIM with attachment. Could not find any relevant document how to achieve this using Notification template and NotificationService.
    Any help would be appreciated.
    Thanks in advance.

    this feature is not supported by the product. check Doc ID 1444359.1
    You can raise a SR to know about it.

  • Send email with attachment from Q2 notification to external email

    Hi,
    Whenever I create a Q2 notification, I want to send the vendor, details of the notification as attachment. Now it is copying the "coordinator" from partner function. But not copying vendor data in select partner function. Here I have to manually select the vendor. Another question here is that, this email should trigger to the email id of vendor maintained in the vendor master. This email address will be an external id. Please suggest the best way to send email to vendor along with attachment.
    Thanks
    Vineeth

    Hi
    Check with this sap note 208271 "Sending Notification email with Print function"
    and required basis configuration.
    Regards
    Shiva

  • Help in sending mails with attachment from workflow

    Hi Experts,
    I have a document in my local PC. Can anyone tell me how to send it like an attachment from workflow.
    Thanks  in advance.

    Hi,
    when u want to send the attachment along with document created, then u can see the Service Object in left hand top corner. There u can attach your file. So that it will go with the document.
    Regards,
    JMB

  • Cofiguring & sending email with attachment from Oracle Report 10g

    I want to run report from Oracle 10g reports to be sent as email attachement to differnt people with their respective personal content.
    The first problem is to know how to configure Oracle reports 10g to be able to send output to email address.
    The second problem is to be able to route seperate pages of the report to seperate email address.
    Thanks to all.

    For configuring email for reports
    http://download-east.oracle.com/docs/cd/B14099_17/bi.1012/b14048/pbr_conf.htm#sthref472
    For sending the output to different mail id's you can use bursting and distribution feature of Oracle Reports. For details,
    http://download-east.oracle.com/docs/cd/B14099_17/bi.1012/b14048/pbr_dist.htm#i1007338

  • Sending mail with attachment from Photos App get stuck in Outbox

    Hey,
    As it is described in the title, the photos I have previously selected in Photos App ( by clicking send > by mail ) get stucked in my Outbox.
    In opposition to some other discussions, I can edit/delete that stucked mail, and even send it if I manually click again on "Send" from the outbox !
    Other funny conclusion : If I copy&paste the photo and compose a new message from the Mail App, the same mail isn't stuck.
    I tried to delete/reconfigure my Exchange Account, it doesn't change anything.
    Google Mail account configured with Exchange Account.
    Synchronising Mail&Calendar
    Push activated
    (It definitely worked properly before)
    Device: Iphone 4
    Carrier: Orange France
    Country / Language: FR
    OS / Browser / build number (if applicable): iOS 4.1 8B117

    Hi,
    Please run Word in Safe Mode to test if it's 3rd-party add-ins related:
    Press Win + R and type “word.exe /safe” in the blank box, then press Enter.
    If there’s no problem in Safe Mode, disable the suspicious add-ins to verify which add-ins caused this issue.
    We can also refer to the link below, to learn more and check the possible settings that may affect this behavior:
    http://www.msoutlook.info/question/278
    Regards.
    Melon Chen
    TechNet Community Support
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • Send Email with attachment from Oracle Procedure

    Hi Saubhik,
    Wt u have explain is really knowledge sharing and very helpful.
    soi have few questions if you can help me out of it.
    1>can we add more than 1 excel sheet in attachment if yes then how to achieve it?
    2>Can't we attached pdf file? I tried using content/type : application/pdf but it only creates pdf file only i can't read it content.
    Waiting for your reply.
    Thanks in advance,
    Radhii

    Hi saubhik,
    i got problem while attaching pdf file? code generates pdf file but i cnt open it to read contents so what could be the mistake that i am doing either writing in pdf file or something else??
    here is my code..
    utl_smtp.write_Data(v_connection,
              'MIME-Version: 1.0'|| crlf || -- Use MIME mail standard
              'Content-Type: multipart/mixed;'|| crlf || ' boundary="-----SECBOUND"'|| crlf || crlf ||
              '-------SECBOUND'|| crlf ||
              'Content-Type: text/plain;'|| crlf ||
              'Content-Transfer_Encoding: 7bit'|| crlf || crlf ||
              '* PLEASE DO NOT REPLY / SEND MAIL TO THIS ACCOUNT , AS ITS AUTO GENERATED MAIL'|| crlf ||
                   '-------SECBOUND'|| crlf ||
              'Content-Type: application/pdf;'|| crlf ||
              ' name="BLANKET_PO_RELEASE.pdf"'|| crlf ||
              'Content-Transfer_Encoding: 8bit'|| crlf ||
              'Content-Disposition: attachment;'|| crlf ||
              ' filename="BLANKET_PO_RELEASE.pdf"'|| crlf ||      crlf ||
              'SR_NUM,ITEM_CODE,ITEM_DESC,PO_NUM,RELEASE_NUM,RELEASE_REVISION_NUM,RELEASE_DATE,QUANTITY,NEED_BY_DATE'     || crlf || temp
              --     '-------SECBOUND--' -- End MIME mail
    where
    temp is my whole string data that i m wrapping in attachment file.
    Radhi

  • How can I send e-mail with attachment from oracle 10g?

    How can I send email with attachment from oracle 10g?

    hi you can achieve the same thing from database tier of unix.

  • BPEL send email with attachment

    Hi guys,,
    Now i want to send email with attachment from the bpel console. In bpel console, if i want to use, "browse" button, how can i create this button in my xsd file?

    Hello,
    Well I'm using the BPEL build in decoder. It works for txt file but how about PDF? Will it be the same?
    it give me this message in the email process.
    XML Parsing Error: reference to invalid character number
    p/s: it working to txt but not pdf.
    below is the script
    <bpelx:exec name="decoder" language="java" version="1.5">
    <![CDATA[String inputString = new String();
                inputString =(String)getVariableData("attachmentContentVar");  
        try {
                String decoded = Base64Decoder.decode(inputString);  
                setVariableData("decoded",decoded); 
    catch(Exception e)
    e.printStackTrace();
    }]]>
    </bpelx:exec>
    <copy>
    <from variable="retriveAttachment_retriveAttachmentSelect_TASKID_OutputVariable"
    part="WfattachmentCollection"
    query="/ns3:WfattachmentCollection/ns3:Wfattachment/ns3:encoding"/>
    <to variable="varNotificationReq" part="EmailPayload"
    query="/EmailPayload/ns1:Content/ns1:ContentBody/ns1:MultiPart/ns1:BodyPart[2]/ns1:MimeType"/>
    </copy>
    <copy>
    <from variable="retriveAttachment_retriveAttachmentSelect_TASKID_OutputVariable"
    part="WfattachmentCollection"
    query="/ns3:WfattachmentCollection/ns3:Wfattachment/ns3:name"/>
    <to variable="varNotificationReq" part="EmailPayload"
    query="/EmailPayload/ns1:Content/ns1:ContentBody/ns1:MultiPart/ns1:BodyPart[2]/ns1:BodyPartName"/>
    </copy>
    <copy>
    <from expression="bpws:getVariableData('decoded')"/>
    <to variable="varNotificationReq" part="EmailPayload"
    query="/EmailPayload/ns1:Content/ns1:ContentBody/ns1:MultiPart/ns1:BodyPart[2]/ns1:ContentBody"/>
    </copy>
    </assign>
    Edited by: kpchong on Oct 20, 2009 12:00 AM

  • How to send material jpg attachment  from R3 to FTP with XI

    Hi All,
    I wantto send material JPG attachment from R3 to FTP with XI 3.0. Is there a way ?
    Thanks.

    Check these two blogs:
    /people/michal.krawczyk2/blog/2006/04/19/xi-rfc-or-abap-proxy-abap-proxies-with-attachments
    http://sapient.xi.googlepages.com/xi-excellentintegration
    Regards,
    Abhishek.

  • Error while trying send emai with attachment

    Hello,
    I am facing an error while trying to send email with attachment (spreadsheet).
    Error is:  "Error in calling 'SBCOMS_SEND_REQUEST_CREATE'   in  'SO_DOCUMENT_SEND_API1' with Sy-subcr = 1".
    Do I need to configure the sender email address or some configuration at the sender system?
    I followed the example given in the below link.
    http://wiki.sdn.sap.com/wiki/display/ABAP/HowtowriteanABAPProgramtoplaceanExcelfileinapathandsenditasan+Attachment
    Could you please help on this?
    Thanks & regards,
    Ravish

    Hi Ravish,
    sure you can create local excel using [Desktop Office Integration (BC-CI)|http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCCIOFFI/BCCIOFFI.pdf], load as binary and attach.
    More elegant, future-oriented and advanced is the [excel-from-scratch-approach abap2xlsx by Ivan Femia|http://wiki.sdn.sap.com/wiki/display/ABAP/abap2xlsx]
    Regards,
    Clemens

Maybe you are looking for

  • Is it possible to allow use to type entry into a drop down list box ?

    Hi , Is it possible to provide  type in the value option ( provide option to user like he can select a value from the extracted data in a drop down list object and also he can enter a value manually ) to a drop down list box on an interactive form ?

  • Best buy mobile

    If you sign up with a contract through bestbuy mobile do you pay your bills to bestbuy or the phone service provider? So say you buy a phone and contract at best buy mobile and its for sprint, do your bills go directly to sprint or best buy?  I would

  • Making use of Intel PAE from user programs

    On Red Hat Linux v8, it is possible to make use of the Intel PAE technology from user programs. In particular, it is possible to map arbitrary portions (up to several Mb at a time) of the processor's physical RAM into a process's virtual address spac

  • Battery Problem again

    Hi, I have a problem with my iphone 5 battery. After i upgrade to iOS 7, now when my battery is about 20% and when i charge it, its not going up but still drained instead. Anyone has a same problem?

  • Output type error

    Friends Please let me know the solution for my prob. I am getting a message 543 while using an output type. The message says "OUTPUT Type X  is deactivated for automatic proposal" This problem persists while I am manually entering SH as a partner fun