cancel
Showing results for 
Search instead for 
Did you mean: 

Data in File

Former Member
0 Kudos

Hi,

I have a file with certain fields in which one of the fields contain email address. Now XI has to read this file and send mail to that particular address.

If a file has 3 records, means there will be 3 mail ids; so mails are to be sent to these 3 mail ids with the data having in the remaining fields of that record.

Hope am clear.

Please provide ur inputs.

Thanks,

Satish.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Satish,

After file content conversion map the data such that you get such structure:

<MT_File>

<Email-ID>abc@gm.a</Email-ID>

<Data>blahblah</Data>

<MT_File>

<MT_File>

<Email-ID>abc1@gm.b</Email-ID>

<Data>blahblah111</Data>

<MT_File>

etc...

In Message mapping keep Target message(0-unbounded). After that since email-id is coming in your payload you can use variable substitution as here:

http://www.saptechnical.com/Tutorials/XI/Variable/substitution.htm

Regards

Arpil

Reward points for useful answer

Former Member
0 Kudos

Hi Arpil,

Thanks for ur input.

could you please elaborate little more your answer.

Regards,

Satish.

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

Check the link:

/people/michal.krawczyk2/blog/2005/03/07/mail-adapter-xi--how-to-implement-dynamic-mail-address

Regards,

Soumya

Former Member
0 Kudos

Hi,

If you have a fields like this,

<File>

<MailId>abc1</MailId>

<MailId>abc2</MailId>

<MailId>abc3</MailId>

<Data>adadsad</Data>

</File>

then

Create a Output structure like bellow.

<ns:Mail xmlns:ns="http://sap.com/xi/XI/Mail/30"> 0-Unbounded

<Subject>Subject</Subject>

<From></From>

<To></To>

<Reply_To />

<Content_Type>text/plain</Content_Type>

<Content>

This is the content.

</Content>

</ns:Mail>

Do the mapping bellow.

MailIdRemoveContextexits-splitbyvalue(valuechange)createif--Mail

MailIdRemoveContextsplitbyvalue--To

what are the fileds you require just add Remove context between the mapping.

Like DataRemove ContextContent.

*Reward Points If Helpful*

Regards,

Prakasu

Former Member
0 Kudos

Hey,

refer to this blog your problem will be solved

/people/michal.krawczyk2/blog/2005/03/07/mail-adapter-xi--how-to-implement-dynamic-mail-address

for this you need dynamic addressing which is explained in the blog.

the first thing you need to do is to download a structure that will serve as a target structure.

I will provide you with the structure.

<?xml version="1.0" encoding="utf-8" ?>

- <!--

SAP takes no position regarding the validity or scope of any intellectual property or

other rights that might be claimed to pertain to the implementation or use of the

technology described in this document or the extent to which any license under such

rights might or might not be available; neither does it represent that it has made any

effort to identify any such rights.

Copyright © SAP 2003-2004. All Rights Reserved.

This document and translations of it may be copied and furnished to others, and derivative

works that comment on or otherwise explain it or assist in its implementation may be

prepared, copied, published and distributed, in whole or in part, without restriction of

any kind, provided that the above copyright notice and this paragraph are included on all

such copies and derivative works. However, this document itself does not be modified in

any way, such as by removing the copyright notice or references to SAP.

This document and the information contained herein is provided on an u201CAS ISu201D

basis and SAP DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO

ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY

IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

-->

- <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">

- <!--

  • Mail

-->

- <xs:element name="Mail">

- <xs:annotation>

<xs:documentation>Mail package for XI - Mail Adapter</xs:documentation>

</xs:annotation>

- <xs:complexType>

- <xs:sequence>

<xs:element name="Subject" type="xs:string" minOccurs="0" />

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

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

<xs:element name="Reply_To" type="xs:string" minOccurs="0" />

<xs:element name="Content_Type" type="xs:string" minOccurs="0" />

<xs:element name="Date" type="xs:dateTime" minOccurs="0" />

<xs:element name="Message_ID" type="xs:string" minOccurs="0" />

<xs:element name="X_Mailer" type="xs:string" minOccurs="0" />

- <xs:element name="Content" minOccurs="0">

- <xs:annotation>

<xs:documentation>any type</xs:documentation>

</xs:annotation>

</xs:element>

</xs:sequence>

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

</xs:complexType>

</xs:element>

- <xs:element name="MailReceipt">

- <xs:annotation>

<xs:documentation>Mail Receipt for XI - Mail Adaper</xs:documentation>

</xs:annotation>

- <xs:complexType>

- <xs:sequence>

<xs:element name="Server" type="xs:string" />

<xs:element name="Format" type="xs:string" />

<xs:element name="UseMailPackage" type="xs:boolean" />

<xs:element name="Encoding" type="xs:string" />

<xs:element name="Subject" type="xs:string" minOccurs="0" />

<xs:element name="From" type="xs:dateTime" minOccurs="0" />

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

<xs:element name="Date" type="xs:dateTime" minOccurs="0" />

</xs:sequence>

</xs:complexType>

</xs:element>

</xs:schema>

Use this structure as your target message type.

here you can give the subject, to, from and the content.

so in your to field map field in which you will get the address.

in the content node you can map the field in which you want the actual data .

In the configuration part you need to mark the field Use mail package(mail adapter) so that the data is not sent as an attachment but as the content of the message.

refer to the blog and if any issues revert.

reward points if useful.

regards,

Milan

Edited by: Milan Thaker on May 28, 2008 8:36 AM

Edited by: Milan Thaker on May 28, 2008 8:42 AM

Edited by: Milan Thaker on May 28, 2008 8:43 AM

Edited by: Milan Thaker on May 28, 2008 8:44 AM