Attachment name problem

Hi all,
Scenario : sending ORDERS idoc from R3 to vendor as an attachment (named Untitled.xml) in mail through mail adapter.
I've manage to rename attachment with adding module in communication channel :
Processing sequence
Module Name : localejbs/AF_Modules/MessageTransformBean   Module Type: Local Enterprise Bean   Module Key : rename
Module Configuration:
Module Key : rename    Parameter Name : Transform.ContentDisposition     Parameter Value : attachment;filename='desired attach name'
Is it possible to set that every attachment has different name, ie that obtain name from <BELNR> node in E1EDK01 segment?
Thank You in advance,
Mate Katalinic

Hi Peter,
Thank You for your reply.
I've suspected that I will get that kind of answer but was'nt sure if I missed something in all posts that have been reading.
Mate

Similar Messages

  • Problem in Mail Receiver attachment name

    Hi all.
    we are doing a interface from file to Mail (Excel file as a attachment).
    we have written the adapter module to convert the  XML from PI to Excel.. which is working fine.
    For the attachment name i was hardcoding the attachment name using
    localejbs/AF_Modules/MessageTransformBean
    and Transform.ContentDescription as Testing.xls.
    The scenario works fine.
    But i want the attachment name to be dynamically set like xyzddmmyyyy.xls.
    I am not using any Mail package.
    I want to set the attachment name dynamically. so i follwed the blog
    http://www.sdn.sap.com/irj/scn/weblogs;jsessionid=(J2EE3414700)ID0922321550DB00664514007823519662End?blog=/pub/wlg/3202
    i am getting the filename from the xmlpayload and setting it using
                            xp.setName(filename);             
                      xp.setContentType("application/vnd.ms-excel");
                xp.setContent(by);
    but the problem is that now i am not getting the excel file instead a untitled.bin file which have the Contents.
    in module configuration i have
    localejbs/XMLToExcelConversion                                          LocalEnterpriseBean               0
    sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean      LocalEnterpriseBean             1
    Can you please throw some light on this problem..
    Thanks in advance
    Babu.

    Try this:
    xp.setContentType("application/vnd.ms-excel; filename=\""filename"\");

  • Problem: Original Attachment Name from SOAP Sender changes to attachment-1

    Hi everybody,
    we have a scenario where a SOAP sender receives a xml message describing several documents. Each document has a mime type and a file name, size, md5 checksums etc as attributes.
    The documents are send as attachments with the same Web service in SWA(SOAP with attachment style).
    The web service calls an ABAP proxy provider class in a R/3 backend.
    The ABAP proxy class will save the attached documents for further processing and must use the original document names.
    At the soap communication channel monitoring(Java Stack) we still see the original attachment names in the message content tab.
    At the Integration Server(sxmb_moni) the attachment name changes to attachment-1, attachment-2 and so on.
    Using the method
    IF_AI_ATTACHMENT ->GET_DOCUMENT_NAME
      in the provider ABAP proxy class returns the name attachment-1.
    We can see that there is a mapping of the new attachment-1 name to the old, original name in the manifest section of this message on the Integration server.
    Is there a way to access the manifest section at a provider ABAP proxy class?  Or otherwise a PI configuration setting to preserve the original attachment names.
    Thanks a lot,
    Heiko
    => PI 7.1 SP9

    Hi Stefan,
    (I was hoping you would find that thread ...)
    I see a good reason why the attachment names are changed as the PI message protocol sends the main document as an attachment as well. So no problem with that because the information of the mapping old to new names still exists in the manifest part and is visible at the sxmb_moni.
    We see a manifest part like this (Sorry cant post the whole xml doc as the formatting for longer messages isn't working in the forum)
    <SAP:Payload xlink:href="cid:4cc43edd-839f-423f-b7c6-7e44294d663a_sig.p7m">
      <SAP:Name>attachment-1</SAP:Name>
      <SAP:Description>attachment</SAP:Description>
      <SAP:Type>ApplicationAttachment</SAP:Type>
    </SAP:Payload>
    The (red) cid entry is the original file name. This manifest is from the sxmb_moni in the r/3 backend. So all the information is there..  The question is how to retrieve this information .. Any idea?
    Best Regards,
    Heiko Bergmann

  • Problem with Attachment Names

    Hi All,
    I am using the FM
    'SO_NEW_DOCUMENT_ATT_SEND_API1'
    to send data from the program to the user's email Id.
    There is a small issue I am facing. The report has two different files to be emailed and the code seems to be fine. But when the email is delivered, both the files have the same names (attachment1.txt & attachment1.txt). The contents of the two files are diferent as per the expected results but only for the attachment names.
    Any help in this case would be appreciated.

    Hi,
    Here are the parameters we will pass when we use the Fm
      lt_packing_list-transf_bin = 'X'.
      lt_packing_list-head_start = 1.
      lt_packing_list-head_num = 0.
      lt_packing_list-body_start = lv_start.
      lt_packing_list-body_num = tab_lines.
      lt_packing_list-doc_type = lv_extension.
      <b>lt_packing_list-obj_name = it_attach_data-attch_name.</b>
      lt_packing_list-obj_descr = it_attach_data-attch_desc.
    here we write an append statements, so in your case, when
    filling the second time, you need to send the different file name, so pass the new name, ans also look the same in Debugging mode, it should come correct ...
    Regards
    Sudheer

  • Sender mail adapter - attachment name

    Hi there
    We have configured a sender email adapter to receive text/csv attachments and save them to a file system. What we are having a problem with is reading the attachment name. So we are using Dynamis Configuration to create the file name using the subject line - Which is not ideal. Ideally we would like to use the same name as the origianl attachment but haven't found any way of doing that. We even tried using Content-type in the Variable Header (XHeaderName1) suing variable transport binding but it doesn't show up in the Dynamic Config part of the SOAP message.
    Is there any way of reading the name of the file attachment? We are on PI release 7.0.
    Any help would be appreciated.
    Cheers
    Salil

    Hi Vitor
    There are 2 scenarios that I can think of -
    1. You are saving the email attachment as a file. In that case use step 3 in the earlier reply to get the attachment name and save the file witht that name.
    2. You are sending the XML straight to a receiver using HTTP, IDOC, JDBC etc. in which case you would need the attachment name much earlier that step 3. For that I guess you would have to write another adapter module on the sender mail adapter(at Position 3 where position1 = payloadswap bean, 2 = custom module to get the attachment name) and add an xml tag to your incoming message. These adapter modules are really powerful and are like user exits in ABAP. In that case you would have to change the Data Type in the Integration repository to reflect that extra tag. Here is some code from a module we wrote to totally change the structure of the xml coming in. The key thing to remember is this module is that you can read the whole message byte by byte. There might be smarter ways of doing it (like using the SAP XML parser factory class) but since I'm not a Java programmer I stuck to the basics. Here's the code( you could also look at the example given in sap help where they remove (or add I'm not sure) CR(carriage return) from CRLF (CR Line feed).
    Created on Aug 8, 2007
    To change the template for this generated file go to
    Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
    package jdbcPackage;
    import javax.ejb.CreateException;
    import javax.ejb.SessionBean;
    import javax.ejb.SessionContext;
    import com.sap.aii.af.mp.module.*;
    import com.sap.aii.af.ra.ms.api.*;
    @author Salil.Mehta Soltius NZ Ltd
    To change the template for this generated type comment go to
    Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
    public class jdbcClass implements SessionBean, Module {
         private SessionContext myContext;
         public void ejbRemove() {
         public void ejbActivate() {
         public void ejbPassivate() {
         public void setSessionContext(SessionContext context) {
              myContext = context;
         public void ejbCreate() throws CreateException {
         public ModuleData process(
              ModuleContext moduleContext,
              ModuleData inputModuleData)
              throws ModuleException {
              //        put your code here
              try {
                   Message msg = (Message) inputModuleData.getPrincipalData();
                   XMLPayload payload = msg.getDocument();
                   String payEnc = payload.getEncoding();
                   byte[] payByte = payload.getContent();
                   byte[] payByteOut = new byte[payByte.length];
                   byte[] payByteTemp = new byte[payByte.length];
                   int i;
                   int j;
                   int actualCount = 0;
                   char xmlTagFound = ' ';
                   char endXmlTagFound = ' ';
                   char tagFound = ' ';
                   System.arraycopy(payByte, 0, payByteTemp, 0, payByte.length);
                   // Step 1 - Conversions 
                   // convert   "&lt; to <"    and     "&gt; to >"
                   // convert   &quot; to "
                   // This will remove any carriage returns and line feeds
                   // and the <XML* and </XML* tags plus the <row> and </row> tags
                   for (i = 0; i < payByte.length; i++) {
                        // convert   &lt; to <    and     &gt; to >
                        if (payByteTemp<i> == '&') {
                             if (payByteTemp[i + 1] == 'l') {
                                  if (payByteTemp[i + 2] == 't') {
                                       if (payByteTemp[i + 3] == ';') {
                                            payByteTemp<i> = '<';
                                            payByteTemp[i + 1] = '\n';
                                            payByteTemp[i + 2] = '\n';
                                            payByteTemp[i + 3] = '\n';
                        if (payByteTemp<i> == '&') {
                             if (payByteTemp[i + 1] == 'g') {
                                  if (payByteTemp[i + 2] == 't') {
                                       if (payByteTemp[i + 3] == ';') {
                                            payByteTemp<i> = '>';
                                            payByteTemp[i + 1] = '\n';
                                            payByteTemp[i + 2] = '\n';
                                            payByteTemp[i + 3] = '\n';
                        if (payByteTemp<i> == '&') {
                             if (payByteTemp[i + 1] == 'q') {
                                  if (payByteTemp[i + 2] == 'u') {
                                       if (payByteTemp[i + 3] == 'o') {
                                            if (payByteTemp[i + 4] == 't') {
                                                 if (payByteTemp[i + 5] == ';') {
                                                      payByteTemp<i> = '"';
                                                      payByteTemp[i + 1] = '\n';
                                                      payByteTemp[i + 2] = '\n';
                                                      payByteTemp[i + 3] = '\n';
                                                      payByteTemp[i + 4] = '\n';
                                                      payByteTemp[i + 5] = '\n';
                        // This will take in the initial xml declaration from the Byte array
                        // And we also don't want the stuff after the xml declaration till
                        // we reach the first <row> tag     
                        if (xmlTagFound == ' ') {
                             if (payByteTemp<i> == '>') {
                                  xmlTagFound = 'X';
                             payByteOut[actualCount++] = payByteTemp<i>;
                             if (xmlTagFound == 'X') {
                                  payByteOut[actualCount++] = '\r';
                             continue;
                        if (xmlTagFound == 'X') {
                             if (payByteTemp<i> == '<') {
                                  if (payByteTemp[i + 1] == 'r') {
                                       if (payByteTemp[i + 2] == 'o') {
                                            if (payByteTemp[i + 3] == 'w') {
                                                 if (payByteTemp[i + 4] == '>') {
                                                      xmlTagFound = 'Y';
                                                 } else {
                                                      continue;
                                            } else {
                                                 continue;
                                       } else {
                                            continue;
                                  } else {
                                       continue;
                             } else {
                                  continue;
                        // Carriage return and line feed
                        if ((payByteTemp<i> == '\r') || (payByteTemp<i> == '\n')) {
                             continue;
                        // <XML_*> tag
                        if (payByteTemp<i> == '<') {
                             if (payByteTemp[i + 1] == 'X') {
                                  if (payByteTemp[i + 2] == 'M') {
                                       if (payByteTemp[i + 3] == 'L') {
                                            tagFound = 'X';
                                            endXmlTagFound = ' ';
                                            continue;
                        // </XML_*> tag
                        if (payByteTemp<i> == '<') {
                             if (payByteTemp[i + 1] == '/') {
                                  if (payByteTemp[i + 2] == 'X') {
                                       if (payByteTemp[i + 3] == 'M') {
                                            if (payByteTemp[i + 4] == 'L') {
                                                 tagFound = 'X';
                                                 endXmlTagFound = 'X';
                                                 continue;
                        // <row> tag
                        if (payByteTemp<i> == '<') {
                             if (payByteTemp[i + 1] == 'r') {
                                  if (payByteTemp[i + 2] == 'o') {
                                       if (payByteTemp[i + 3] == 'w') {
                                            if (payByteTemp[i + 4] == '>') {
                                                 tagFound = 'X';
                                                 continue;
                        // </row> tag
                        if (payByteTemp<i> == '<') {
                             if (payByteTemp[i + 1] == '/') {
                                  if (payByteTemp[i + 2] == 'r') {
                                       if (payByteTemp[i + 3] == 'o') {
                                            if (payByteTemp[i + 4] == 'w') {
                                                 if (payByteTemp[i + 5] == '>') {
                                                      tagFound = 'X';
                                                      continue;
                        if ((payByteTemp<i> == '>') && (tagFound == 'X')) {
                             tagFound = ' ';
                             continue;
                        if (tagFound == ' ') {
                             if (endXmlTagFound == 'X') {
                                  continue;
                             payByteOut[actualCount++] = payByteTemp<i>;
                   byte[] payByteExp = new byte[actualCount];
                   System.arraycopy(payByteOut, 0, payByteExp, 0, actualCount);
                   payload.setContent(payByteExp);
                   msg.setDocument(payload);
                   inputModuleData.setPrincipalData(msg);
              } catch (Exception e) {
                   ModuleException me = new ModuleException(e);
                   throw me;
              return inputModuleData;

  • Mail Attachment Name

    Hi,
    I am using File to Mail scenario. There is no mapping, it uses dummy Interfaces. I have Adapter Module at the Receiver in Mail to dynamically get the filename and set it as the attachment name.
    Following is the module code. The problem with the code is I get 2 attachments in the mail, One with proper file name as desired and the 2nd attachment as "Untitled.xml". Need to get rid of this Untitled.xml. Note: Keep attachments is Checked as I need the file in attachment.
    Message msg = (Message) inputModuleData.getPrincipalData();     
                   XMLPayload xmlpayload = msg.getDocument();
                   String strfileName = msg.getMessageProperty("http://sap.com/xi/XI/System/File", "FileName");
                   byte by[] =  xmlpayload.getText().getBytes();
                   xmlpayload.setName(strfileName);
                   xmlpayload.setContentType("text/xml");
                   xmlpayload.setContent(by);
                   msg.addAttachment(xmlpayload);
                   inputModuleData.setPrincipalData(msg);

    Create an UDF and mention the key and the value of the file name you wish
    public void DynamicFilename(String[] a,String[] b,ResultList result,Container container){
      //write your code here
    AbstractTrace trace = container.getTrace();
    String strDirectory=" ";
    String strFileName="";
    try
         Map map= container.getTransformationParameters();
         //This is for generating the file Direcotry Dynamically
         DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get
    (StreamTransformationConstants.DYNAMIC_CONFIGURATION);
         DynamicConfigurationKey key = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/File", "Directory");
         DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File",
    "FileName");
    strDirectory= "/xxx/xxx/xx";
    strFileName= b[0] + b[2] + b[1]+ ".XML";
    trace.addWarning("strDirectory " +strFileName);     
    conf.put(key, strDirectory);
    conf.put(key1, strFileName);
    result.addValue(b[0]);
    catch(Exception ex)
    trace.addWarning("Catch Block " );
    Edited by: Sainath Chutke on Jan 16, 2009 10:19 AM

  • Change attachment name using mail adapter

    Hi All,
    I have a problem changing the attachment name in my scenario. I use Mail scenario to send a pdf Attachment from R/3 to email address. Everything working fine except the attachment name that becoming untitled.pdf and untitled.txt.
    Communication Channel setting :
    message protocol : xipayload
    transport protocol : smtp
    checked use mail package
    checked keep attachment
    I have use MessageTransformBean in my receiver adapter, but no luck. It was produce an error.
    anyone have an idea to solve my problem?
    thx,
    Robby

    Hi,
    You need to go to the Module tab of the Mail adapter receiver communcation channel and give the parameter as Transform.contentDisposition and its value as attachment ( since you needed the output to be sent as an attachment) and give the name of the attachment as you required.
    Please see the help page : [http://help.sap.com/saphelp_nw04/helpdata/en/57/0b2c4142aef623e10000000a155106/frameset.htm] for more details and more options of the parameters.
    Regards,
    Kalpana.

  • SOAPFault from Integration Server because of attachment name

    Hello everyone,
    I'm currently building the attachment function into our adapter for IBM Lotus Notes and SAP XI.
    In the Sender part, the adapter must add the attachment from Lotus Notes to the XI Message as a payload.
    The following source code show how to do this:
    /Create a payload from a XI Message/
    Payload attachment = xiMessage.createPayLoad();
    /Set the attachment name with the file name of the Notes attachment/
    /I have problem with this method/
    attachment.setName(notesAttachment.getFileName());
    /Set the content (byte array) of the attachment/
    attachment.setContent(notesAttachment.getBytesContents());
    This works well unless no special file name like ("Ättachment") is entered in the method Payload.setName().
    Errors will be shown in the Audit Log:
    1. SOAPFault received from Integration Server. ErrorCode/Category: XIProtocol/SAP_CODEPAGE_CONVERSION_ERROR; Params:  ; AdditionalText:  ; ApplicationFaultMessage:  ; ErrorStack: Error when converting the code page for character set UTF-8 (code page 4110): Cannot convert character sets for one or more characters.
    2. Transmitting the message to endpoint http://kit-was:8000/sap/xi/engine?type=entry using connection AFW failed, due to: com.sap.aii.af.ra.ms.api.RecoverableException: Received HTTP response code 500 : Error during creation of multipart mime object.
    and in the Logviewer:
    1. enrichMessageData(): Error during retrieving the end-to-end-monitoring information
    Thrown:com.sap.aii.rwb.endtoendmonitoring.util.Sxmb_Get_Pmi_Info_Fault_Exception:      at sun.reflect.GeneratedConstructorAccessor553.newInstance(Unknown Source)     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)     at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
    But in the "Message content --> SOAP Document", the attachment name can be showed correctly:
    - <sap:Payload xlink:type="simple" xlink:href="cid:[email protected]">
      <sap:Name>Ättachment</sap:Name>
      <sap:Description>üüüäää</sap:Description>
      <sap:Type>ApplicationAttachment</sap:Type>
      </sap:Payload>
    I've no idea, what should I do. Apparently I did every correctly, but why SAP Integration Server didn't work?
    The ABAP stack of the XI server should also support Unicode. Our XI server is 04 SP 19.
    Please give me some help.
    with regards
    Xiang

    Hi Stefan,
    thanks for your reply.
    The problem is that String is unicode in Java. The method from SAP is
    void setName(java.lang.String name) .
    In Java it is only necessary to define charset when create a string based on a bytes array.
    String(byte[] bytes, String charsetName)
              Constructs a new String by decoding the specified array of bytes using the specified charset.
    I got the file name from Lotus Notes as a String and just gave it to the SAP method. Then the Integration Server gave an error message about the name.
    Regards
    Xiang

  • SOAP adapter looses attachment name

    We have a very annoying problem regarding the SOAP adapter. PI "looses" the attachment names when we send from one to the other PI system with the SOAP adapter. E.g. source attachment name is "invoice.pdf", on the target side it is "attachment-1". It seems to be a general shortcoming/bug of the SOAP adapter. I do not know if it gets lost in the SOAP receiver channel or later in the sender channel of the other party.
    Is there any way to get around this, so that the partner receives the correct attachment name ? Some configuration in the SOAP channels ? One solution is to pass a name in the content-type (I think that will be preserved), but that I consider only as workaround.
    We have that problem on PI 7.0 and even on PI 7.1
    Regards,
    Christian Sy

    Hello,
    The following note may help with this issue
    1255507     Attachments not being sent to the receiver
    Also you could check:
    1522630     XI runtime: Payload ignored due to parsing error
    1501345     XI runtime: Manifest <attachment-name> is initial
    Regards,
    Sarah

  • Mail does not print attachment name & prints small

    When printing an email, if it has an attachment, it does not print the attachment name.  It prints the icon of the attachment (excel, word, psd, etc.) but it doesn't print the name of the file under it.  This started happening since upgrading to Mavericks.
    Also, emails are printing much smaller.  Is there a way to enlarge the font when printing?

    The same here and quite a lot of other Mail bugs - and all since the new MacPro and Mavericks, no such problems with Mavericks on the MacBookPro 2011 though
    Sometimes the file names are printed, sometimes not and there is no way to find out why - it happens on and off with own mails to be sent and mails received.
    Workaround for own mails is put each file underneath the other with some distance from the last word. Workaround in case of customer mails received go to reply, edit signature on top, reduce to one page and hope .... sometimes it works.
    Also: on and off, Preview will show and printer will print only header on the first page, then body text on the second - only workaround to date (and believe me, I've tried everything) is use Reply, eliminate your own signature and reduce the printed area to less than a page
    Also: long mails with back-and-forth messages may print a line half on one page and lower half on second one .... no workaround here.
    Seems Mail is going to A4 US instead of A4 small (Europe), though this is not what the printer and the system or Word etc. are set to.
    And a sneaking suspicion, that it works ok with people sending me mails from a Mac, but not from a Windows box ... can't bother all my customers though and ask
    So please Apple - lots of people have the same problems - will you finally do something about it ... and yes I used the Feedback function
    Suzanne

  • SENDING REPORTS O/P THRU E-MAIL: ATTACHMENT NAME NOT VISIBLE

    Hi,
    I have created a report program which will convert report o/p to excel sheet and send the attachment to the mail id provided in the selection screen. Here in this case the mail is going perfectly, and the attachment also but the problem is the attachment name is not visble.
    From the program it is expected that the attachment name is delivery.xls. but in the mail it is showing only .xls...
    here is the code I used. Please correct me...
    REPORT  ZRAM.
    TABLES: LIPS.
    DATA: BEGIN OF IT_LIPS OCCURS 0,
            VBELN LIKE LIPS-VBELN,
            POSNR LIKE LIPS-POSNR,
            MATNR LIKE LIPS-MATNR,
            WERKS LIKE LIPS-WERKS,
          END OF IT_LIPS.
    DATA:   it_message TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0
                    WITH HEADER LINE.
    DATA:   it_attach TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0
                    WITH HEADER LINE.
    DATA:   t_packing_list LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
            t_contents LIKE solisti1 OCCURS 0 WITH HEADER LINE,
            t_receivers LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
            t_attachment LIKE solisti1 OCCURS 0 WITH HEADER LINE,
            t_object_header LIKE solisti1 OCCURS 0 WITH HEADER LINE,
            w_cnt TYPE i,
            w_sent_all(1) TYPE c,
            w_doc_data LIKE sodocchgi1,
            gd_error    TYPE sy-subrc,
            gd_reciever TYPE sy-subrc.
    SELECT-OPTIONS: S_VBELN FOR LIPS-VBELN.
    PARAMETERS : P_EMAIL TYPE somlreci1-receiver lower case DEFAULT
    '[email protected]'.
    SELECT VBELN POSNR MATNR WERKS
           FROM LIPS INTO TABLE IT_LIPS
           WHERE VBELN IN S_VBELN.
    PERFORM build_xls_data_table.
    perform populate_email_message_body.
    Send file by email as .xls speadsheet
      PERFORM send_file_as_email_attachment
                                   tables it_message
                                          it_attach
                                    using p_email
                                          'Delivery details'
                                          'XLS'
                                          'delivery'
                                 changing gd_error
                                          gd_reciever.
      Instructs mail send program for SAPCONNECT to send email(rsconn01)
      PERFORM initiate_mail_execute_program.
    *&      Form  BUILD_XLS_DATA_TABLE
          Build data table for .xls document
    FORM build_xls_data_table.
    CONSTANTS: con_cret TYPE x VALUE '0D',  "OK for non Unicode
                con_tab TYPE x VALUE '09'.   "OK for non Unicode
    *If you have Unicode check active in program attributes thnen you will
    *need to declare constants as follows
    class cl_abap_char_utilities definition load.
    constants:
        con_tab  type c value cl_abap_char_utilities=>HORIZONTAL_TAB,
        con_cret type c value cl_abap_char_utilities=>CR_LF.
      CONCATENATE 'VBELN' 'POSNR' 'MATNR' 'WERKS'
             INTO it_attach SEPARATED BY con_tab.
      CONCATENATE con_cret it_attach  INTO it_attach.
      APPEND  it_attach.
      LOOP AT it_LIPS.
        CONCATENATE IT_LIPS-VBELN IT_LIPS-POSNR
                    IT_LIPS-MATNR IT_LIPS-WERKS
               INTO it_attach SEPARATED BY con_tab.
        CONCATENATE con_cret it_attach  INTO it_attach.
        APPEND  it_attach.
      ENDLOOP.
    ENDFORM.                    " BUILD_XLS_DATA_TABLE
    *&      Form  SEND_FILE_AS_EMAIL_ATTACHMENT
          Send email
    FORM send_file_as_email_attachment tables pit_message
                                              pit_attach
                                        using p_email
                                              p_mtitle
                                              p_format
                                              p_filename
                                              p_attdescription
                                              p_sender_address
                                              p_sender_addres_type
                                     changing p_error
                                              p_reciever.
      DATA: ld_error    TYPE sy-subrc,
            ld_reciever TYPE sy-subrc,
            ld_mtitle LIKE sodocchgi1-obj_descr,
            ld_email LIKE  somlreci1-receiver,
            ld_format TYPE  so_obj_tp ,
            ld_attdescription TYPE  so_obj_nam ,
            ld_attfilename TYPE  so_obj_des ,
            ld_sender_address LIKE  soextreci1-receiver,
            ld_sender_address_type LIKE  soextreci1-adr_typ,
            ld_receiver LIKE  sy-subrc.
      ld_email   = p_email.
      ld_mtitle = p_mtitle.
      ld_format              = p_format.
      ld_attdescription      = p_attdescription.
      ld_attfilename         = p_filename.
      ld_sender_address      = p_sender_address.
      ld_sender_address_type = p_sender_addres_type.
    Fill the document data.
      w_doc_data-doc_size = 1.
    Populate the subject/generic message attributes
      w_doc_data-obj_langu = sy-langu.
      w_doc_data-obj_name  = 'SAPRPT'.
      w_doc_data-obj_descr = ld_mtitle .
      w_doc_data-sensitivty = 'F'.
    Fill the document data and get size of attachment
      CLEAR w_doc_data.
      READ TABLE it_attach INDEX w_cnt.
      w_doc_data-doc_size =
         ( w_cnt - 1 ) * 255 + STRLEN( it_attach ).
      w_doc_data-obj_langu  = sy-langu.
      w_doc_data-obj_name   = 'SAPRPT'.
      w_doc_data-obj_descr  = ld_mtitle.
      w_doc_data-sensitivty = 'F'.
      CLEAR t_attachment.
      REFRESH t_attachment.
      t_attachment[] = pit_attach[].
    Describe the body of the message
      CLEAR t_packing_list.
      REFRESH t_packing_list.
      t_packing_list-transf_bin = space.
      t_packing_list-head_start = 1.
      t_packing_list-head_num = 0.
      t_packing_list-body_start = 1.
      DESCRIBE TABLE it_message LINES t_packing_list-body_num.
      t_packing_list-doc_type = 'RAW'.
      APPEND t_packing_list.
    Create attachment notification
      t_packing_list-transf_bin = 'X'.
      t_packing_list-head_start = 1.
      t_packing_list-head_num   = 1.
      t_packing_list-body_start = 1.
      DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.
      t_packing_list-doc_type   =  ld_format.
      t_packing_list-obj_descr  =  ld_attdescription.
      t_packing_list-obj_name   =  ld_attfilename.
      t_packing_list-doc_size   =  t_packing_list-body_num * 255.
      APPEND t_packing_list.
    Add the recipients email address
      CLEAR t_receivers.
      REFRESH t_receivers.
      t_receivers-receiver = ld_email.
      t_receivers-rec_type = 'U'.
      t_receivers-com_type = 'INT'.
      t_receivers-notif_del = 'X'.
      t_receivers-notif_ndel = 'X'.
      APPEND t_receivers.
      CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
           EXPORTING
                document_data              = w_doc_data
                put_in_outbox              = 'X'
                sender_address             = ld_sender_address
                sender_address_type        = ld_sender_address_type
                commit_work                = 'X'
           IMPORTING
                sent_to_all                = w_sent_all
           TABLES
                packing_list               = t_packing_list
                contents_bin               = t_attachment
                contents_txt               = it_message
                receivers                  = t_receivers
           EXCEPTIONS
                too_many_receivers         = 1
                document_not_sent          = 2
                document_type_not_exist    = 3
                operation_no_authorization = 4
                parameter_error            = 5
                x_error                    = 6
                enqueue_error              = 7
                OTHERS                     = 8.
    Populate zerror return code
      ld_error = sy-subrc.
    Populate zreceiver return code
      LOOP AT t_receivers.
        ld_receiver = t_receivers-retrn_code.
      ENDLOOP.
    ENDFORM.
    *&      Form  INITIATE_MAIL_EXECUTE_PROGRAM
          Instructs mail send program for SAPCONNECT to send email.
    FORM initiate_mail_execute_program.
      WAIT UP TO 2 SECONDS.
      SUBMIT rsconn01 WITH mode = 'INT'
                    WITH output = 'X'
                    AND RETURN.
    ENDFORM.                    " INITIATE_MAIL_EXECUTE_PROGRAM
    *&      Form  POPULATE_EMAIL_MESSAGE_BODY
           Populate message body text
    form populate_email_message_body.
      REFRESH it_message.
      it_message = 'Please find attached a list test lips records'.
      APPEND it_message.
    endform.                    " POPULATE_EMAIL_MESSAGE_BODY

    Hi
      check the blow code:
    DATA:   receiver LIKE somlreci1 OCCURS 0 WITH HEADER LINE.
    MESSAGE ZF100 (FTP an UDB fehlgeschlagen)
      text-msgid = msgid.
      text-msgno = msgno.
      text-msgv1 = msgv1.
      text-msgv2 = ' '.
      text-msgv3 = ' '.
      text-msgv4 = ' '.
    express_hold_time
      express_hold_time-days = 01.
      express_hold_time-h_min_sec = 240000.
    receiver
      receiver-receiver = mreceivr.
    Gruppe von Empfängern
      receiver-rec_type = 'C'.
    und Expressmeldung ausgeben
      receiver-express  = 'X'.
      APPEND receiver.
      CALL FUNCTION 'MESSAGE_SEND_AS_MAIL'
           EXPORTING
                msgid     = text-msgid
                msgno     = text-msgno
                msgv1     = text-msgv1
                msgv2     = text-msgv2
                msgv3     = text-msgv3
           TABLES
                receivers = receiver.
      IF sy-subrc <> 0.
        WRITE:/ 'hat nicht geklappt', 'SY-SUBRC =', sy-subrc.
      ENDIF.

  • Gmail access through Mail : Attachment name and extension terminated

    When I try to send an attachment through Gmail using Mail, if the attachment names have more than one word with spaces in them, the entire name is terminated to the first few letters before the space and the file extension is lost too; so the recipients end up having incomplete file names without any extension. The files transfer perfectly and once the extensions are put in, they open without a problem. Receiving attachments where the names have spaces etc. is not a problem at my end though.
    Any idea what I should tweak?
    Thanks.

    All updates are installed regularly, so I am indeed at the newest version of all available software. I just haven't updated my signature here.
    And the name of the attachment is mangled only when I use the client to send an attachment to any other Gmail account ( both Windows or Mac, accessed either through a client or directly at the receiving end). The same email cc'd to my school address shows the entire file name. And if I send the email through Gmail directly, then it is fine too, as I mentioned.
    Message was edited by: Deep Blue to change the OS version.

  • Change e-mail attachment name dynamic in Broadcaster

    Hi,
    I want to send an e-mail to multiple recipient by the setting "e-mail bursting" in broadcaster. Each e-mail has an attachment (pdf-document).
    Is it possible, to change the name of the attachment dynamic, when sending the mail to the different recipients (example:
    recipient 1: recipient1.pdf,
    recipient 2: recipient2.pdf,
    and so on)
    I tried a solution with text variables, but it didn't work.
    Regards,
    Tim Jaschik

    Hi,
    thanks for your fast answer. But my problem is to change the attachment name of the e-mail, not to schedule the e-mail.
    So, is there no possibility to control the process which creates the attachment name?
    Regards,
    Tim

  • E-mail Attachment Name Changes

    I have a following problem with mail attachments: When I drag the attachment from my mail window onto my desktop, the attachment name changes to "unknown". So for example, "cat.jpg" would become "unknown.jpg". To make this a bit more complicated, the problem is a bit random and from this it follows that sometimes the file keeps the original and correct file name and sometimes it changes it. Also, this problem occurs only when I drag the attachment (which normally is image) from email window, but if I pull the attachment from above the message window, where it has a little arrow and it shows all the attachment icons, this problem does not happen. I am running Tiger and Mail 2.1. It would we really great if you could take a sec to answer this if you have any idea at all what this problem might to be. Thanks!
    Best, Rauno

    Hi Rauno, and a warm welcome to the forums!
    Hmmm, since it's random, might try this...
    Quit Mail, then In your home folder, try moving this +folder & file+ to the Desktop then reboot...
    First, Safe Boot from the HD, (holding Shift key down at bootup), run Disk Utility in Applications>Utilities, then highlight your drive, click on Repair Permissions, then move these files to the Desktop.
    /Users/YourUserName/Library/Caches/Mail
    Move to the Desktop...
    /Users/YourUserName/Library/Mail/Envelope Index
    You can always move them back if it doesn't help.

  • EmailEventGenerator Document and attachment names

    Hi,
    I am using this method call to get the email attachment names from the EmailEventGeneratorDocument
    this.emailEventGeneratorDocument.getEmailEventGenerator().getAttachments()
    The method returns a string of comma delimited file names attached with the email. I use a file control to retrieve the contents of the file by parsing the returned comma delimited file.
    The problem I am facing is that, if the attached file name in the email has a comma, the getAttachments()method gives me a truncated file name, which breaks the process. Is there a work around for this problem ?
    Thx
    Chandra

    I've got this working by running the report to file, reading the file back using TEXT_IO and then using UTL_SMTP to send the email, with attached report. It works fine but it's a bit of work, especially if you want to send emails externally past your firewall, as all emails sent using UTL_SMTP are effectively the same as a spoofed email, and the firewall needs to be changed to handle this.
    If you're interested I've posted the solution up under another message in the Forms forum, title: E-mail and Attachment Problem on web...
    Let me know if you need more details.
    Jayesh Kavia

Maybe you are looking for