on 06-14-2013 8:50 AM
Hi Folks,
Wondering to know about how to send multiple content to the receiver MAIL Adapter.
my interface is to send Production Order failure notification which is coming from SAP ECC to Mail server. and my requirement is to send a mail with the content format as below
Hi,
Interface failed to print the Production Order 20002221,20002223 in SAP
Regards,
SAP PI
NOTE: This is a system generated mail. Please do not reply
while my test run I could able to achieve this in mapping and also sending content one in string as whole but cudnot able to get the above format accepted by adapter and adapter throwing the error as Message processing failed. Cause: java.lang.Exception: 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
For receiver side data type I have downloaded the MAIL.xsd and mapped the below fields
Subject
From
To
Content
For content field I did write a UDF based on the source fields OrderNo and NestName as below:
String Orders = "";
String content = "";
for(int i = 0;i<Order.length;i++){
if(i == 0)
Orders = Order[i];
else
Orders = Orders.concat(",").concat(Order[i]);
}
//content = content.concat("Interface failed to print the Production Order").concat(Orders).concat(" in SAP");
//result.addValue("Interface failed to print the Production Order "+Orders+" in SAP");
result.addValue("Hi,");
result.addValue(" ");
result.addValue("OPS0056 Interface failed to print the Production Order "+Orders+" in SAP");
result.addValue(" ");
result.addValue("Regards");
result.addValue("SAP PI ");
result.addValue(" ");
result.addValue(" NOTE: This is a system generated mail. Please do not reply.");
It would really appreciated if you cud help in troubleshoot where the I am doing mistake and corrective steps make adapter to accept multiple content and put the message body with the above format.
Regards,
Hanu J
Hi Hanumantha,
You need to append the input lines with a CRLF character and then send the output to Content field of the mail packaqe.
Something like
"Hi," + CRLF + "Interface failed to print the Production Order 20002221,20002223 in SAP" + CRLF + "Regards," + CRLF + "SAP PI"
Map to Content.
Content type should be text/plain.
Hope it helps!
Ambrish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Hanu,
you should use mail package, of course.
Download your xml source and test the mapping in Message Mapping test environment. The target should look like:
<ns:Mail xmlns:ns="http://sap.com/xi/XI/Mail/30">
<Subject>Subject</Subject>
<From>namea@company.com</From>
<To>nameb@company.com</To>
<Reply_To />
<Content_Type>text/plain</Content_Type>
<Content>
This is the content.
</Content>
</ns:Mail>
To be able to generate that type you should define your target message type with xml namespace http://sap.com/xi/XI/Mail/30
/Udo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Udo,
Thanks for the quick reply..I am getting the namespace as suppose to but while routing through Adapter getting the error
<?xml version="1.0" encoding="UTF-8"?>
<ns1:Mail xmlns:ns1="http://sap.com/xi/XI/Mail/30"><Subject>XD3: INT-SIGMA to SAP Interface- Message Failure Notification</Subject><From>kvid@sap.com</From><To>pawar.ha@gmail.com;vsagar.ka@gmail.com</To><Content>Hi,</Content><Content> </Content><Content>OPS0056 Interface failed to print the Production Order 23084454,23087806, in SAP</Content><Content> </Content><Content>Regards</Content><Content>SAP PI </Content><Content> </Content><Content> NOTE: This is a system generated mail. Please do not reply.</Content></ns1:Mail>
the message mapping output is as required. but while the adapter processing it is through error.
Mail: call failed | ||
13.06.2013 10:40:45.143 | Information | Mail: sending a delivery error ack ... |
13.06.2013 10:40:45.144 | Error | Adapter Framework caught exception: 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 |
13.06.2013 10:40:45.144 | Error | MP: exception caught with message 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 |
13.06.2013 10:40:45.144 | Error | Mail: error occured: com.sap.aii.af.lib.mp.module.ModuleException: 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 |
13.06.2013 10:40:45.144 | Information | Mail: sent a delivery error ack |
13.06.2013 10:40:45.145 | Error | Delivering 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: java.lang.Exception: 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. |
13.06.2013 10:40:45.187 | Information | The message status was set to WAIT. |
13.06.2013 10:40:45.188 | Information | The asynchronous message was successfully scheduled to be delivered at Thu Jun 13 11:45:45 EDT 2013 |
and in Communication channel I have used use mail package checked under mail attributes and content encoding been selected base64
Do we have any other setting where i am missing?
Regards,
Hanu J
Hi Hanu,
Content ONLY once! From your error msg: "expecting end tag: {http://sap.com/xi/XI/Mail/30}Mail, but found {'}Content"
/Udo
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.