Separate IDOC-Types by mail adapter

hello together,
i have the following problem.
a customer sends an order by mail to us. over mail adapter this message goes to the SAP system. the mail-subject contains description where we can separate the single message. this single messages are all from the same idoctype we have defined in the mail adapter:
shippd, order, stock .... => SPCORD-idoctype
and now the problem. the customer want / have to so send an invoiceack (an other idoctype- SPCINV)!!
summary: we have TWO idoctypes but only ONE possibility to   specify the idoctype in the mailadapter, haven't we?
we just one mailbox where all messages from the customer come into.
what can we do? is there another solution / possibility to solve the problem?
thanks a lot
bye alex

Hi,
My connection is working now when I downloaded the xsd and executed in the mapping as described in the blog.
/people/michal.krawczyk2/blog/2005/03/07/mail-adapter-xi--how-to-implement-dynamic-mail-address
Connection is working fine now, but im getting the below payload.
  <?xml version="1.0" encoding="UTF-8" ?>
- <ns1:Mail xmlns:ns1="http://sap.com/xi/XI/Mail/30">
  <Subject>TESTING</Subject>
  <From>deepthi at testing.com</From>
  <To>deepthi at testing.com</To>
  <Content>Testing purpose</Content>
  </ns1:Mail>
The question is how to get my actual message which looks like below. this is the Idoc to file map and the resultant output file looks like below
<?xml version="1.0" encoding="UTF-8"?>
<ns0:order xmlns:ns0="http://testing/xi/OrderProcessing">
     <document_type>ZU</document_type>
     <vendor_number>200000</vendor_number>
     <vendor_email_address/>
     <vendor_address_line_1>XXXXXX</vendor_address_line_1>
     <vendor_address_line_2>XXXXXXXXX</vendor_address_line_2>
     <vendor_address_line_3>123242343244566</vendor_address_line_3>
     <vendor_address_line_4>US</vendor_address_line_4>
     <delivery_address_line_1>1433</delivery_address_line_1>
     <delivery_address_line_2>test</delivery_address_line_2>
</ns0:order>
How to send this file as email attachment using mail adapter. Do I need to use 2 maps?
looks like Mail adapter is working only when we use the xsd which is given above and by providing the required details.
Kindly help me if anyone worked on mail adapters.
Thanks
Deepthi,

