cancel
Showing results for 
Search instead for 
Did you mean: 

Receiver Mail adapter to be unbounded

sriram_devarapalli
Participant
0 Kudos

Hi Team,

We had a scenario where we are getting multiple records from RFC and needs to send mails to all records with multiple mail ids using PI 7.1. I am using SAP Provided XSD as External Definition for Mail Massage Type. In External Definition it has Occurences as 1 only. if i change the occurences to Unbounded the External Definition is giving XSD Error "Unable to recognize document as valid XSDCheck the selected category".

For example if i send 5 records in RFC i need to send the data for each record as individual Mail to different Mail ID's where these Differnet Mail id's will be given at runtime from an RFC Lookup.

Thanks in Advance,

Sriram

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member200962
Active Contributor
0 Kudos

Mail adapter supports Multi-Mapping...however Mail.xsd does not support occurence change.

You can define your own structure (DT....with the required occurence) and then send the mail(s) accordingly.

Regards,

Abhishek.

sriram_devarapalli
Participant
0 Kudos

Hi Abhishek,

Thanks a lot for the Fast response.

If we declare our own DT then what is the Data type for Content.

in Mail.XSD the Data type for Content is not maintained.

Thanks in Advance,

Sriram

former_member200962
Active Contributor
0 Kudos

You can keep it as xsd:string.

sriram_devarapalli
Participant
0 Kudos

Hi Abhishek,

I had created a XSD and imported as External Definition. When i am sending the Data to RFC, i m getting an error.

Error is "failed to send mail: com.sap.aii.af.sdk.xi.util.XMLScanException: expecting end tag: Mail, but found {}Mail at state 1"

The below is the XSD I created.

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://sap.com/xi/XI/Mail/30" targetNamespace="http://sap.com/xi/XI/Mail/30">

<xsd:element name="Mail" type="DT_MAIL_RECEIVER" />

<xsd:complexType name="DT_MAIL_RECEIVER">

<xsd:sequence>

<xsd:element name="Mail" minOccurs="0" maxOccurs="unbounded">

<xsd:annotation>

<xsd:documentation>

Mail package for XI - Mail Adapter

</xsd:documentation>

</xsd:annotation>

<xsd:complexType>

<xsd:sequence>

<xsd:element name="subject" type="xsd:string" minOccurs="0" />

<xsd:element name="From" type="xsd:string" minOccurs="0" />

<xsd:element name="To" type="xsd:string" minOccurs="0" />

<xsd:element name="CC" type="xsd:string" minOccurs="0" />

<xsd:element name="Content" minOccurs="0">

<xsd:annotation>

<xsd:documentation>

Any Type

</xsd:documentation>

</xsd:annotation>

</xsd:element>

</xsd:sequence>

<xsd:attribute name="encoding" type="xsd:string" />

</xsd:complexType>

</xsd:element>

</xsd:sequence>

</xsd:complexType>

</xsd:schema>

Thanks in Advance,

Sriram

former_member187339
Active Contributor
0 Kudos

Hi Sriram,

Another suggestion would be to use the standard XSD and in message mapping and operation mapping change the occurrences of the target (which is the XSD) to 1.. unbounded

Regards

Suraj

former_member200962
Active Contributor
0 Kudos
I had created a XSD and imported as External Definition.

Why are you following this procedure?

create a new DT in IR --> then MT --> then inbound MI.....do not modify the Mail.xsd....this new DT can have any structure.....just that in the receiver mail channel you should not use Use mail package option

Regards,

Abhishek.

sriram_devarapalli
Participant
0 Kudos

Hi Abhishek,

Thanks for the reply,

i had created the New DT,MT with unbounded. I want to get Mail ID's at run time, not static mail ID's so i am using Use mail package

Thanks in Advance,

Sriram