SAP PI: Using Variable Header Binding in Receiver Mail Adapter
Hello,
I try to use Variable Header Bindings in the Receiver Mail Adapter. Therefore I wrote the following User-Defined-Function in a mapping:
Java Function Start -
DynamicConfiguration conf = (DynamicConfiguration) container
.getTransformationParameters()
.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key1 = DynamicConfigurationKey.create(
"http://sap.com/xi/XI/System/Mail",
"XHeaderName1");
DynamicConfigurationKey key2 = DynamicConfigurationKey.create(
"http://sap.com/xi/XI/System/Mail",
"XHeaderName2");
DynamicConfigurationKey key3 = DynamicConfigurationKey.create(
"http://sap.com/xi/XI/System/Mail",
"XHeaderName3");
conf.put(key1, new String("Test1"));
conf.put(key2, new String("Test2"));
conf.put(key3, new String("Test3"));
Java Function End -
As expected I see the Attributes and Parameters in the Dynamic Configuration in the SAP XI Monitor:
Dynamic Configuration Informattion Start -
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
- <!-- Mapping der Request-Message
-->
- <SAP:DynamicConfiguration xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">
<SAP:Record namespace="http://sap.com/xi/XI/System/Mail" name="XHeaderName3">Test3</SAP:Record>
<SAP:Record namespace="http://sap.com/xi/XI/System/Mail" name="XHeaderName2">Test2</SAP:Record>
<SAP:Record namespace="http://sap.com/xi/XI/System/Mail" name="XHeaderName1">Test1</SAP:Record>
</SAP:DynamicConfiguration>
Dynamic Configuration Informattion End -
Now I configure my Receiver eMail Communication Channel and set the Variable Header Fields as follows:
Adapter Specific Attributes: Checked
Variable Transport Binding: Checked
Variable Header (XHeaderName1): TSender
Variable Header (XHeaderName2): TReceiver
Variable Header (XHeaderName3): TOther
With this configuration I would have expected three new Header fields in the Header of the eMail, the reicever gets. But they are not there.
When I set standard attributes like THeaderTO, THeaderSubject a.s.o this works fine and the values are also set accordingly. Where it the mistake here?
The PI version we are working with is PI 7.0 SP10.
Your help will be highly appreciated.
Thank you,
Steffen
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
Similar Messages
-
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,
BradHi 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 -
How to use XML Anonymizer Module for receiver mail Adapter?
Hi All,
I would like to know how to use XML Anonymizer Module for receiver mail adapter so as to change the namespace to http://sap.com/xi/XI/Mail/30 from my original namespace? Thank you all in advance?Hi,
This may help u:
Replacing one namespace with another using XML Anonymizer Module
Thanks
Amit -
How to set "Cc" field in Dynamic Email address in Receiver Mail adapter
I have done the configuration for setting up the dynamic email address using the XSD provided by SAP in note no 748024. It is working fine.
Michal's blog Mail Adapter (XI) - how to implement dynamic mail address. was a gr8 help in doing this.
But there is no clue of setting up of "CC" in email.
There should be "CC" in email is our bussiness requirement.
Would appreciate your helps.
with regards,
Ravi SiddamHi,
If you do not need mail package for other reasons, I suppose it is enough to provide a value in Dynamic Configuration for fields "THeaderTO" and "THeaderCC" and the select "Use Adapter-Specific Message Attributes" and "Variable Transport Binding" in receiver Mail Adapter.
see <a href="http://help.sap.com/saphelp_nw04/helpdata/en/6b/4493404f673028e10000000a1550b0/frameset.htm">SAP help</a> for more details.
Regards,
Daniele -
Receiver Mail Adapter - Mail body as attachment
Hello friends,
I have scenario = File -> XI -> Mail
The scenario is working but the problem is body of the email is coming as attachment in the mail client.(outlook express)
Is there any way to avoid the body coming as attachment.
Regards
Ramesh PHi Ramesh,
You can use the MessageTransformBean in the receiver mail adapter for this.
Refer this for the parameters which you can use
http://help.sap.com/saphelp_nw04/helpdata/en/57/0b2c4142aef623e10000000a155106/content.htm
Regards,
Chandra -
Cc header in the triggered mail using receiver mail adapter
Hi,
How can we have cc option in the triggered mail using receiver mail adapter.
message protocol is XI payload with mail package.
thanks,
Ramya ShenoyHi !
Check this link:
http://help.sap.com/saphelp_nw04s/helpdata/en/6b/4493404f673028e10000000a1550b0/frameset.htm
under the title:
"Mail Attributes for Message Protocol XIPAYLOAD"
Regards,
Matias
ps:please award points if helpful. -
How to send mails to "CC" and "BCC" using receiver mail adapter dynamically
Hi,
Due to business requirement PI need to send mails dynamically to u201CCCu201D and u201CBCCu201D using receiver mail adapter.
We have an option to send mails to u201CTou201D dynamically, but are there any option to send mails u201CCCu201D and u201CBCCu201D dynamically.
Please some help to resolve the issue. Thanks
Regards,
Sreeramulu Konjeti.Hi Sreeramulu,
As mentioned by Lucas, you can use the UDF. Inn addition to that, you need to define the Variable Headers under Variable transport binding after enabling the Adapter Specific Message Attributes.
For the Enabling ASMA, follow the below steps and check for the variable attributes.
Select the Advanced tab page.
To save adapter-specific attributes in the message header of the XI message, select Use Adapter-Specific Message Attributes and Variable Transport Binding.
The following attributes in the message header are then available for processing:
○ User: (technical name: TServerLocation)
○ Authentication key: (technical name: TAuthKey)
The following mail header fields are available for processing:
○ From: (technical name: THeaderFROM)
○ To: (technical name: THeaderTO)
○ Cc: (technical name: THeaderCC)
○ Bcc: (technical name: THeaderBCC)
○ Subject: (technical name: THeaderSUBJECT)
○ Reference to the mail that is to be replied to: (technical name: THeaderIN-REPLY-TO)
○ Reply to: (technical name: THeaderREPLY-TO)
○ Mail client program: (technical name: THeaderX-MAILER)
○ Send confirmation of receipt: (technical name: THeaderDISPOSITION-NOTIFICATION-TO)
○ Priority: (technical name: THeaderPRIORITY)
○ Importance of message: (technical name: THeaderIMPORTANCE)
To transfer further header fields, set the relevant indicator for Variable Header. The technical names for the fields are XHeaderName1, XHeaderName2, and XHeaderName3.
The parameters are included in the mail header under the names specified here.
The attribute namespace for the adapter is http://sap.com/xi/XI/System/Mail.
Thanks, -
Email content line feeds using receiver mail adapter - HELP!
Hi all,
I have read the threads on how to download the XSD from SAP for creating a mail message type with dynamic To and From addresses and this is working fine. However, I am unable to create multiple lines in my mail message. I have the following parameters in my config:
XML2Plain - Transform.Class - com.sap.aii.messaging.adapter.Conversion
XML2Plain - Tansform.ContentType - text/plain;charset=utf-8
XML2Plain - xml.conversionType - SimpleXML2Plain
XML2Plain - xml.addHeaderLine - 0
XML2Plain - xml.fieldFixedLengths - 12,150
XML2Plain - xml.fixedLengthTooShortHandling - Cut
XML2Plain - xml.fieldSeparator - '0x0D''0x0A'
I have not changed the message type in the Design so the mapped Content field currently just contains one long line of 162 characters (as does the resulting email). I want 12 characters on the first line and 150 characters on the second line. Do I need to concatenate something between by 12-character and 150-character strings to achieve this? Do I need a line.Separator parameter in my module configuration?
Many thanks,
Stuart RichardsHi Sreeramulu,
As mentioned by Lucas, you can use the UDF. Inn addition to that, you need to define the Variable Headers under Variable transport binding after enabling the Adapter Specific Message Attributes.
For the Enabling ASMA, follow the below steps and check for the variable attributes.
Select the Advanced tab page.
To save adapter-specific attributes in the message header of the XI message, select Use Adapter-Specific Message Attributes and Variable Transport Binding.
The following attributes in the message header are then available for processing:
○ User: (technical name: TServerLocation)
○ Authentication key: (technical name: TAuthKey)
The following mail header fields are available for processing:
○ From: (technical name: THeaderFROM)
○ To: (technical name: THeaderTO)
○ Cc: (technical name: THeaderCC)
○ Bcc: (technical name: THeaderBCC)
○ Subject: (technical name: THeaderSUBJECT)
○ Reference to the mail that is to be replied to: (technical name: THeaderIN-REPLY-TO)
○ Reply to: (technical name: THeaderREPLY-TO)
○ Mail client program: (technical name: THeaderX-MAILER)
○ Send confirmation of receipt: (technical name: THeaderDISPOSITION-NOTIFICATION-TO)
○ Priority: (technical name: THeaderPRIORITY)
○ Importance of message: (technical name: THeaderIMPORTANCE)
To transfer further header fields, set the relevant indicator for Variable Header. The technical names for the fields are XHeaderName1, XHeaderName2, and XHeaderName3.
The parameters are included in the mail header under the names specified here.
The attribute namespace for the adapter is http://sap.com/xi/XI/System/Mail.
Thanks, -
In Receiver Mail Adapter ,how to ignore SOAP Header attachment
HI Folks,
Am using Receiver Mail Adapter and am getting 2 attachments.
1. one is Soap header which contains Control records
2. payload
I want only Payload as attachment and need to ignore SOAP Header(AT00001.xml).
The configuration is as below:-Trasport protocol : SMTP
Message Protocol: XIALL
Please provide Inputs.
Thanks & Regards
Ashok ReddyHi Gagandeep,
Scenario: File------>mail( Bypass scenario)
i had posted file in FTP and am getting attachment properly but aditionally am getting ATT00001.xml as SoapHeader.this i need to ignore.
PFB Module Parametrs i used:
localejbs/AF_Modules/MessageTransformBean LocalEnterpriseBean transform
Modulekey Parameterattribute value
transform Transform.ContentDisposition attachment;filename=”Pocr_860.txt”
transform Tansform.ContentType text/plain
Regards
Ashok -
Dynamic attachment name with receiver mail adapter and use mail package
We need to send mapped XML payload as attachment (with dynamic name) to a recepient (recepient email id is part of input xml payload, but not part of the mapped XML payload).
I could probably do this using the adapter module (as per the following link),
http://wiki.sdn.sap.com/wiki/display/XI/Adapter%20Module%20PI%207.0%20Set%20Attachment%20Name?bc=true
I would like to explore if this would be feasible using Mail package and XI payload.I already have a Java mapping that is converting the input XML to required Output format. If I am using Mail package (XI Payload), how do I go about sending this Output XML from java mapping as attachment to email id available in the input payload?Hi,
1) XML payload as attachment (with dynamic name)
2) recipient (recipient email id is part of input xml payload, but not part of the mapped XML payload)
These two is possible by using Mail Package. You have a standard xsd for mail package which you can download from the SAP Note 748024.
The xml created in you java mapping which will be your attachment should be put into the <content> tag of the mail package xml structure. and the file name can be set in the <Content_Type> tag.
<?xml version="1.0"; encoding="UTF-8"?>
<p2:Mail xmlns:p2="http://sap.com/xi/XI/Mail/30">
<Subject>My Invoice</Subject>
<From>from email address<;/From>
<To>to email address</To>
<Content_Type>text/plain;name="MyFile.csv";</Content_Type> --> file name here
<Content>123;A49;aaa</Content> -> attachment xml here
</p2:Mail>
And you have to select MailPackage in the receiver mail adapter.
Regards,
Aravind -
Column header in receiver mail adapter
Hi experts,
I have a proxy to mail scenario in which I send a mail with a file attached.
Is it possible to put column headers in the attachment, possibly without changing the mapping?
I mean, working with module configuration in communication channel?
Thanks
Fabio Bonihi
There are several scenario's
have a look at following :
/people/sap.user72/blog/2005/05/02/useful-sap-notes-for-xi
/people/michal.krawczyk2/blog/2005/11/23/xi-html-e-mails-from-the-receiver-mail-adapter
/people/michal.krawczyk2/blog/2005/03/07/mail-adapter-xi--how-to-implement-dynamic-mail-address
/people/michal.krawczyk2/blog/2005/12/18/xi-sender-mail-adapter--payloadswapbean--step-by-step
/people/sravya.talanki2/blog/2006/01/12/xi-triggering-e-mails-with-multiple-attachments--problems
/people/community.user/blog/2006/09/08/email-report-as-attachment-excelword
/people/sap.user72/blog/2005/01/06/how-to-process-csv-data-with-xi-file-adapter
/people/prasad.ulagappan2/blog/2005/06/07/mail-adapter-scenarios-150-sap-exchange-infrastructure - Mail Adaptor options
https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1685 [original link is broken] [original link is broken] [original link is broken] - File to Mail
/people/michal.krawczyk2/blog/2005/03/07/mail-adapter-xi--how-to-implement-dynamic-mail-address - Dynamic Mail Address
and for further
you can follow
/people/michal.krawczyk2/blog/2005/03/07/mail-adapter-xi--how-to-implement-dynamic-mail-address - Dynamic Mail Address
i hope this will help you.
Pls : Reward points if helpful
Vishal -
Variable Substitutionin Receiver Mail Adapter
Hi,
I am trying Receiver Mail Adapter without using Mail Package.
I want to set the To, From and the Subject dynamically from the payload.
How can this be done?
Thanks,
AravindVariable Substitutionin Receiver Mail Adapter
it happens in File adapter
I want to set the To, From and the Subject dynamically from the payload.
THeaderTO, THeaderFROM, THeaderSUBJECT....wont these ASMA work? -
Receiver Mail Adapter message with PDF attachment
Hi.
We are trying to generate emails from the mail adapter that includes the plain text in the body of the resulting email and an attached PDF file. We receive the following structure:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:newMailRequest_MT xmlns:ns0="http:/pdk/sap/TorstenTest">
<Sender/>
<Receiver/>
<BodyContent/>
<Subject/>
<Attachment/>
</ns0:newMailRequest_MT>
I have set up an interface and mail adapter to be able to produce emails with plain text in the body. I used SAP note 748024 for this.
So right now I can make XI send emails with dynamic mail addresses. My problem lies in sending attached files with the mails as well.
I have read most of the threads in here, but none of them seem to answer just how to include the attachment. Which field in the 'Mail' message type is used for the attachment??
What needs to be added to the communication channel and adapter for it to include attachments, while the body of the mail still keeps the plain text message??hi
I have used the following links to send the file as an attachement and as payload.
so it may help u.
links:
/people/prasad.ulagappan2/blog/2005/06/07/mail-adapter-scenarios-150-sap-exchange-infrastructure - Mail Adaptor options , mail attatchment
Sender mail adapter - PayloadSwapBean - Step by step - https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/6d967fbc-0a01-0010-4fb4-91c6d38c5816
/people/prasad.ulagappan2/blog/2005/06/07/mail-adapter-scenarios-150-sap-exchange-infrastructure
https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1685 [original link is broken] [original link is broken] [original link is broken]
/people/michal.krawczyk2/blog/2005/11/23/xi-html-e-mails-from-the-receiver-mail-adapter
points if helpful.
regards
sreeni -
Receiver mail adapter - Payload as a Text attachment
Hi,
In my proxy to mail adapter scenario, when i want to send payload to email as a Text email, where i need to content conversion in XI (XML to Txt file)
when i send payload, currently i am receiving as a XML file.
I try to follow like Rushikesh Deshmukh XI thread: Text Attachment in Mail Adapter in XI forum(topic)
I have having following config
Processing Sequence
localejbs/CreateAttachment Local Enterprise Bean XML2Plain
localejbs/sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean Local Enterprise Bean mail
Module Configuration
XML2Plain Transform.Class com.sap.aii.messaging.adapter.Conversion
XML2Plain Transform.ContentType text/plain;charset=utf-8
XML2Plain xml.Header1000.fieldFixedLengths 100,10,10,30,30,80,80,20,10,10,20,20,30,10,18,240,10,30,18,10
XML2Plain xml.Header2000.fieldFixedLengths 100,30,40,240
XML2Plain xml.addHeaderLine 0
XML2Plain xml.conversionType StructXML2Plain
XML2Plain xml.recordsetStructure Header1000,Header2000
Please suggest some solution."
Could you tell me exactly where i need to do all these setting and
do i need import localejbs/CreateAttachment Local Enterprise Bean XML2Plain...I mean shall i add same in my processing sequence
give in detail ? (in Receiver mail adapter Communication channel, advanced mode additional parameters)
I tried to follow this also
http://help.sap.com/saphelp_nw04/helpdata/EN/4e/c153426da9bd30e10000000a155106/frameset.htm
but i could not find much info on this help.sap.com reg. req.
Thanks
PrabaharanHi
f i create like this Receiver CC (module Tab)
number: 1
Module Name: localejbs/CreateAttachment
Module Type: Local Enterprise Bean
Module Key: mail
is it enough? do i need any other setting like this
Did you deployed CreateAttachment on PI server. As this is not a standard SAP module this is a custom module?
mail as module key is already used by XIMAILAdapterBean use some other key for CreateAttachment
Settings are fine for the Module
Processing Sequence
localejbs/CreateAttachment Local Enterprise Bean XML2Plain
localejbs/sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean Local Enterprise Bean mail
Module Configuration
XML2Plain Transform.Class com.sap.aii.messaging.adapter.Conversion
In this:
Module Key: XML2Plain
Parameter Name: Transform.Class
Parameter Value: com.sap.aii.messaging.adapter.Conversion
is it right?
Processing sequence is fine
XML2Plain Transform.ContentType text/plain;charset=utf-8
XML2Plain xml.Header1000.fieldFixedLengths 100,10,10,30,30,80,80,20,10,10,20,20,30,10,18,240,10,30,18,10
XML2Plain xml.Header2000.fieldFixedLengths 100,30,40,240
XML2Plain xml.addHeaderLine 0
XML2Plain xml.conversionType StructXML2Plain
XML2Plain xml.recordsetStructure Header1000,Header2000
can i anyone explain how to these settings?
Is this key valid to provide inputs to the module check with the code for this module
This looks like valid for MessageTransformBean ro StrictXMLtoPlainBean
Thanks
Gaurav
Edited by: Gaurav Bhargava on Oct 15, 2008 5:34 AM -
Receiver Mail Adapter with external Email-Provider
Hi everyone,
I have implemendet an Scenario with a receiver Mail Adapter. With using the SAP-Mail-Server it works fine.
Now I want to use an external Email Provider like GMX or yahoo. But the Parameter e.g. smtp://mail.gmx.net does not work.
Is this generally with an external Email Provider possible?
Thanks in advice
ChristophHi,
of course it is, but:
your XI has to see the external provider = opened ports
Regards,
michal
Maybe you are looking for
-
InDesign Backwards Compatibility in CS5 an MAJOR issue
I am a print designer who works in InDesign. I bought CS3 Design Premium in late summer of 2008. Shortly thereafter CS4 came out, but after just having forked out a big chunk of change, I decided against upgrading to CS4 right away. Recently I consid
-
I am still having great difficulty with pages docs in iCloud.
I thought Pages docs created on either device - ie iPad and MacBook - were supposed to update automatically but they don't. I can see the little cloud thing in action while typing on my document on the MacBook but the document stays exactly the same
-
XML Template are not publish in EBS
Dear All, I've create Invoice Voucher in BI Publisher and it's working fine in EBS. But I have to print this report from Invoice Workbench so I have done it by the help of Form Personalization but when I run this report from Invoice Workbench the tem
-
Any body have answer to this question?
I'm keen to see a document on list of interfaces and approach to push peoplesoft Finance,peoplesoft HR and Peoplesoft Projects related data into xRPM.
-
Hi, It is fairly random, but right now more often then not when I go to access the type tool I get a whole lot of nothingness, I can move my cursor, but I can not click, and I am not getting the spinning beachball of death, and when I do to force qui