cancel
Showing results for 
Search instead for 
Did you mean: 

MessageTransformBean or PayloadSwapBean

Former Member
0 Kudos

Hi Aerv,

Thank you so much for your reply.

Basically, I have an Email Attachment to iDoc (Attachment name will be different for all the file) scenario but I am struggling to read the special character in the email attachment.

XML Contains this

<Eisenhüttenstr. 99>

When PI reads the email it will change the character to

<Eisenhüttenstr. 99>

I can see 2 payload in ABAP Stack

MailMessage (text/xml;charset="utf-8")

MailAttachment-1 (application/octet-stream;name="file1")


Is there anyway I can change the MailAttachment-1 (application/octet-stream;name="file") to MailAttachment-1 (text/xml;charset="utf-8")

I have tried MessageTransformBean but it didn't change the MailAttachment encoding.

Adapter Module

localejbs/AF_Modules/MessageTransformBean         Local Enterprise Bean     contentType

contentType          Transform.ContentType         text/xml;charset="utf-8"

Can somebody please tell me how to solve this problem

Thanks,

Iqbal

Accepted Solutions (1)

Accepted Solutions (1)

former_member184681
Active Contributor
0 Kudos

Hi Iqbal,

I think this info above is what we were all missing in your previous posts. If you are simply trying to replace the mail content with mail attachment as a main payload, use PayloadSwapBean, it should do the job for you. Most probably you won't even have to worry about the content type then, but just in case, you could use PayloadSwapBean first, then MessageTransformBean (since it is after the payload swap, it would apply to the attachment payload already) and only then the main module of your sender adapter.

Regards,

Greg

Former Member
0 Kudos

Hi Greg,

Thanks for your reply.

My question is that can we use PayloadSwapBean for different file names because the file name of the attachment will be different and based on Material Name and number.

Can we use PayloadSwapBean to read any files? If so can you please tell me how

I have found this but not sure if this is going to solve my problem or not.

Can you please suggest?

Thanks

Iqbal

former_member184681
Active Contributor
0 Kudos

Dear Iqbal,

Try using:

swap.keyName = payload-name

swap.keyValue = MailAttachment-1

First check if that works fine, without any other modules.

Regards,

Greg

Former Member
0 Kudos

Dear Greg,

I tried this but now I am getting mapping error.

I have done the following

In the ESR

I have mapped the Email Package content to Target side single field

#

Error in ABAP Stack

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>

- <!--

 Request Message Mapping 

-->

- <SAP:Error SOAP:mustUnderstand="" xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">

<SAP:Category>Application</SAP:Category>

<SAP:Code area="MAPPING">EXCEPTION_DURING_EXECUTE</SAP:Code>

<SAP:P1>com/sap/xi/tf/_MM_Email_Order_TO_ORDER~</SAP:P1>

<SAP:P2>com.sap.aii.utilxi.misc.api.BaseRuntimeException:</SAP:P2>

<SAP:P3>Fatal Error: com.sap.engine.lib.xml.parser.ParserE</SAP:P3>

<SAP:P4>xception: XMLParser: No data allowed here: (hex) ~</SAP:P4>

<SAP:AdditionalText />

<SAP:Stack>Runtime exception occurred during application mapping com/sap/xi/tf/_MM_Email_Order_TO_ORDER~; com.sap.aii.utilxi.misc.api.BaseRuntimeException:Fatal Error: com.sap.engine.lib.xml.parser.ParserException: XMLParser: No data allowed here: (hex) ~</SAP:Stack>

<SAP:Retry>M</SAP:Retry>

</SAP:Error>

All I want is read the email attachment content to be mapped to target side.

Please suggest

Thanks,

former_member184681
Active Contributor
0 Kudos

Your sender structure looks like the one for an e-mail message. Now, since you swapped it with the attachment, you should create a data type that reflects your XML attachment structure, and use it as a source in the mapping.

Regards,

Greg

Former Member
0 Kudos

Dear Greg,

Thank you so much.

It solve me ongoing issue.

Once again thank you so much.

Answers (1)

Answers (1)

zameerf
Contributor
0 Kudos

Hi,

Did you use PayloadSwapBean at first?

Please try removing quotes for "utf-8" like, text/xml;charset=utf-8

Also, try with respective charset for the language used.

-Zameer