cancel
Showing results for 
Search instead for 
Did you mean: 

Sender Mail Adapter Content Conversion

Former Member
0 Kudos

Hi All,

I just want to know if we can send a flat file(Rather Than the XML) with content conversion using Mail Adapter. If yes then what are all the possible ways for this.

I have tried but i am sucessful in sending the complete payload as a XML file, but i want the file with the content conversion, so that this should be able to picked by the third party systems.

Will be oblidge if any supported blog or pdf is provided for the same.

Thanks in Advance.

Jay

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Abhishek,

I can't see the two options that are suggested by you in my Sender Mail Adapter CC.

However i can see only one option under MAIL ATTRIBUTES which is CONTENT ENCODING.

I am using the XI 3.0 with the service pack level = 15.

Your suggestion/guidance will be highly appreciated.

Thanks,

Jay

former_member200962
Active Contributor
0 Kudos

Hi,

Now for the negative items, i want to send them back to business as flat file format 
using the mail adapter as attachment. This will help them to process the file as for there 
requirement.

Since you need to send an email message you have to use the format mentioned here: (S-UserID required)

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

Save this file as an XSD in you local system and upload it as an External Definition in your XI server.

Develop MI based on this External Definition (IN, ASYNC)

Create an Interface Mapping with Source as the file containing Negative items and target as the above developed MI

Now you need to develop an XSLT mapping (can use StylusStudio to do it) between the source and target Message Types

This XSLT mapping has to be designed in such a way that it extracts the payload out of the Negative Items message and maps it to the target (Content) field....you need to use CDATA element of XSLT here.

In this mapping itself you can define to what email-id you want to send the message.....

Everything happens on the XI --> Business service side...so it is not the sender channel but is the receiver channel:)

Your XSLT mapping will look something like:

<Mail>

<Content>

XSLT CODE

</Content>

</Mail>

where Mail and Content are the tags in the email message format...the External definition one.....

If you are new to XSLT then refer to my answer in this thread...

regards,

Abhishek.

prateek
Active Contributor
0 Kudos

Exactly. I don't know why this discussion was extended.

Use MessageTransformBean module in sender mail channel to perform content conversion on your attached file.

Regards,

Prateek

Shabarish_Nair
Active Contributor
0 Kudos

>

> Exactly. I don't know why this discussion was extended.

> Use MessageTransformBean module in sender mail channel to perform content conversion on your attached file.

>

> Regards,

> Prateek

exactly my point

Answers (8)

Answers (8)

Former Member
0 Kudos

Thanks Shabarish/Prateek,

I will look into all the possible solution and as for your suggestion, yes we should go for the standard one

rather than the workaround.

I will definitely look at this and may get back to you guys if i get stuck off.

Thanks a lot.

Best Regards,

Jay.

Former Member
0 Kudos

Hi All,

Thanks a lot for your support and suggestion.

Abshishek point is assigned to you & thanks a lot .

@ Prateek/Shabarish,

Thanks for your suggestion.

But i believe we are posting the threads over here to clarify our doubts by looking forward your valuable suggestions. I know u guys have good indepth knowledge in this platform but that doesnot mean that all are at the same level.

I just extended this thread to gather more clarification before approaching a solution. Hope this clarify your kind concern.

Thanks,

Jay.

Shabarish_Nair
Active Contributor
0 Kudos

Jay,

when you design something always look for an optimum solution.

We suggested the messagetransformbean because that is the standard used module for such purposes.

There are always alternative. I can personally suggest a solution that can be done via a XSLT mapping/Java Mapping or even a custom module, But why go for that when you already have a solution by SAP themselves

But then the choice is for you to make.

Good to know you do have a solution at hand.

prateek
Active Contributor
0 Kudos

Jay, I am with Shabarish on this.

Important point should be to get to the standard and optimum solution rather than thinking of a workaround.

Regards,

Prateek

Shabarish_Nair
Active Contributor
0 Kudos

>

> Hi All,

>