Similar Messages

  • Data type for mail adapter

    HI
    what type of data will come to mail ??
    or
    which type of data type we should you for Mail adapter ??
    Regards
    Kumar

    Below link would address your doubts on mail adapters.
    Mail Adapter

  • Mail adapter scenario

    Hi 
    I require some input on including a mail adapter to an existing scenario
    The scenarios is as follows,
    I have to create some files around 20 and place them in two folders , that build has been done and tested , so I have a multi mapping , for those 20 files , and enhanced interface determination and is working fine
    Now a new requirement is to send an email ,
    kindly  tell me the steps in IR and ID to include the mail adapter in this interface ??
    considering it as an additional feature, nthing to do with Files ,,,
    which means that an email adapter has to be called with the file adapters ( not before not after....the precedence doesnt matter )
    its just that along with creating the files an email has to be sent ... thats all
    I want to know what am i required to create :
    in IR : is there a separate interface required .. smthing to do in mapping also ? i am presuming not since it is inbound
    in ID  : can i create a dummy busines service  and what all do i need to create ???
    please help
    thanks
    Dev

    Hi,
    You create a message type for mail adapter and an message interface. You can also use the predefined message type from sap. So now in multimapping you add this message type and map from your source to this mail mapping. Add the same message interface in interface mapping.
    Create a mail receiver communicaiton channel with your mailbox parameters. Then add this to your receiver determination. Also you need to create a receiver agreement for this one.
    You can see some help here:
    /people/prasad.ulagappan2/blog/2005/06/07/mail-adapter-scenarios-150-sap-exchange-infrastructure
    You can do a search for more blogs and tutorials on mail adapter.
    Regards,
    ---Satish

  • Multiple message types for an idoc type

    Hi all,
    I created one custom idoc type with six segments. I heard that one idoc type can have any number of message types
    if it is so pls tell me how to assign these two message types for my idoc .
    i want to create multiple message types because i want to send same idoc type to diff legacy systems.
    My requirement is message type one is only for first three segments and message type two is for another three segments .
    The outbound program 1 for mess type 1 should fill fill the data for only first three segments and second outbound program corresponding to mess type 2 should fill the data for last three segments
    how should i design for my requirement. suppose if the idoc has two message types then it has two outbound programs?

    Hi Kunal,
    Below are my thoughts from a design perspective,
    My requirement is message type one is only for first three segments and message type two is for another three segments .
    The outbound program 1 for mess type 1 should fill fill the data for only first three segments and second outbound program corresponding to mess type 2 should fill the data for last three segments
    Before you look upon the no. of message types you need, i guess you need to look at the business requirement. Per your requirement you want to send send two sub sets of data. The first subset in the first 3 segments and other three segments for the second subset of data.
    Is the structure of the first subset of data similar to the second subset If not, better to create two IDOC Types. If they are similar, then create one IDOC Type with three segments and have two message types for each subset of data.
    For Ex: ORDERS05 is the IDOC type for Orders, this IDOC type provides capability to carry data related to any type of orders
    but the action on the data is facilitated by the message type like ORDERS for create, ORDCHG for change, ORDRSP for Order response etc.
    OR
    Are these two subsets of data related to each other, if yes understand the relation? If not related at all then you might be better of creating two separate IDOC Types.
    Like in the above example A purchase order is related to a sales order so you can use the same IDOC type, but in case of a order response and ASN that data sent is different and hence you will need different IDOC types (even though a SO is related to a DN).
    how should i design for my requirement. suppose if the idoc has two message types then it has two outbound programs?
    The above again depends on the how tightly/loosely coupled are the data sets, you can have just one program and have a simple case statement on the message types or have two different programs.
    You will also have to consider points like, if any of the subsets is more prone to more change in terms of the structure and associated business logic. If yes, then you might want to keep the programs separate to reduce work on regression testing etc.
    I am sure you will receive more inputs from the experts on the forum and the list of points to look for will get longer , so understand the requirement, dependencies and if you have any specific questions you could post it on the forum.
    Regards,
    Chen

  • Separate valid mail attachment in sender mail adapter

    Hi Experts,
    I am working on Mail -> RFC scenario in pi 7.3.
    Our channel is able to process new mail having valid attachement (i.e. .xml) file.
    But sometime attachment contain invalid format also like pdf, or .txt file with valid attachment.
    With these types of mail, channel throw error and do not process it. But my requirement is to separate the valid attachment and process it and delete it from mail box.
    What our channel is doing is it skips these kind of mails and only change the status from unread to read.
    Regards
    Jitender

    Hi Jean ,
    I got the same issue too, the Scenario is MAIL ->FILE . Mail Sender Adapter picks up the 1 PDF attachment and saves in network folder successfully but not multiple attachments of a  mail.
    These are the setting in Module configuration I made:
    1. The IMAPS was used in Mail Sender Adapter : imaps://10.192.101.16:993/Inbox
    *IP address of the Mail Server was got from the Admin )
    2. Ports : 143, 993 are opened for the Mail Server to access for XI SERver ( Raised an Ticket to open Ports of Mail server :NZTxxx.dknz.nzcorp.net)
    3. As the attachment was only in PDF : Added swapbean in Module tab as below :
    Process Sequesnce :
    -Make sure: AF_Modules/PayloadSwapBean Modul key : TRANSFORM is added before sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean
    -And under Module Configuration select : TRANSFORM as Module Key and add >
    swap.keyName Content-Disposition
    swap.keyName Content-Description
    swap.keyValue attachment;filename='MailAttachment-1.pdf"
    swap.keyValue MailAttachment-1
    -IF you get to know how to fetch multiple attachment , Please update.
    Thanks,
    Vara

  • How to change content-type in receiver mail adapter

    Hi,
    I have receiver mail adapter for sending XML file as attachment in the mail. My partner expects to receive mail with content-type: text/xml, but XI sends Content-Type: application/xml. Please advise how I can change content-type to text/xml.
    Thank you
    Lev

    hi,
    try MessageTransformBean
    Transform.ContentType
    http://help.sap.com/saphelp_nw04/helpdata/en/57/0b2c4142aef623e10000000a155106/content.htm
    also shown in my blog:
    /people/michal.krawczyk2/blog/2005/11/23/xi-html-e-mails-from-the-receiver-mail-adapter
    Regards,
    michal
    <a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

  • I have a scenario. Import IDOC into PI and PI transform IDOC to Excel. Using mail adapter attach that Excel using pi and send to customer. Can you please help me on the same?

    HI Experts,
    I have a scenario. Import IDOC into PI and PI transform IDOC to Excel. Using mail adapter attach that Excel using pi and send to vendor. Can you please help me on the same?
    Thanks
    SaiSreevastav

    Hi Sai,
    you can use XSLT or java mapping or adapter module to convert IDOC xml to XLS. Please refer the below blog
    Convert incoming XML to Excel or Excel XML – Part 1 - XSLT Way
    Convert incoming XML to Excel Sheet Part 2 – Adapter Module way
    Convert incoming XML to Excel Sheet
    then after converting to Excel, you can use the payloadswap bean in mail adapter
    XI: Sender mail adapter - PayloadSwapBean - Step by step
    regards,
    Harish

  • XI and IDOC-Adapter / Restriction to certain IDOC Types?

    Hi all!
    We have some problems in trying to enable our XI systems for using our central user administration. The reason for that is that the "USERCLONE", ... IDOCs sent to XI by the CUA system are not processed normally in the ALE Layer but XI tries to process it through it's IDOC Adapter hence wants to route the IDOCs through the Integration Engine.
    Is there a way to define the IDOC-Types to be processed by the IDOC-Adapter and to <b>exclude certain IDOC types</b> such that those are processed via standard ALE?
    Many thanks in advance for any input you can give ...
    Andy

    Hi all!
    For those who are interested - we have found the solution for this problem using some debugging
    There is an "excemption table" where you can define required IDOC Types that should be processed via the normal ALE layer (instead of routing it through the IE).
    To maintain the table entries you have to use report
    <b>"IDX_SELECT_IDOCTYP_WITHOUT_IS"</b>.
    However - if you want to get rid of entries already made
    with this report just have a look at note <b>"790175"</b>
    Best regards,
    Andy

  • Change IDoc type used for XIF adapter

    Hi,
    I am using IDOC ZCRMXIF_PARTNER_SAVE_M01 to send data from XI to CRM. It is a generated IDOC from transaction BDFG for XIF adapter. I need to change a segment max value from 1 to 5 in order to send multiple segments. Can you please advise that from where this structure can be change so I can generate the IDoc again. Any suggestions would be appreciated.
    Thanks in advance !
    Regards,
    Faiq

    Hi Amit,
    I tried that but as the IDoc is generated from BDFG so it cannot be changed from here. BDFG gives:
    message type, Idoc type, Function module, Function group. Later generates the IDoc from them. I am not sure that in which of the above steps it lets me change. Do I have to make change in the function module.
    Thanks in advance.
    Regards,
    Faiq

  • Receiver Mail adapter Content type issue

    Hello,
    I am formatting the body of the receiver mail. The body of the email  should look like below.
    Dear PI User,
    The following Interface has been successfully processed by the middleware PI system.
    Please do not reply to this email. If you need more information please contact the Super User.
    Regards,
    SAP PI Team
    The mapping looks fine and My source MT looks like this:
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns1:MT_Mail_Reply xmlns:ns1="http://test.com/Mail/Reply"> 
    - <Reply>  [0..unbounded] 
    - <Item> [0..unbounded] 
    <MESSAGE>Dear Business User, </MESSAGE>   [0..1] 
    /Item>
    - <Item> 
    <MESSAGE>The following Interface has been successfully processed by the middleware PI system.</MESSAGE> [0..1]
    </Item>
    - <Item> 
    <MESSAGE>Please do not reply to this email. If you need more information please contact the Super User.</MESSAGE> [0..1]
    </Item>
    - <Item>
    <MESSAGE>Regards,</MESSAGE> [0..1] 
    </Item>
    - <Item>
    <MESSAGE>SAP PI Team </MESSAGE>  [0..1]
    </Item>
    </Reply>
    </ns1:MT_Mail_Reply>
    The mapping works fine without errors and I get the target message as below after mapping-
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns1:Mail xmlns:ns1="http://sap.com/xi/XI/Mail/30"> 
    <Subject>ISAP PI Interface Status</Subject> 
    <From>[email protected]</From> 
    <To>[email protected]</To> 
    <Content>Dear Business User</Content> 
    <Content>The following Interface has been successfully processed by the middleware PI system.</Content> 
    <Content>Please do not reply to this email. If you need more information please contact the Super User</Content>
      <Content>Regards,</Content>
      <Content>SAP PI Team</Content>
    </ns1:Mail>
    t
    The context of MESSAGE has been changed to Reply.
    In the adapter I still get the following error.       
    Delivery of the message to the application using connection Mail_http://sap.com/xi/XI/System failed, due to: com.sap.engine.interfaces.messaging.api.exception.MessagingException: com.sap.aii.af.sdk.xi.srt.BubbleException: Failed to call the endpoint  [null "null"]; nested exception caused by: com.sap.aii.af.sdk.xi.util.XMLScanException: expecting end tag: {http://sap.com/xi/XI/Mail/30}Mail, but found {}Content at state 1
    Please advise !!
    Thanks,
    Teresa
    **I changed the receiver mail adapter to not use Mail package and I receive an email without errors with the Content as mentioned above. **

    Hi Teresa,
    I think the problem is that you are using multiple "Content" tags. Have you tried to use only one?, you can concatenate all your text.
    Check the page 3 of this document to know how introduce new-line character http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d0964d7c-e66e-2910-24bb-ac535e4a5992?overridelayout=t…
    Regards.

  • Error when using Variable Transport Binding in Sender Mail Adapter

    Hi,
    I am using the Sender Mail Adapter to receive an email, convert the attached tab delimited text file into xml and map it to an IDOC.
    I am using PayloadSwapBean and MessageTransformBean in order to do this, and this all works perfectly.
    I am now trying to access the Adapter Specific Message Attributes to retrieve the SHeaderFROM attribute from the message and map it to a field in the idoc.
    However when I check the "Variable Transport Binding" option in the Advanced tab of the mail adapter, the message no longer goes through to SXMB_MONI and I get the following error in the Java logs.
    Transmitting the message to endpoint http://sapserver:53500/sap/xi/engine?type=entry using connection AFW failed, due to: com.sap.engine.interfaces.messaging.api.exception.MessagingException: Received HTTP response code 500 : Error during parsing of SOAP header.
    Any ideas why this is happening?
    Thanks,
    Brad

    Hi Luciana,
    Honestly, I cant really remember how or if it was resolved and I was just helping out on the issue, but another consultant continued with it, so unfortunately I cant be any help on this.
    Good luck!
    Cheers,
    Brad

  • Different Attachment extension(.xls,.txt) in sender mail adapter

    Hi Experts
    Is it possible to use different type of attachment extension (e.g .xls,.txt) in the sender mail adapter?
    My requirement is , the attachment in the mail adapter will be used as the main payload.So I am using PayloadSwapBean adapter module.
    Currently I am using the following module key for .xls attachment and it is working.Configuration for .xls attachment is as follows
    swap.keyName-Content-Disposition
    swap.keyname-Content-Description
    swap.keyName-Content-Type
    swap.keyValue-attachment;filename="MailAttachment-1.xls"
    swap.keyValue-MailAttachment-1
    swap.keyValue-application/vnd.ms-excel.
    Now, the attachment may be .xls or .txt file.
    Now If I want to use .txt atachment then do I need to define all these parameter again and in that case what will be my content type for .txt file.
    Your inputs required
    thanks
    Ayan

    PayloadSwapBean  will only convert the attachment as the main payload.
    Yeah for reading excel file I have a separate custom adapter module.This is not in the scope of my question..
    All I am asking , can .txt as well as .xls attachment be used in the same sender mail adapter.
    If that is possible what will be my content-type for .txt or can I remove content-type and use only content-disposition and content-description so that any type of attachment it can recognise.
    The momment I am specifying  content-type , I am making it particular  that only say .xls attachment , it will identify.
    I hope I make you clear.Inputs required
    Thanks
    Ayan

  • Receiver Mail Adapter - Body and Attachment

    Hello All,
    Based on the document How to Use the Mail Adapter of the XI 3.0 J2EE Adapter Engine section 3.2.4 says that the payload of the message is sent as the body and an attachment when the Keep Attachments checkbox is configured. By default, the payload of the message is also sent as an attachment.
    In testing this feature - if it is checked I get the attachment - if it is not checked I get the payload in the body of the email.  I do not get both.
    I am using an xslt mapping.
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0" xmlns:ns0="urn:sap-com:document:sap:rfc:functions" xmlns:ns="http://sap.com/xi/XI/Mail/30">
         <xsl:output method="xml" encoding="utf-8" indent="no" omit-xml-declaration="yes"/>
         <xsl:template match="/">
              <xsl:apply-templates select="ORDERS02"/>
         </xsl:template>
         <xsl:template match="ORDERS02">
              <ns:Mail>
                   <Subject>
                        <xsl:text>Sample Purchase Order: </xsl:text>
                        <xsl:value-of select="IDOC/E1EDK01/BELNR"/>
                   </Subject>
                   <From>
                        <xsl:text>mail@Com</xsl:text>
                   </From>
                   <To>
                        <xsl:text>mail@com</xsl:text>
                   </To>
                   <Content_Type>text/plain; charset="ISO-8859-1"</Content_Type>
                   <Content_Disposition>attachment; filename="order.dc"</Content_Disposition>
                   <Content>
                        <xsl:text> </xsl:text>
                        <xsl:value-of select="IDOC/E1EDK01/BELNR"/>
                        <xsl:text>A </xsl:text>
                        <xsl:text>ORD 238            </xsl:text>
                                            <xsl:text>
    </xsl:text>
                        <xsl:apply-templates select="IDOC/E1EDP01"/>
                        <xsl:text> </xsl:text>
                   </Content>
              </ns:Mail>
         </xsl:template>
         <xsl:template match="IDOC/E1EDP01">
              <xsl:value-of select="concat(' ',/ORDERS02/IDOC/E1EDK01/BELNR)"/>
              <xsl:text>Z</xsl:text>
              <xsl:value-of select="substring(concat(E1EDP19[QUALF=002]/IDTNR,'       '),1,7)"/>
              <xsl:value-of select="format-number(number(MENGE),'00000')"/>
              <xsl:text>                </xsl:text>
              <xsl:text>
    </xsl:text>
         </xsl:template>
    </xsl:stylesheet>

    Thank you so much for your patience.  The mapping works if I do not use the extra content_type tags.  Do I need to include the Mime-Version: 1.0....also, notice the
      <Content_Type>multipart/mixed; boundary="b1"</Content_Type>
    Versus
    <Content>--b12 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit My Order --b1
    Your example shows use of  Content-Type - and the XSLT sample shows <Content_Type> Do you know what the correct format is to use?.
    I changed my xsl per your instructions.
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
         <xsl:output method="xml" encoding="utf-8" indent="yes" omit-xml-declaration="yes"/>
         <xsl:template match="/">
              <xsl:apply-templates select="ORDERS02"/>
         </xsl:template>
         <xsl:template match="ORDERS02">
              <ns:Mail xmlns:ns="http://sap.com/xi/XI/Mail/30">
                   <Subject>
                        <xsl:text>Purchase Order: </xsl:text>
                   </Subject>
                   <From>
                        <xsl:text>mail@com</xsl:text>
                   </From>
                   <To>
                        <xsl:text>mail@com</xsl:text>
                   </To>
                   <Content_Type>
                        <xsl:text>multipart/mixed; boundary="b1"</xsl:text>
                   </Content_Type>
                   <Content><xsl:text>--b12
    </xsl:text>
                   <xsl:text>
    </xsl:text>
                   <xsl:text>Content-Type: text/plain; charset=us-ascii </xsl:text>
                   <xsl:text>
    </xsl:text>
                   <xsl:text>Content-Transfer-Encoding: 7bit </xsl:text>
                   <xsl:text>
    </xsl:text>
                   <xsl:text>My Order</xsl:text>
                   <xsl:text>
    </xsl:text>
                   <xsl:text>--b1</xsl:text>
                   <xsl:text>
    </xsl:text>
                   <xsl:text>Content-Type: text/plain; charset=us-ascii</xsl:text>
                   <xsl:text>
    </xsl:text>
                   <xsl:text>Content-Transfer-Encoding: 7bit</xsl:text>
                   <xsl:text>
    </xsl:text>
                   <xsl:text>Content-Disposition: attachment; filename="order.dc"</xsl:text>
                   <xsl:text>
    </xsl:text>
                        <xsl:text> </xsl:text>
                        <xsl:value-of select="IDOC/E1EDK01/BELNR"/>
                        <xsl:text>A </xsl:text>
                        <xsl:text>ORD 238            </xsl:text>
                        <xsl:text>
    </xsl:text>
                        <xsl:text> </xsl:text>
                        <xsl:value-of select="IDOC/E1EDK01/BELNR"/>
                        <xsl:text>B</xsl:text>
                        <xsl:text>The Wolf Organization        </xsl:text>
                        <xsl:text>
    </xsl:text>
                        <xsl:text> </xsl:text>
                        <xsl:value-of select="IDOC/E1EDK01/BELNR"/>
                        <xsl:text>C</xsl:text>
                        <xsl:text>PO Box 2044                  </xsl:text>
                        <xsl:text>
    </xsl:text>
                        <xsl:text> </xsl:text>
                        <xsl:text>D</xsl:text>
                        <xsl:text>York, PA  17404-2044         </xsl:text>
                        <xsl:text>
    </xsl:text>
                        <xsl:text> </xsl:text>
                        <xsl:value-of select="IDOC/E1EDK01/BELNR"/>
                        <xsl:text>E</xsl:text>
                        <xsl:text>
    </xsl:text>
                        <xsl:text> </xsl:text>
                        <xsl:value-of select="IDOC/E1EDK01/BELNR"/>
                        <xsl:text>F</xsl:text>
                        <xsl:text>
    </xsl:text>
                        <xsl:text> </xsl:text>
                        <xsl:value-of select="IDOC/E1EDK01/BELNR"/>
                        <xsl:text>G</xsl:text>
                        <xsl:text>
    </xsl:text>
                        <xsl:apply-templates select="IDOC/E1EDP01"/>
                        <xsl:text> </xsl:text>
                   </Content>
                   <xsl:text>--b1--</xsl:text>
              </ns:Mail>
         </xsl:template>
         <xsl:template match="IDOC/E1EDP01">
              <xsl:text>Z</xsl:text>
              <xsl:text>                </xsl:text>
              <xsl:text>
    </xsl:text>
         </xsl:template>
    </xsl:stylesheet>
    Now my results look like this:
    - <ns:Mail xmlns:ns="http://sap.com/xi/XI/Mail/30">
      <Subject>Purchase Order:</Subject>
      <From>mail@com</From>
      <To>mail@com</To>
      <Content_Type>multipart/mixed; boundary="b1"</Content_Type>
      <Content>--b12 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit My Order --b1 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="order.dc" 4500000185A ORD 238 4500000185BThe Wolf Organization 4500000185CPO Box 2044 DYork, PA 17404-2044 4500000185E 4500000185F 4500000185G Z Z</Content>
      --b1--
      </ns:Mail>
    And the error is still:
    Following error occurred while executing the application:
      java.lang.IllegalArgumentException: can't parse argument number http://sap.com/xi/XI/Mail/30
    Display Stack Trace
    Stack trace for the above error message is:
    java.lang.IllegalArgumentException: can't parse argument number http://sap.com/xi/XI/Mail/30
         at java.text.MessageFormat.makeFormat(MessageFormat.java:1323)
         at java.text.MessageFormat.applyPattern(MessageFormat.java:447)
         at java.text.MessageFormat.(MessageFormat.java:347)
         at java.text.MessageFormat.format(MessageFormat.java:800)
         at jsp_auditlog1160053386093._jspService(jsp_auditlog1160053386093.java:274)
         at com.sap.engine.services.servlets_jsp.server.jsp.JspBase.service(JspBase.java:112)
         at com.sap.engine.services.servlets_jsp.server.servlet.JSPServlet.service(JSPServlet.java:544)
         at com.sap.engine.services.servlets_jsp.server.servlet.JSPServlet.service(JSPServlet.java:186)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.runtime.RequestDispatcherImpl.doWork(RequestDispatcherImpl.java:316)
         at com.sap.engine.services.servlets_jsp.server.runtime.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:372)
         at com.sapportals.htmlb.page.PageProcessorServlet.handleRequest(PageProcessorServlet.java:68)
         at com.sapportals.htmlb.page.PageProcessorServlet.doGet(PageProcessorServlet.java:29)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:390)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:264)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:347)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:325)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:887)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:241)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)

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

  • Content Field issue in Mail adapter receiver

    My  inerface CIDX->TO-->IDOC:
    I have an Error handling logic (Busines error) which needs to be send in EMail....the to address has to be detemined in runtime, the mail content is in the following format
    Mail Content:
    A KB order type came in from:
    Partner Information:
             Partner Name.
             Darex
             Chicago  IL 60638
             US
    ///below data till end  is for single line item, will occur twice if 2 line item
    PO Number       : 45012529631
    PO Line No       : 1
    Customer Product Code : YYYYYYY
    Customer Product Name : XXXXXXXXXX
    Price                    : 12345
    You should verify the PO is updated in the hosted solution and that the price is correct in SAP.  If this isn't the correct price from our partner please contact them and verify what the correct price should be.. 
    I am able to send the above content in mail for line item is 1, if there are more than 1 lineitem then it is breaking as mail content size is huge
    If there are Multiple Line items present in the Incoming CIDX file then the number od line items should be disaplayed in the mail. all the lines POLine NO till end will repeate for each Line Item....i am getting the arrayindex out of memeory exception as the data is huge which i am mapping to the content field of the reciver mail adapter....
    kindly suggest me the better method to handle this situation..my worry is if the number of line item is 10 then the mail content will be very huge and it will break during the runtime, as that field content cannot take so huge data.

    Hi Kiran
    Then there is no need to use Transformation bean for this
    In Mapping map the mail package Content_type field with
    text/plain;name="xyz.csv"
    and select mail package and keep attachments in receiver mail adapter
    This will work
    Thanks
    Gaurav

