cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic Email Addresses in Mail Adapter in PI 7.1

Former Member
0 Kudos

Hi All,

For configuring the dynamic email address, I have included the mail structure and the pyaload as 2 separate message and 2 interfaces. In config, I have one operation mapping pointing towards both these structures and I have 2 receiver agreements. But I get an error in the adapter saying

Message processing failed. Cause: 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 start tag: Mail, but found Invoice at state 1.

What needs to be done?

Thanks,

Geetha

Accepted Solutions (1)

Accepted Solutions (1)

former_member200962
Active Contributor
0 Kudos

Hi,

For configuring the dynamic email address, I have included the mail structure and 
the pyaload as 2 separate message and 2 interfaces. In config, I have one operation 
mapping pointing towards both these structures and I have 2 receiver agreements.

Can you tell me what kind of mappings you are using and what are its Source and target messages..

Regarding the error....this error occurs when there is a difference in the namespace of the message imported as external definition and the one included in the mapping....

If you are using XSLT mapping and having the mail package in the receiver structure then the namespace correspoding to it should be <xmlns:ns0="http://sap.com/xi/XI/Mail/30">....Applicable to the <ns0:Mail> tag and also to all other tags under it..

Regards,

Abhishek

Former Member
0 Kudos

Hi Abhishek,

I have a source structure as an Idoc and target structure is a message type created for a custom flat file format. Do both these structures have the same namespace as mentioned by you.

Thanks,

Geetha

VijayKonam
Active Contributor
0 Kudos

If you are planning to send the payload message as attachment, it is not possible the way you have designed the interface and mapping. Everything should be in the same mesage with the payload being copied in to the body of the mail message package. Then you will get a mail in the inbox with payload as body.

VJ

Former Member
0 Kudos

Hi VJ,

But I need the attachment to be a text file. If I copy the contents of my target structure into content node of the mail structure, it would be in XML format. Is there any way to convert the xml into actually tab delimited files.

Thanks,

Geetha

VijayKonam
Active Contributor
0 Kudos

May be you need to write a UDF or a java mapping for that.

VJ

former_member200962
Active Contributor
0 Kudos

Hi,

I have a source structure as an Idoc and target structure is a message type created for a 
custom flat file format.

If you want to send email message to a person and want that the message (attachment) reaches him/her in the mailbox

then you cannot use a custom Flat file Format in your target structure. The structure has to be the one mentioned in this link:

https://websmp205.sap-ag.de/~sapidb/012006153200000361852004E/ximail30_xsd.txt

Save this structure as External definition and build MI, mapping using this external definition. No other structure would do.

Do both these structures have the same namespace as mentioned by you.

No...as the source is an IDOC it will have the namespace of SAP system....

You need to perform a XSLT mapping to extract only the payload from the IDOC message and then pass it as a string to the Content Field of the target mail message...

I have attached a digram in SDN-Wiki which tells you what namespace I am refering to.

SDN-Wiki --> SAP NetWeaver Technology --> Process Integration --> Attachments..

Search for the attachment against my name and having "NamespaceInXSLTMapping" as comment.

But I need the attachment to be a text file.

No problem:)....no UDF/JAVA coding needed...you can convert the attachment to the format you want..just you need to mention the appropriate Content_Type

Refer this blog and your problem will be solved:

/people/community.user/blog/2006/09/08/email-report-as-attachment-excelword

For checking which Content_Type is available and which one is suitable check this link:

http://www.utoronto.ca/ian/books/html4ed/appb/mimetype.html

Regards,

Abhishek.

Answers (3)

Answers (3)

Former Member
0 Kudos

Thanks,

Geetha

Former Member
0 Kudos

Hi All,

I found the solution to the problem in https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/11287. [original link is broken] [original link is broken] [original link is broken]

Thanks,

Geetha

Former Member
0 Kudos

Hi Geetha,

You have to see the mail package structure which you are using in Integration Repository, it looks to be wrong, start tag is missing, fix it this will make the communication channel work.

Please check the following blog on "how to implement dynamic mail address"

[https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1361] [original link is broken] [original link is broken] [original link is broken];

You need to use the source structure provided by sap in order to use it in your mail scenario which you can download it from.

[https://websmp205.sap-ag.de/~sapidb/012006153200000361852004E/ximail30_xsd.txt]

It is like

<xs:schema targetNamespace="http://sap.com/xi/XI/Mail/30"

xmlns:xi="http://sap.com/xi/XI/Mail/30"

xmlns:xs="http://www.w3.org/2001/XMLSchema">

Please check your structure if it matches exactly with the mail package provided by SAP, if not change it accordingly.

Also check Transport and message protocol (Transport Protocol = imap4/pop3, Message Protocol =XIPayload) and connection parameters like url,username,password,polling interval.

Regards,

Jitender