> I just want to know if we can send a flat file(Rather Than the XML) with content conversion using Mail Adapter. If yes then what are all the possible ways for this.

> I have tried but i am sucessful in sending the complete payload as a XML file, but i want the file with the content conversion, so that this should be able to picked by the third party systems.

>

> Will be oblidge if any supported blog or pdf is provided for the same.

>

> Thanks in Advance.

> Jay

for content conversion you can use the messagetransformbean

http://help.sap.com/saphelp_nw04/helpdata/en/57/0b2c4142aef623e10000000a155106/content.htm

Former Member
0 Kudos

Hi All,

Thanks a lot for your quick responce.

@ Ramakrishan- I am looking at the same thread suggested by you, but that basically is shown where we are getting the file(Flat Format) as an attachment and converting that to XML format to read by PI.

Here i am getting a file,processing it in PI and want to send the content of the file as a flat file format.

@Abshik - Let me clear the things:

Suppose For Ex:

I am getting a file with both positive items and negative items. Now i want to process the file in PI and send all the positive items to SAP system ( Which is OKAY for me). Now for the negative items, i want to send them back to business as flat file format using the mail adapter as attachment. This will help them to process the file as for there requirement.

I dont think that is anywhere releated to XSLT mapping .. Correct me if i am wrong ..

All your suggestion are most welcome..

Thanks a lot,

Jay

former_member750652
Contributor
0 Kudos

Hi Jay ,

May be u might need to go for customization of Adapter module as per your reqirrement.As you want to deal with the payload at communication channel it self and not at mapping level.Of course the threads speaks about the mapping level.

Regards,

Ram.

former_member200962
Active Contributor
0 Kudos
I dont think that is anywhere releated to XSLT mapping

Strange.....

In the [Mail message format |https://websmp205.sap-ag.de/~sapidb/012006153200000361852004E/ximail30_xsd.txt]there are two fields (out of many others)....

[1) Content_Type

2) Content

If you map Content_tyep field with constant "plain/text" your payload will be converted to text format

The payload will be present in Content field

Now when I worked on Mail scenario I had to use XSLT mapping to convert the entire incoming message to a string so that it can accomodate in the Content field....Message Mapping is incapable to do this....and as I am a bit weak on JAVA I could not opt for it (also possible with JAVA Mapping)

Regards,

ABHISHEK

Edited by: abhishek salvi on Apr 22, 2009 11:45 AM

Edited by: abhishek salvi on Apr 22, 2009 11:46 AM

former_member200962
Active Contributor
0 Kudos

Hi,

If I get your requirement right then you need the following thing:

1) Get the file in XML format from some sending system

2) Convert this XML file into flat file

3) Send this flat file to some receiver

If your requirement is as above then you can convert the incoming XML message to flat file in XI/PI and that too without any adapter module:)

You just need an XSLT mapping to convert the XML to Flat FIle.....just search SDN for XML to string conversion and you will get it.

By using XSLT mapping I mean you will get the output as follows:

<SRC>
      <Name>Abhishek</Name>
      <Country>India</Country>
</SRC>

With XSLT output will be:

<TRG>Abhishek India</TRG>

Regards,

Abhishek

former_member750652
Contributor
0 Kudos

Hi Jay,

The following link speaks about the scenario where in we can process the file that has been there as an attachment to mail on sender side by using module configuration.

/people/michal.krawczyk2/blog/2005/12/18/xi-sender-mail-adapter--payloadswapbean--step-by-step

Hope this helps you,

Ram.

former_member732072
Active Participant
0 Kudos

Hi Jay,

File Content Conversion option is available only in File Adapters.

Best Regards.

jyothi_anagani
Active Contributor
0 Kudos

Hi,

[How to Configure sender Mail Adapter|http://help.sap.com/saphelp_nwpi71/helpdata/en/23/c093409c663228e10000000a1550b0/frameset.htm]

[Mail Adapter|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/9e6c7911-0d01-0010-1aa3-8e1bb1551f05]

Thanks.