Maybe you are looking for

  • How do I get my contacts back after they've disappeared? the contacts are still stored in my phone

    how do I get my contacts back after they've disappeared? the contacts are still stored in my phone I just can't access them through my address book; only through Siri. I've restored my phone & that didn't work so what should I do?

  • Plz Help Meeeeeeeeeee!!!!!!! Sata Disappear

    Ok i have 2 SATA  SEAGATE BARRACUDA 8MB  120 GIGAS one was on array 1 and the other one on array 2  c: and d: respectively suddenly  the 2nd one disappear it HAS ALL MY INFORMATION AND FILES !!!!!!!!!! EXTREMELY URGENT PLZ HELP MEEEEEEEEEEEE!!!!  how

  • Wrt54gs connectivity?????

    So here is the story, Ive just purchased the said router, I have installed in my house which currently has 3 computers, 2 are upstairs and 1 downstairs. The router is upstairs on my main comp, the 2 others are using wired connectivity, now the 2 comp

  • Remote Role Assignments - Different User Base

    Hi Federation gurus, I am working on a federated portal network and my consumer's UME is connected to the corporate LDAP (i.e. AD). All the producers (BI, SRM and ECC) have their UMEs connected to the ABAP system (i.e. CUA). The user ids are identica

  • ORA-00600 内部错误代码,参数:[kpncxcc-3]

    OS WONDOWS2008 64位 数据库版本 11.1.0.7.0 - 64bit 数据库警告日志 Mon Nov 26 11:03:45 2012 ORA-00020: No more process state objects available ORA-20 errors will not be written to the alert log for the next minute. Please look at trace files to see all the ORA-20 e