cancel
Showing results for 
Search instead for 
Did you mean: 

Mail Receiver with attached XML

Alfredo_Lagunar
Participant
0 Kudos

Hi Experts,

I'm creating a RFC-Mail scenario and I have a doubt about how to generate the attach. I have imported the mail xsd and mapped fields as subject, from, to.. Now my question is what to do with the Content_Type, Content_Disposition and especially Content. I want transform data from the RFC to a specified XML format, and then send it to a customer.

Is it posible only with graphical mapping or do I need to perform Java or ABAP mapping?

Best Regards,

Alfredo LAgunar.

Accepted Solutions (1)

Accepted Solutions (1)

prateek
Active Contributor
0 Kudos

Content_Type, Content_Disposition are not mandatory fields. You may disable it in mapping. Content refers to the actual body of message which would be seen in mail if you use mail package without attachment.

Graphical mapping is not mandatory but surely easier. You may use other types java mapping

/people/stefan.grube/blog/2007/04/17/xi-mail-adapter-an-approach-for-sending-emails-with-attachment-with-help-of-java-mapping

Regards,

Prateek

Alfredo_Lagunar
Participant
0 Kudos

Hi Prateek,

My doubt is how to pass al content of my XML to the content of the mail definition. Need I to perform a RFC->XML->Content mapping?

Best Regards,

Alfredo Lagunar.

former_member192295
Active Contributor
0 Kudos

Hi,

Develop UDF according to your requirement for source fileds message concatenate and pass as a string to receiver mail structure filed (content). I hope your problem will be sort out.

former_member750652
Contributor
0 Kudos

HI Alfredo,

You can simply map RFC.respose message to any other XML message and use mail adapter as a receiver .This way we cane send RFC response as mail attachmnet following setting mentoined in the blog .(Would you like to send RFC response as Mail content or as Attachment ?)

Alfredo_Lagunar
Participant
0 Kudos

Hi Ramakishna,

my requirement is to execute a rfc in SAP R/3 destination XI, map the fields to a xml format, and then send that xml to a email account described in the data of the RFC.

Best regards,

Alfredo Lagunar.

prateek
Active Contributor
0 Kudos

You simply dont need mail packaging actually.

A simple receiver side structure of your choice could be used.

Use Message Protocol = XIALL and you will get whole xml message as attachment.

Regards,

Prateek

Alfredo_Lagunar
Participant
0 Kudos

HI Prateek,

I need to send to an email account that is data in one of the xml fields.

Best Regards,

Alfredo Lagunar.

prateek
Active Contributor
0 Kudos

Please specify what exactly you want as Attachment (entire structure) and what you want as mail body (if you want).

Regards,

Prateek

Alfredo_Lagunar
Participant
0 Kudos

Hi,

I need an attahcment with a well formed XML, message body is not important (maybe blank body)

Best Regards,

Alfredo Lagunar.

prateek
Active Contributor
0 Kudos

Then use my reply

You simply dont need mail packaging actually.

A simple receiver side structure of your choice could be used.

Use Message Protocol = XIALL and you will get whole xml message as attachment.

Here the receiver side structure would be any xml format you want in output/

Regards,

Prateek

Alfredo_Lagunar
Participant
0 Kudos

OK, but how to send the mail to a different account each time without mail packaging?

Best Regards,

Alfredo Lagunar.

Alfredo_Lagunar
Participant
0 Kudos

Hi,

can anybody help me?

Regards,

Alfredo Lagunar.

Former Member
0 Kudos

Hi,

U can use TOHeader field which is one of the Adapter Message Dynamic attribute

You can use UDF for passing data to this based on the payload.

Dont forget to check the option ASMA in Mail adapter

Hope this will take you forward

you can search the SDN for DynamicFileName UDF for having idea on usage of ASMA in UDfs

Rajesh

Alfredo_Lagunar
Participant
0 Kudos

Hi,

I think there must to be an easier way to do this,

I only need to catch some data that comes from an RFC call, map to a XML exchange format and then send this as mail attachment to a variable account extracted form the data of the RFC.

I have developed the first part, the RFC sends the data I need, I can catch the data and send to a fixed recipient without mail package.

Any idea?

Best regards,

Alfredo Lagunar.

Former Member
0 Kudos

Hello,

I had asimilar requirement like file has to be send to variable accounts in FlatFile format

After a lot of search and enquiries i solved it with the help of Dynamic varaible Name TOHeader

What is the problem with this for you?

I dont think you can get a simpler solution than this?

Rajesh

Alfredo_Lagunar
Participant
0 Kudos

Hi Rajesh,

Do you mean I need a XSLT transformation? I have no idea what is Dynamic Variable Name TOHeader.

Best Regards,

Alvfredo Lagunar.

Former Member
0 Kudos

Did your payload contains recevier mail id option ?

then use the below UDF

search for filename udf in sdn and replace filename and namespace with mail and TOHeader parameter

for udf code

finally enable ASMA of mail adapter

Rajesh

Edited by: Rajesh on Feb 19, 2009 11:39 PM

Alfredo_Lagunar
Participant
0 Kudos

Hi,

my problem is how to map the complete input XML to the 'Content' field, then assign the subject, from and to fields to send that XML as attachment.

Best Regards,

Alfredo Lagunar.

Alfredo_Lagunar
Participant
0 Kudos

Any idea? I'm stucked.

Best Regards,

Alfredo Lagunar.

former_member200962
Active Contributor
0 Kudos

Hi,

You need to do XSLT / JAVA mapping to push the entire source data into the content node. You can make a search for XML-To-String on SDN......the from, To, Content_Type fields will be a constant value...if you need to have a dynamic email address then you can refer to Michals blog.

Regards,

Abhishek.

Alfredo_Lagunar
Participant
0 Kudos

Hi Abhishek,

This solved my problem with a java mapping.

Best Regards,

Alfredo Lagunar.

Answers (1)

Answers (1)

former_member750652
Contributor
0 Kudos

Hi Alfredo,

The following link will help you out in knowing more about configuring part of mail adapter in the reciver without using content_type.

/people/prasad.ulagappan2/blog/2005/06/07/mail-adapter-scenarios-150-sap-exchange-infrastructure

Thanks,

Ram.