DeliveryService attachment name is "ReportData", need extension ".pdf"

Hi All,
We are using the BI Web Service deliveryService to email reports. We are running the report using runReportand setting the attributeFormat to pdf. We take the results from that and call the deliveryService. We set the contentType to 'application/pdf' and set the documentData to the results of the runReport call. The email comes in fine but the attachment name is "reportData". Is there a way to specify the attachment name (the report name would be great) and more importantly is to append the ".pdf" extension to the name?
Thank you
Rudy

Yahoo probably made a change to their web mail page that conflicts with Safari. Check your Safari preferences in the Security area. Next to Web Content, are Enable Java and Enable JavaScript checked?
Have you tried using FireFox or Camino, to see if the problem exists in another browser?

Similar Messages

  • Define attachment name for PDF document using ABAP class CL_BCS

    Hi,
    I am using the ABAP class CL_BCS to send an email with a PDF attachment. The issue I have is that although I am specifying the attchment name when receiving the email the attachment is called 'MESSAGE'PDF'.
    I can view the attachment in SOST and the correct attachment name appears.
    I need to use this class as I am sending multiple attachments, whereas the FM only allows 1 attachment .
    Has anyone had this issue before with a PDF attachment.
    Thanks
    Martin

    Hi Hasan,
    I have similar requirement. I see your post is pretty old and hope you would have found the solution at that time.
    Could you please share it with me?
    Thanks
    Puneet

  • Need to get the Mail attachment name as it is to the receiver file adapter

    I am doing a Mail to File scenario. I need to get the attachment from the mail and store it on the file server. I am using the PayloadSwap bean in the sender mail adapter. My requirement is to carry forward the attachement name as it is to the receiver file adapter side and store the file with the same name.
    Did any one try doing this? I was looking at developing an adapter module but got struck as I could not find whether the attachement name is stored in the XI payload after it has got swapped using the swap bean.
    Any help would be appreciated.
    VJ

    Oops pressed the send key. Take two.
    This is becoming a damn nightmare. When I run the adapter I am getting ModuleExceptions. Can you pass your eyes over these Java config settings to see what I am doing wrong. Using NWDS CE 7.1 with PI 7.1 both at SP07. All the imports were taken from PI 7.1 after SP07 was applied. The build id of NWDS is
    SAP NetWeaver Developer Studio
    SAP NetWeaver 7.1 Composition Environment SP07 PAT0001
    Build id: 200901152336
    APPLICATION.XML
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN"
    "http://java.sun.com/dtd/application_1_3.dtd">
    <application>
    <display-name>MailPOP_EAR</display-name>
    <description>EAR description</description>
    <module>
    <ejb>MailPOP_EJB.jar</ejb>
    </module>
    </application>
    APPLICATION-J2EE-ENGINE.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE application-j2ee-engine SYSTEM "application-j2ee-engine.dtd">
    <application-j2ee-engine>
    <reference reference-type="hard">
    <reference-target provider-name="sap.com" target-type="service">engine.security.facade</reference-target>
    </reference>
    <reference reference-type="hard">
    <reference-target provider-name="sap.com" target-type="library">engine.j2ee14.facade</reference-target>
    </reference>
    <reference reference-type="hard">
    <reference-target provider-name="sap.com" target-type="service">com.sap.aii.af.svc.facade</reference-target>
    </reference>
    <reference reference-type="hard">
    <reference-target provider-name="sap.com" target-type="interface">com.sap.aii.af.ifc.facade</reference-target>
    </reference>
    <reference reference-type="hard">
    <reference-target provider-name="sap.com" target-type="library">com.sap.aii.af.lib.facade</reference-target>
    </reference>
    <reference reference-type="hard">
    <reference-target provider-name="sap.com" target-type="library">com.sap.base.technology.facade</reference-target>
    </reference>
    <fail-over-enable mode="disable" />
    </application-j2ee-engine>
    EJB-J2EE-ENGINE.XML
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE ejb-j2ee-engine SYSTEM "ejb-j2ee-engine.dtd">
    <ejb-j2ee-engine>
    <enterprise-beans>
    <enterprise-bean>
    <ejb-name>GetMailAttachment</ejb-name>
    <jndi-name>GetMailAttachment</jndi-name>
    <session-props/>
    </enterprise-bean>
    </enterprise-beans>
    </ejb-j2ee-engine>
    EJB-JAR.XML
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans
    2.0//EN"
    "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
    <ejb-jar>
    <description>EJB JAR description</description>
    <display-name>EJB JAR</display-name>
    <enterprise-beans>
    <session>
    <ejb-name>GetMailAttachment</ejb-name>
    <home>com.sap.aii.af.lib.mp.module.ModuleHome</home>
    <remote>com.sap.aii.af.lib.mp.module.ModuleRemote</remote>
    <local-home>com.sap.aii.af.lib.mp.module.ModuleLocalHome</local-home>
    <local>com.sap.aii.af.lib.mp.module.ModuleLocal</local>
    <ejb-class>sample.GetMailAttachment</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Container</transaction-type>
    </session>
    </enterprise-beans>
    </ejb-jar>
    SENDER MAIL ADAPTER modules
    1 AF_Modules/PayloadSwapBean Local EB 1
    2 GetMailAttachment Local EB 2
    3 sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean Local EB 3
    1     swap.keyName          payload-name
    1     swap.keyValue          MailAttachment-1
    RECEIVER FILE MODULES
    1     localejbs/AF_Modules/DynamicConfigurationBean     Local Enterprise Bean     1
    2     localejbs/CallSapAdapter                    Local Enterprise Bean     2
    1     key.0          write http://sap.com/xi/XI/System/File FileName
    1     value.0          message.interface
    VARIABLE FILENAME SUBST WITH ASMA TURNED ON
    fName     message:interface_name
    JAVA SOURCE
    package sample;
    import javax.ejb.CreateException;
    import javax.ejb.SessionBean;
    import javax.ejb.SessionContext;
    import com.sap.aii.af.lib.mp.module.Module;
    import com.sap.aii.af.lib.mp.module.ModuleContext;
    import com.sap.aii.af.lib.mp.module.ModuleData;
    import com.sap.aii.af.lib.mp.module.ModuleException;
    import com.sap.engine.interfaces.messaging.api.Message;
    import com.sap.engine.interfaces.messaging.api.MessagePropertyKey;
    import com.sap.engine.interfaces.messaging.api.TextPayload;
    import com.sap.engine.interfaces.messaging.api.XMLPayload;
    import com.sap.aii.af.service.cpa.Channel;
    @ejbHome <{com.sap.aii.af.lib.mp.module.ModuleHome}>
    @ejbLocal <{com.sap.aii.af.lib.mp.module.ModuleLocal}>
    @ejbLocalHome <{com.sap.aii.af.lib.mp.module.ModuleLocalHome}>
    @ejbRemote <{com.sap.aii.af.lib.mp.module.ModuleRemote}>
    @stateless
    <code>GetMailAttachment</code>
    @SuppressWarnings("unused")
    public class GetMailAttachment implements SessionBean, Module {
         private static final long serialVersionUID = 7612238514043673502L;
         private SessionContext myContext;
         private MessagePropertyKey myFileName;
         public void ejbRemove() {
         public void ejbActivate() {
         public void ejbPassivate() {
         public void setSessionContext(SessionContext context) {
              myContext = context;
    @throws CreateException
         public void ejbCreate() throws CreateException {
         public void getMessageProperty(MessagePropertyKey FileName) {
              myFileName = FileName;
    @param moduleContext
               Contains data of the module processor that might be important
               for the module implementation such as current channel ID
    @param inputModuleData
               Contains the input XI message as principal data plus eventual
               set supplemental data
    @return ModuleData Contains the (changed) output XI message. Might be the
            response message if the module is the last in the chain.
    @exception ModuleException
                   Describes the cause of the exception and indicates whether
                   an retry is sensible or not.
         @SuppressWarnings("deprecation")
         public ModuleData process(ModuleContext moduleContext,
                   ModuleData inputModuleData) throws ModuleException {
              try {
                   Message msg = (Message) inputModuleData.getPrincipalData();
                   TextPayload payload = msg.getDocument();
                   String contentType = payload.getContentType();
                   // Content Type could be something like
                   // text/plain;charset="UTF-8";name="file.txt"
                   contentType = contentType.replaceAll("\"", "");
                   int i = contentType.lastIndexOf("=") + 1;
                   String fileName = contentType.substring(i);
                   msg.setMessageProperty(myFileName, fileName);
                   inputModuleData.setPrincipalData(msg);
              } catch (Exception e) {
              return inputModuleData;
    JAVA ERRORS
    2009-02-04 11:41:14     Information     Mail: calling the module processor for channel LMK_Common_Mail_Sender
    2009-02-04 11:41:14     Information     Swap: swapping by payload-name ? MailAttachment-1
    2009-02-04 11:41:14     Information     Swap: successfully swapped
    2009-02-04 11:41:14     Information     Mail: message leaving the adapter (call)
    2009-02-04 11:41:14     Information     The application tries to send an XI message asynchronously using connection AFW.
    2009-02-04 11:41:14     Information     Backward validation is enabled
    2009-02-04 11:41:14     Error     Unable to validate the message with message ID 8702df71-f254-11dd-9b9b-001a64a73518
    2009-02-04 11:41:14     Error     Returning to application. Exception: com.sap.engine.interfaces.messaging.api.exception.MessagingException: Content is not allowed in prolog.
    2009-02-04 11:41:14     Error     Mail: error occured: com.sap.engine.interfaces.messaging.api.exception.MessagingException: Content is not allowed in prolog.
    2009-02-04 11:41:14     Error     Mail: error occured: com.sap.aii.af.lib.mp.module.ModuleException

  • B2B outbound Channel Configuration - EMail - Attachment Name and Extension

    Hello,
    I have configured an outbound channel to send the payload (xml) as an attachment. When I leave the "Subject" field in the Channel configuration blank, the attachment file name looks like this,"HostPartnerName_TradingPartnerName_DocumentType" without the file extension. If I supply the "Subject" field with the value, the file name gets replaced with the subject and the file extension still is missing.
    I would like to receive a file name in a format like "batch_b2b.messageId.xml". The property b2b.messageId gets the value from the Mediator. The composite that passes the information like the b2b properties has been made generic to handle different Trading Partners, so for a channel that uses SFTP, I have used the Filename format and supplied the value as "batch_%MSG_ID%.xml". Is there a way I can do the same for Email channel?
    Thanks,
    Venkatesh

    Hi Venkatesh,
    Attachment name can be set from the middleware using below header (as per the mode of integration used) -
    1. For AQ mode of integration, use actionName -
    actionName=ATTACHMENT_NAME:test.txt
    2. For JMS mode of integration use custom JMS header - jca.jms.JMSProperty.ATTACHMENT_NAME to populate the name.
    3. For fabric (default) mode of integration, use b2b.attachmentName header
    Regards,
    Anuj

  • Me32K - Need to change the mail subject line, attachment name

    Hi,
    can u please throw light on the below three points which needs to be achieved.
    1. Subject line of the mail needs to be modified from standard to "PO# XXXXXXXXXX".
    2.  Attachment name should be updated from stanadrd to "PO_XXXXXXXXXX".
    3. Also by default mail will be delivered to the default id, but it should be delivered to multiple mail ids maintained in the vendor master.
    I should achieve the above by user exits or by Zprogram copying from th standard.
    Please advise me.
    Thanks a lot.
    Regards,
    Kiran

    check in Tcode: NACE, what is the current driver program and form against your document type.
    and then change accordingly

  • 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 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.

  • Acrobat 9: Auto-Populate Subject line with Attachment Name

    Hello,
    I am trying to auto-populate the subject line of an email with the .pdf attachment name. I don't care either way if this functionality is available or not. I just need a difinitive yes or no answer. And, of course, if yes I need to know how to do it. Email client is Outlook 2007.
    Thanks in Advance,
    Matt

    In that case, I don't believe so.
    You could set up in Acrobat a custom menu item or toolbar button that uses the doc.mailDoc JavaScript method, which is able to set the subject line text. The script could get the current file name and set the subject of the email to the same. More information here: http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.505.html

  • Email attachment name in sender mail adapter to the receiver file adapter

    HI ,
    Ths is regarding email to file scenario. I am trying to create file (in rceiver file adapter) with the same name as the email attachment that i read from mail sender adapter. I want ro use adapter module for this. I could find from blogs that there is module - GetAttachmentName - available that i can use for this in sender mail adapter.
    Can you please let me know what whetehr i neeed to mention any module key and parameters for this.
    I assume , i need to do following steps :Please confirm.
    1. i can use this module - after payload swap module and before standard mail adapter module in sender mail adapter
    2. select ASMA option in advanced tab in sender mail adapter
    3. In receiver file adapter select ASMA option in advanced tab in sender mail adapter
    4. Also select file name option in ASMA in sender mail adapter
    Thanks,
    Vamsi

    Hi Vamsi,
    your scenario is also described here: Re: sender mail adapter - attachment name
    If you use the Module getAttachmentName, which is described here,
    http://wiki.sdn.sap.com/wiki/display/XI/AdapterModulePI7.0GetAttachmentName
    your scenario should work as you described it.
    You just need to make sure that the Attachment Name that you read in the first place, is mapped to the Filename Attribute of the
    Fileadapter (http://sap.com/xi/XI/System/File/FileName).
    regards,
    Daniel

  • I have to save emails from outlook to my hard drive. When I go to open the email on the HD the attachment is not an attachment anymore. It needs to be. Help?

    My office uses outlook for emails, calendaring, etc. We save as all emails to a specific client related file for easy access and to reduce the items saved in outlook.
    Many of the emails have attachments. I use Firefox (love it) as my browser so when I save as an email it saves it with the Firefox Icon instead of the Outlook Envelope Icon. When I open the email from my computer (not outlook) the attachment name is there but it is not accessible. I have to go to the email in outlook and save the attachment(s) separately in order to access them. I don't want to do that. It takes up to much time and often the attachments are related to the data within the email and they need to be together in their original form.
    If I use Internet Explorer (which I hate) as my browser this does not happen. Can you help me? I really don't want to use IE.
    Thank you.

    I might be able to experiment with this a little.
    Are you running a recent version of Outlook Web App (i.e., Exchange 2010)?
    When you save files using IE, what format are they in (e.g., EML, RTF, HTML)?

  • Dynamic attachment name in receiver mail adapter

    Hi  all,
    i am doing a receiver mail scenario (PI 7.1). my requirement is like this :
    Receiver file need to be send in receiver mail attachment and attachment name should be dynamic
    format for the attachment name should be like this
    R+value from a particular field in payload +Timestamp
    for example my file name should be like this  R001_510815021009062532.xml  
    which is     R+ 001_510815 + 021009062532 + .xml
    can anybody suggest me how to go for this requirement? is ther any UDF or should i go for adapter module developement?
    Thanks
    sandeep sharma
    Edited by: sandeep sharma on Oct 13, 2009 8:55 AM

    Hi K Fatima,
    I read your solution.I have a similar requiement but I need to send the entire output payload as an attachment,so I am using XSLT to send the payload as an attachment.
    I am creating the file name through dynamic configuration in XSLT but the name of attachment is not as required but its any random generated name:
    *code used:*
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:map="java:java.util.Map"
      xmlns:dyn="java:com.sap.aii.mapping.api.DynamicConfiguration"
      xmlns:key="java:com.sap.aii.mapping.api.DynamicConfigurationKey">
    <xsl:output method="xml" version="1.0" encoding="UTF-8" />
    <xsl:output indent="yes" />
    <xsl:param name="inputparam"/>
    <!-- mail parameters -->
    <xsl:template match="*">
    <ns:Mail xmlns:ns="http://sap.com/xi/XI/Mail/30">
    <xsl:variable name="new-value" select="Shipment/InternalShipmentNum"/>
    <Subject>Mail</Subject>
    <From>xyz</From>
    <To>abc</To>
    <xsl:variable name="dynamic-conf" 
            select="map:get($inputparam, 'DynamicConfiguration')" />
        <xsl:variable name="dynamic-key"  
            select="key:create('http://sap.com/xi/XI/System/File', 'Directory')" />
        <xsl:variable name="dynamic-value"
            select="dyn:get($dynamic-conf, $dynamic-key)" />
        <xsl:variable name="new-value"    
            select="concat($dynamic-value, 'subfolder\')" />
        <xsl:variable name="dummy"
            select="dyn:put($dynamic-conf, $dynamic-key, $new-value)" />
    <!--Content type -->
    <Content_Type>application/xml</Content_Type>
    <!Content Description>
    <Content_Disposition>attachment;filename "<xsl:copy-of select="$new-value"/>"</Content_Disposition>
    <!--Content Disposition -->
    <Content_Description><xsl:copy-of select="$new-value"/></Content_Description>
    <Content>
    <xsl:copy-of select=".">
    <xsl:apply-templates/>
    </xsl:copy-of>
    </Content>
    </ns:Mail>
    </xsl:template>
    </xsl:stylesheet>
    Please suggest ! I need the value in "Shipment/InternalShipmentNum" as name of attachment.
    Thanks in advance!
    Indu Khurana

  • How to make multi-box fields for name or address in a PDF form to be filled in?

    I would like to know how to make fields for name and address in a PDF form.
    I am now using Acrobat 8 Pro on Windows Vista. I have downloaded a form in the format of a PDF file. Basically it is just a file holding images of pages of the document, and there are no fields for me to type something on it using computer. This form will be used frequently by me, but I don't want to print it out and fill it in every time by hand. I want to fill it in in the computer and print copies of it when needed. The output will then be much more neat and tidy.
    I have seen PDF forms with blanks for typing name and address, which means the form can be filled in on the computer before printing. They are special, as these blanks allow users to type name and address with every character occupying a box in the field, which consists of ten boxes or so. These are not ordinary textfields. I want to make similar inputting field as well.
    Does anyone knows something about making these input fields with each character using 1 little box in the multi-box field? Any ideas are appreciated.

    Does anyone knows something about making these input fields with each
    character using 1 little box in the multi-box field?
    Use text fields with the comb of x characters feature.

  • Setting dynamic attachment name in mail adapter

    Hi experts,
    I have a mail adapter that send e-mails from ECC to several address.
    I have configured dynamically the FROM and TO field using the code showed below in message mapping:
    public String SetMailParameters(String Mail_address_to, Container container){
       //write your code here
      String valueFrom = "my_address";
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key1 = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/Mail",  "THeaderFROM");
    DynamicConfigurationKey key2 = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/Mail",  "THeaderTO");
    conf.put(key1, valueFrom);
    conf.put(key2, Mail_address_to);
      return  "";
    In communication channel I have checked ASMA and variable transport binding (using XHeaderName1 and 2), mail package is not checked.
    It works fine!
    My question is:
    I need to dynamically configure also the Attachment name: is it possible?
    I've tried adding the code below:
    DynamicConfigurationKey key3 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    conf.put(key3,Attachment_name);
    and also
    Transform.ContentDisposition      attachment;filename=<FileName>
    in Message TransformBean in communication channel, but it doesn't work!!!
    Any idea?
    Thanks
    Fabio Boni

    Hi,
    thanks a lot!!
    ASMA and variable transport binding must be checked or not?
    it raise an error in runtime workbench message monitoring:
    2010-09-02 17:41:15 Success Mail: calling the adpter for processing
    2010-09-02 17:41:15 Error Mail: call failed; com.sap.aii.messaging.util.XMLScanException: expecting end tag: Mail, but found {'}Content_Disposition at state 1
    2010-09-02 17:41:15 Success Mail: sending a delivery error ack ...
    2010-09-02 17:41:15 Success Mail: sent a delivery error ack
    2010-09-02 17:41:15 Error Mail: error occured: com.sap.aii.af.ra.ms.api.RecoverableException: com.sap.aii.messaging.util.XMLScanException: expecting end tag: Mail, but found {'}Content_Disposition at state 1
    2010-09-02 17:41:15 Error MP: Exception caught with cause com.sap.aii.af.ra.ms.api.RecoverableException: com.sap.aii.messaging.util.XMLScanException: expecting end tag: Mail, but found {}Content_Disposition at state 1
    2010-09-02 17:41:15 Error Exception caught by adapter framework: com.sap.aii.messaging.util.XMLScanException: expecting end tag: Mail, but found {}Content_Disposition at state 1
    2010-09-02 17:41:15 Error Delivery of the message to the application using connection Mail_http://sap.com/xi/XI/System failed, due to: com.sap.aii.af.ra.ms.api.RecoverableException: com.sap.aii.messaging.util.XMLScanException: expecting end tag: Mail, but found {}Content_Disposition at state 1.
    This is my message in message monitoring:
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns1:Mail xmlns:ns1="http://sap.com/xi/XI/Mail/30">
      <Content_Disposition>"attachment; filename="MyFileName.txt"</Content_Disposition>
      <Content>ZLF;0001000079;Dealer Motors UK</Content>
      </ns1:Mail>
    In message mapping with target message mail package I've linked Content_Disposition with the constant
    "attachment; filename="MyFileName.txt"
    If I cancel this relation the mail arrives correctly.
    One other thing: when I took mail.xsd from SAP the fields Content_Disposition and Content_Description weren't in, so I added them manually in XSD.
    thanks
    Edited by: Fabio Boni on Sep 2, 2010 5:42 PM
    Edited by: Fabio Boni on Sep 2, 2010 6:06 PM

  • 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

Maybe you are looking for

  • Says it needs an update, but says it's up to date...makes no sense!

    First of all, why does the new version of Garageband seem to have less options in the software instrument section? Also, any time I go to look at the loops, they aren't accessible, you can see the "ghost" versions of them, and if you click on them it

  • How to build project in xcode 4.2(build it but not run it)

    i just want to build the project and see if it has errors and don't want to run it yet, this was possible with xcode 3.x  

  • Wireless keyboard connected but can't type in password

    I updated from an iOS 10.8 to 10.9 recently after my hard drive crashed and had to get replaced. I have connected the wireless keyboard connected but I can't type in certain key letters. I can only type in numbers and the middle set of letters. The o

  • Dell u3014 connected to MBP, now what? (options and settings)

    Today I unboxed my new Dell U3014 and connected it to my notebook. At first glance, I'm quite satisfied. No problems as such. I have a working connection between my MacBook Pro (13", mid-2009, Yosemite) and new Dell u3014. A few specific questions: H

  • ALV ABAP PROGRAM

    Hi, We have encountered a problem running this program in different corporate laptops.  Using the same users ID, we execute this program in different Laptops, there we've seen the problem, one of these laptops shows result of this particular report h