Sender Mail Adapter Content Conversion
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
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...
Re: JAVA MAPPING
regards,
Abhishek.
Similar Messages
-
Receiver Mail Adapter content conversion
Hi
I have read a lot of forums, etc and changed much on my adapter, but still get a xml file send as an attachment instead of a text file.
Can anyone please advise on how to change the receiver adapter to covert from xml to text.
I have added the module processing sequence like follow - please help.
Processing sequence
localejbs/AF_Modules/MessageTransformBean Local Enterprise Bean XML2Plain
sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean Local Enterprise Bean Mail
Module configuration
XML2Plain Details.endSeparator 'nl'
XML2Plain Details.fieldName ZINDUS,TCODE,TDATE,RDATE
XML2Plain Details.fieldSeparator |
XML2Plain Transform.Class com.sap.aii.messaging.adapter.Conversion xml/txt
XML2Plain Transform.ContentDisposition attachment;filename="TEBA.txt"
XML2Plain Transform.ContentType xml/plain
XML2Plain xTransform.recordsetStructure Details
Thanks
ClintonHi,
From the mail adapter FAQ,
<i>How can I set the file name of a mail attachment?
There are several MIME headers that play a role in how the client retrieves the file name of an attachment. Unfortunately, this behavior differs among various mail clients. The reason for this inconsistent behavior comes from the fact that this mechanism has been extended incrementally. The old way is to use the name parameter in the Content-Type header as specified in RFC1341. For example, you can set the content type of an XML attachment as:
Content-Type: application/xml; name="abc.xml"
RFC1521 discourages the use of this name parameter in anticipation of the new header Content-Disposition, which is defined in RFC1806.
With this Content-Disposition header, you can set the file name as:
Content-Disposition: attachment; filename="abc.xml"
Some clients may show the Content-Description value as the file name. The Content-Description header is typically used to associate some descriptive information to an attachment (RFC1341) as in
Content-Description: my xml file
To avoid potential interpretation problems, it is recommended to combine the use of these headers.</i>
Also, the note 779981 describes how to set Content Type in the mapping program. Am not sure, but combining the two, maybe it should be possible! Havent tried something of this sort though!
Regards
Bhavesh -
Sender File Adapter - Content Conversion
HI Friends,
I got a scenario where I need to convert the File to XML document through Sender file adapter..
My file looks like below.
BATCH1234........
12DASER123142JMM
237DSAFDLKC839890
45SDFLASJ90011
BATCH3455...
132FGAR
SD21352525
BATCH998898...
123145DSRTW
12FSTS
So there is a Header and Body for each record set..
My XML Structure is as follows.
<TimeStructure>
<TimeRecord>
<ControlRec>
<Field1>BATCH </Field1>
<Field2> ...</Field2>
</ControlRec>
<DataRec>
<F1> ...... </F1>
<F2> ...... </F2>
</DataRec>
</TimeRecord>
<TimeRecord>
<ControlRec>
<Field1> BATCH </Field1>
<Field2> ADFAS </Field2>
</ControlRec>
<DataRec>
<F1> ...... </F1>
<F2> ...... </F2>
</DataRec>
</TimeRecord>
</TimeStructure>
The blog <a href="/people/shabarish.vijayakumar/blog/2006/02/27/content-conversion-the-key-field-problem:///people/shabarish.vijayakumar/blog/2006/02/27/content-conversion-the-key-field-problem
is somewhat relevant to my requirement.
But the problem is I have the keyfield "BATCH" for my header file but don't have any <b>key field in the data record</b> of the input file.
Please help me out how to mention the configuration parameters.
Regards,
KumarHi,
If you don't have constant key value for your detail records, then you can not directly get the required xml.
So in this case, you can read all the records in a common Row model, i.e each record will be considered as a one row with all the values, and then split this row with Substring or java functions in the mapping.
Even you can do this in the Adapter module .
If you have key value for each record to identify then you can try with content conversion.
Regards,
Moorthy -
Key field from content - Sender file adapter content conversion
I am reading a source CSV file that has this structure. All rows in the source file are the same structure: line items of a PO. But there will be multiple POs in a single file, identified by the PO number as one column in the file.
PONum,LineItemNum,Qty,Description
001,1,34,Carrots
001,2,17,Apples
001,3,22,Bananas
002,1,4,Mangos
002,2,9,Coconuts
003,1,44,Grapes
Goal is to generate 3 messages, one for each PO:
<po>
<num>001</num>
<line_items>
... 3 line items for PO # 001 ...
</line_items>
</po>
<po>
<num>002</num>
<line_items>
... 2 line items for PO # 002 ...
</line_items>
</po>
<po>
<num>003</num>
<line_items>
... 1 line item for PO # 003 ...
</line_items>
</po>
Is there any way to use the Content Conversion Key Field Name to group the line items into the correct 3 messages? "Key Field Name" expects a static identifier for each type of row; but mine varies by the PO number in the content.
Or do I need to do this in the mapping? If so, what is the easiest way to split 1 large message of all line items into multiple target messages based on the PO number? (I assume this is better than sending individual line item messages and aggregating them later, as long as the file size is OK.)
Thanks in advance!
RBL
Edited by: Robert Burfoot-Lobo on Apr 8, 2009 11:43 AMHi Robert,
If ur goal is to split into 3 messages one for each PO, you can go for message split and using graphical mapping you can achieve that.
Within the message mapping go to the tab Messages.
Change the occurrence of the target message to 0..unbounded.
Also this link may help you.
/people/claus.wallacher/blog/2006/06/29/message-splitting-using-the-graphical-mapping-tool
Regards,
Madhu -
Sender File Adapter content conversion problem
Hi all,
is it possible to do content conversion like this:
Key;Field1;Field2;Field3
PO00H;0482000000;20061102;PL61
PO01I;00010;0A720;Material 1;100.000
PO02D;20061102;100.000;
PO00H;0482000001;20061102;PL63
PO01I;00010;0A730;Material 2;40.000
PO02D;20061102;40.000;
PO01I;00010;0A740;Material 3;140.000
PO02D;20061102;30.000;
PO02D;20061103;110.000;
convert to
<?xml version="1.0" encoding="utf-8" ?>
<MT_PO>
<DT_PO>
<DocumentHeader>
<PONumber>0482000000</PONumber>
<PODate>20061102</PODate>
<CompanyCode>PL61</CompanyCode>
</DocumentHeader>
<Item>
<ItemHeader>
<ItemNumber>00010</ItemNumber>
<MaterialCode>0A720</MaterialCode>
<MaterialDescription>Material 1</MaterialDescription>
<Quantity>100.000</Quantity>
</ItemHeader>
<ItemDetail>
<DeliveryDate>20061102</DeliveryDate>
<Quantity>100.000</Quantity>
</ItemDetail>
</Item>
</DT_PO>
<DT_PO>
<DocumentHeader>
<PONumber>0482000001</PONumber>
<PODate>20061102</PODate>
<CompanyCode>PL63</CompanyCode>
</DocumentHeader>
<Item>
<ItemHeader>
<ItemNumber>00010</ItemNumber>
<MaterialCode>0A730</MaterialCode>
<MaterialDescription>Material 2</MaterialDescription>
<Quantity>40.000</Quantity>
</ItemHeader>
<ItemDetail>
<DeliveryDate>20061102</DeliveryDate>
<Quantity>40.000</Quantity>
</ItemDetail>
</Item>
<Item>
<ItemHeader>
<ItemNumber>00010</ItemNumber>
<MaterialCode>0A740</MaterialCode>
<MaterialDescription>Material 3</MaterialDescription>
<Quantity>140.000</Quantity>
</ItemHeader>
<ItemDetail>
<DeliveryDate>20061102</DeliveryDate>
<Quantity>30.000</Quantity>
</ItemDetail>
<ItemDetail>
<DeliveryDate>20061103</DeliveryDate>
<Quantity>110.000</Quantity>
</ItemDetail>
</Item>
</DT_PO>
</MT_PO>Ivan,
I fear this is not possible.
You can have
<?xml version="1.0" encoding="utf-8" ?>
<MT_PO>
<DocumentHeader>
<PONumber>0482000000</PONumber>
<PODate>20061102</PODate>
<CompanyCode>PL61</CompanyCode>
</DocumentHeader>
<ItemHeader>
<ItemNumber>00010</ItemNumber>
<MaterialCode>0A720</MaterialCode>
<MaterialDescription>Material 1</MaterialDescription>
<Quantity>100.000</Quantity>
</ItemHeader>
<ItemDetail>
<DeliveryDate>20061102</DeliveryDate>
<Quantity>100.000</Quantity>
</ItemDetail>
</MT_PO>
Multiple <Item header> and multiple <Item details>
Do the content conversion like this and then in mapping, convert it to any structure you need.
Regards,
JaiShankar -
Sender file adapter - content conversion question
Hi all
We have a .csv file to be passed to XI that has column headings as well. Is there a way of stripping the header using "Content conversion". We declared the RecordsetStructure as "header,1,item,*" but then it needs a keyFieldname and identifier which is obviously not available as the first line only has column headings.
Hoping for a reply soon.
Thanks
SalilSalil,
In RecordsetStructure you define as header,1,item,9999999999. But if you have more than 9999999999 records then the extra records after this will come as a second file.
If you expect more item records then increase the number of 9's. Then we dont need to give the key field.
---Satish -
Sender File Adapter-Content conversion for a tab delimited file
Hi all,
I have a FIle to IDoc scenario, where the File is with the structure Header,Detail,Trailer.
Header and Trailer are with fixed field lengths, whereas the detail records are tab delimited.(Functional spec says delimited by H'05').
I have given the parameters as follows:
Header.keyFieldValue H
Header.fieldFixedLengths 1,1,4,1,8
Header.fieldNames a,b,c,d,e
Header.endSeparator 'nl'
Detail.fieldNames a,b,c,d,e,f
Detail.fieldSeparator '0h05'
Detail.keyFieldValue LOA
Detail.endSeparator 'nl'
Trailer.fieldFixedLengths 1,1,8
Trailer.fieldNames a,b,c
Trailer.keyFieldValue T
ignoreRecordsetName true
In SXMB_MONI, I get the payload with just the Header and Trailer and not the detail records, even though my file has so many records in it.I m pretty sure, this happens because of my Detail.fieldSeparator parameter.
Can anyone please help me with this?What is the correct value for this parameter?
Thanks a lot in advance!
Anjana.first of all make sure with a hex editor that the hex code of the delimiter sign is really 05. This is an odd character, as the normal tab is hex 09.
when you have confimred it, check online help for file adapter config for the correct entry of hex codes. I think it is something like '0x05',
Edited by: Stefan Grube on Feb 10, 2011 6:43 PM -
Sender Mail Adapter with SAP Conversion agent
have some1 used SAP conversion agent on attchment from XI Sender Mail adapter?
it seems to ignore the attchment of the e-mail
the sender configuration module tab is as follows :
1.localejbs/AF_Modules/PayloadSwapBean transform
2.localejbs/sap.com/com.sap.nw.cm.xi/CMTransformBean CM
3.sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean mail
The paramters are
transform swap.keyName Content-Disposition
transform swap.keyName Content-Description
transform swap.keyValue attachment
transform swap.keyValue codeco
CM TransformationName ZIM_CODECO_VALIDATIONS
The Convesion Agnet runs prefectly when using the Conversion Agent engine
thx,Shai Rosenzweigcheck with tis may helpful for you
http://help.sap.com/saphelp_nw04/helpdata/en/43/4c38c4cf105f85e10000000a1553f6/frameset.htm
Regds
Abhishek -
Sender Mail Adapter - forcing content as an attachement
Hi all,
We are using the Sender Mail Adapter to pull emails from the inboxes of some users of an exchange server. We use the Mail Package option.
We have noticed that the content of the emails are by-default added as attachments when there are no real attachments to the emails. However the content is not added as an attachment when one or more attachments are present in these emails.
Is there a way of forcing the Sender Mail Adapter to always add the content as an attachment and keeping the other attachments as well? and of course maintain the Mail Package message type as the main payload...?
Many thanks,
AldoHi Stefan,
Thanks for your reply. I am glad to hear that I am wrong again )
In your opinion is it possible to force the Outlook Exchange server to add the content attachment every time? I mean by doing some configuration on it...?
The reason why we would like to do this is because when - in the content tag of a Mail Package message - we have MIME message parts that are of content-type text/html we are having problems in decoding the html back to a readable format.
To do this we use the apache QuotedPrintableCodec Java class.
This works fine when the content type of the message is just text/plain but we get an exception when we try with text/html.
The exception we get is:
org.apache.commons.codec.DecoderException: Invalid URL encoding: not a valid digit (radix 16): 13
I don't know if this is because of the two character sets we have in the payload (utf-8 and iso-8859-1) or if it is for other reasons...
If you could help me figure out how to forward any HTML email to another system in a readable format it would be great.
Thanks for your support,
Aldo -
Sender Mail Adapter Attachment
Hi All
The mail I get from the 3rd party has a body and attachment. I have done the TRANSORM module as described in some of the forums, and then the Plain2XML.
On sxmb_moni I see the MailMessage and MailAttachment-1, where the MailMessage is in XML format and MailAttachment in normal text. What should I do to completely ignore the MailMessage(body of the mail) and just send MailAttachment to the receiver.
I have tried to split the message to two receivers, but because the attachment message does not transform to xml, it gives me a mapping error. Is there anyway I can either ignore the body and just send the attachment to the receiver without doing JAVA code.
Thanks in advance
ClintonHi Jin
Thanks for your answer.
This is how I am using the module within the Sender Mail Adapter.
localejbs/AF_Modules/PayloadSwapBean TRANSFORM
localejbs/AF_Modules/MessageTransformBean Plain2XML
TRANSFORM swap.keyName Content-Description
TRANSFORM swap.keyName Content-Disposition
TRANSFORM swap.keyValue attachment;filename="MailAttachment-1.xml"
TRANSFORM swap.keyValue MailAttachment-1.xml
Plain2XML Transform.Class com.sap.aii.messaging.adapter.Conversion
Plain2XML Transform.ContentType text/xml;charset=utf-8
Plain2XML xml.conversionType SimplePlain2XML
Plain2XML xml.documentName MT_TEBA_Contractor_Details
Plain2XML xml.documentNamespace http://lonmin.co.za/TEBA_to_SAP
Plain2XML xml.fieldNames ENG_TYPE,INDUST_NO,COMPANY_NUMBER,SURNAME,INITIALS,NAME,REGISTERED,MALE,EXPERIENCE,RACE,MARITAL,DEPENDENTS,BIRTH_DATE,LANGUAGE,EDUCATION,SPOUSE,RELIGION,OFFICE,SERIAL_NO,REG_YEAR,SERV_START,SERV_EXPIRE,SERV_PER,LAST_CHANGE_DATE,LAST_CHNAGE_TIME,ID_DOC,ID_EFF_DATE,ID_EXP_DATE,PASSPORT,PASS_EFF_DATE,PASS_EXP_DATE,COUNTRY,DISTRICT,ADDR1,ADDR2,ADDR3,POSTCODE,PHONE,BI_1733_NO,REASON
Plain2XML xml.fieldSeparator |
Plain2XML xml.processFieldNames fromConfiguration
Plain2XML xml.structureTitle Details
Using it like this it does not do the swap correct and it still put the data within the body as xml, and leave the attachment as txt.
Can you see something wrong here.
Thanks
Clinton -
Sender mail adapter - attachment name
Hi there
We have configured a sender email adapter to receive text/csv attachments and save them to a file system. What we are having a problem with is reading the attachment name. So we are using Dynamis Configuration to create the file name using the subject line - Which is not ideal. Ideally we would like to use the same name as the origianl attachment but haven't found any way of doing that. We even tried using Content-type in the Variable Header (XHeaderName1) suing variable transport binding but it doesn't show up in the Dynamic Config part of the SOAP message.
Is there any way of reading the name of the file attachment? We are on PI release 7.0.
Any help would be appreciated.
Cheers
SalilHi Vitor
There are 2 scenarios that I can think of -
1. You are saving the email attachment as a file. In that case use step 3 in the earlier reply to get the attachment name and save the file witht that name.
2. You are sending the XML straight to a receiver using HTTP, IDOC, JDBC etc. in which case you would need the attachment name much earlier that step 3. For that I guess you would have to write another adapter module on the sender mail adapter(at Position 3 where position1 = payloadswap bean, 2 = custom module to get the attachment name) and add an xml tag to your incoming message. These adapter modules are really powerful and are like user exits in ABAP. In that case you would have to change the Data Type in the Integration repository to reflect that extra tag. Here is some code from a module we wrote to totally change the structure of the xml coming in. The key thing to remember is this module is that you can read the whole message byte by byte. There might be smarter ways of doing it (like using the SAP XML parser factory class) but since I'm not a Java programmer I stuck to the basics. Here's the code( you could also look at the example given in sap help where they remove (or add I'm not sure) CR(carriage return) from CRLF (CR Line feed).
Created on Aug 8, 2007
To change the template for this generated file go to
Window>Preferences>Java>Code Generation>Code and Comments
package jdbcPackage;
import javax.ejb.CreateException;
import javax.ejb.SessionBean;
import javax.ejb.SessionContext;
import com.sap.aii.af.mp.module.*;
import com.sap.aii.af.ra.ms.api.*;
@author Salil.Mehta Soltius NZ Ltd
To change the template for this generated type comment go to
Window>Preferences>Java>Code Generation>Code and Comments
public class jdbcClass implements SessionBean, Module {
private SessionContext myContext;
public void ejbRemove() {
public void ejbActivate() {
public void ejbPassivate() {
public void setSessionContext(SessionContext context) {
myContext = context;
public void ejbCreate() throws CreateException {
public ModuleData process(
ModuleContext moduleContext,
ModuleData inputModuleData)
throws ModuleException {
// put your code here
try {
Message msg = (Message) inputModuleData.getPrincipalData();
XMLPayload payload = msg.getDocument();
String payEnc = payload.getEncoding();
byte[] payByte = payload.getContent();
byte[] payByteOut = new byte[payByte.length];
byte[] payByteTemp = new byte[payByte.length];
int i;
int j;
int actualCount = 0;
char xmlTagFound = ' ';
char endXmlTagFound = ' ';
char tagFound = ' ';
System.arraycopy(payByte, 0, payByteTemp, 0, payByte.length);
// Step 1 - Conversions
// convert "< to <" and "> to >"
// convert " to "
// This will remove any carriage returns and line feeds
// and the <XML* and </XML* tags plus the <row> and </row> tags
for (i = 0; i < payByte.length; i++) {
// convert < to < and > to >
if (payByteTemp<i> == '&') {
if (payByteTemp[i + 1] == 'l') {
if (payByteTemp[i + 2] == 't') {
if (payByteTemp[i + 3] == ';') {
payByteTemp<i> = '<';
payByteTemp[i + 1] = '\n';
payByteTemp[i + 2] = '\n';
payByteTemp[i + 3] = '\n';
if (payByteTemp<i> == '&') {
if (payByteTemp[i + 1] == 'g') {
if (payByteTemp[i + 2] == 't') {
if (payByteTemp[i + 3] == ';') {
payByteTemp<i> = '>';
payByteTemp[i + 1] = '\n';
payByteTemp[i + 2] = '\n';
payByteTemp[i + 3] = '\n';
if (payByteTemp<i> == '&') {
if (payByteTemp[i + 1] == 'q') {
if (payByteTemp[i + 2] == 'u') {
if (payByteTemp[i + 3] == 'o') {
if (payByteTemp[i + 4] == 't') {
if (payByteTemp[i + 5] == ';') {
payByteTemp<i> = '"';
payByteTemp[i + 1] = '\n';
payByteTemp[i + 2] = '\n';
payByteTemp[i + 3] = '\n';
payByteTemp[i + 4] = '\n';
payByteTemp[i + 5] = '\n';
// This will take in the initial xml declaration from the Byte array
// And we also don't want the stuff after the xml declaration till
// we reach the first <row> tag
if (xmlTagFound == ' ') {
if (payByteTemp<i> == '>') {
xmlTagFound = 'X';
payByteOut[actualCount++] = payByteTemp<i>;
if (xmlTagFound == 'X') {
payByteOut[actualCount++] = '\r';
continue;
if (xmlTagFound == 'X') {
if (payByteTemp<i> == '<') {
if (payByteTemp[i + 1] == 'r') {
if (payByteTemp[i + 2] == 'o') {
if (payByteTemp[i + 3] == 'w') {
if (payByteTemp[i + 4] == '>') {
xmlTagFound = 'Y';
} else {
continue;
} else {
continue;
} else {
continue;
} else {
continue;
} else {
continue;
// Carriage return and line feed
if ((payByteTemp<i> == '\r') || (payByteTemp<i> == '\n')) {
continue;
// <XML_*> tag
if (payByteTemp<i> == '<') {
if (payByteTemp[i + 1] == 'X') {
if (payByteTemp[i + 2] == 'M') {
if (payByteTemp[i + 3] == 'L') {
tagFound = 'X';
endXmlTagFound = ' ';
continue;
// </XML_*> tag
if (payByteTemp<i> == '<') {
if (payByteTemp[i + 1] == '/') {
if (payByteTemp[i + 2] == 'X') {
if (payByteTemp[i + 3] == 'M') {
if (payByteTemp[i + 4] == 'L') {
tagFound = 'X';
endXmlTagFound = 'X';
continue;
// <row> tag
if (payByteTemp<i> == '<') {
if (payByteTemp[i + 1] == 'r') {
if (payByteTemp[i + 2] == 'o') {
if (payByteTemp[i + 3] == 'w') {
if (payByteTemp[i + 4] == '>') {
tagFound = 'X';
continue;
// </row> tag
if (payByteTemp<i> == '<') {
if (payByteTemp[i + 1] == '/') {
if (payByteTemp[i + 2] == 'r') {
if (payByteTemp[i + 3] == 'o') {
if (payByteTemp[i + 4] == 'w') {
if (payByteTemp[i + 5] == '>') {
tagFound = 'X';
continue;
if ((payByteTemp<i> == '>') && (tagFound == 'X')) {
tagFound = ' ';
continue;
if (tagFound == ' ') {
if (endXmlTagFound == 'X') {
continue;
payByteOut[actualCount++] = payByteTemp<i>;
byte[] payByteExp = new byte[actualCount];
System.arraycopy(payByteOut, 0, payByteExp, 0, actualCount);
payload.setContent(payByteExp);
msg.setDocument(payload);
inputModuleData.setPrincipalData(msg);
} catch (Exception e) {
ModuleException me = new ModuleException(e);
throw me;
return inputModuleData; -
Sender Mail adapter encounters MalformedInputException
I have a sender mail adapter that processes the attached .csv file. All is working fine. I use FCC in module to convert the attachment and pass to an IDOC adapter for processing in SAP system.
My problem is sometimes the sender mail CC fails with ...........
exception caught during processing mail message[1]; com.sap.aii.af.mp.module.ModuleException: Transform: failed to execute the transformation: com.sap.aii.messaging.adapter.trans.TransformException: Error converting Message: 'sun.io.MalformedInputException'; nested exception caused by: sun.io.MalformedInputException caused by: com.sap.aii.messaging.adapter.trans.TransformException: Error converting Message: 'sun.io.MalformedInputException'; nested exception caused by: sun.io.MalformedInputException
It only fails with some files. At the moment when we test we FORWARD the email to our email account. If I detach the failed email attachment and attach it to a NEW email it will then work.
So why does it not work when forwarding emails? But it works when I attach the same file to a new email and send?
Other threads for this error seem to point to encoding. But how do I know which to use. I currently use the following in my module config:
Transfer.ContentType application/octet-stream;charset="ISO-8859-1"I have this in my configuration:
localejbs/AF_Modules/PayloadSwapBean on local
TRANSFORM
localejbs/AF_Modules/MessageTransformBean on local
txtxml
TRANSFORM swap.keyName payload-name
TRANSFORM swap.keyValue MailAttachment-1
txtxml Transfer.ContentType application/octet-stream;charset="ISO-8859-1"
txtxml Transform.Class com.sap.aii.messaging.adapter.Conversion
txtxml Transform.ContentDescription MailAttachment-1
txtxml Transform.ContentDisposition attachment;filename="MailAttachment-1.bin"
txtxml xml.conversionType SimplePlain2XML
txtxml xml.documentName MT_BCD_INVOICES
txtxml xml.documentNamespace urn://federalmogul.com/BCDTRAVEL/FINGLOBCD001/00
txtxml xml.fieldNames COST_CENTRE,EMPLOYEE_ID,PRODUCT_GROUP,COMP_CODE,BCD_ACCOUNT,INVOICE_DATE,TRAVELER_NAME,TRAVELER_FIRST_NAME,INVOICE_NO,AMOUNT_EXCL_VAT,CURRENCY1,AMOUNT_VAT,CURRENCY2,AMOUNT_DOC_CURRENCY,CURRENCY3
txtxml xml.fieldSeparator ;
txtxml xml.lastFieldsOptional YES
txtxml xml.processFieldNames fromConfiguration
txtxml xml.structureTitle RECORDSET -
Sender "Mail" adapter - CSV file attachment
Hi there
I'm looking for some help in configuring a sender mail adapter that receives ".csv" files. I did read some blogs that mention using the "PayloadSwapBean" module to read the mail attachment instead of the mail content. My problem is to now convert the ".csv" file into a message. Is there a module that I can use ( is it the "MessageTransfomBean" ) and how. Any help would be appreciated.
Thanks
SalilHi Salil,
If you want to send a mail with a body and attachments, the message sender HAS to provide an XI message with attachments. I doubt a CSV file does justice.
As Renjith said you need to convert CSV to XmL.
A short description about the Standard Modules:
MessageTransformationBean is a standard module used to apply the XSLT mapping to the adapter module by using <i>Transform.class</i> ( This xslt mapping is done to create a mail package, Dont confuse with the actual mapping in your case this is NOT for converting csv to xml).
Also this module can be used to change the name and type of payloads by using <i>Transform.contentType</i>, <i>Transform.contentDisposition</i>, <i>Transform.contentDescription</i>.
PayloadSwapbean is a standard module for replacing payloads with other payloads (SWAP)
If you want to give each attachment a certain name use Parameters, <i>swap.keyname</i> for name of the payload and <i>swap.keyvalue</i>.
I Hope the use of standard modules is understood. -
Sender Mail adapter configuration with attachment
Hi,
I read the below blog regarding the mail adapter
/people/michal.krawczyk2/blog/2005/12/18/xi-sender-mail-adapter--payloadswapbean--step-by-step
I have the same requirement but the attachment file is not an XML, it is CSV file so in the module tab if I change like below is it enough?
TRANSFORM swap.keyValue attachment; filename=u201DMailAttachment-1.csvu201D (I think MailAttachment-1 is the file name, am I correct?)
If I change like above is it ok? or any other thing is required, Could you please give me the inputs
Thanks
RameshI have the same requirement but the attachment file is not an XML, it is CSV file so in the module tab if I change like below is
it enough?
PayloadSwapBean will ensure that the input to the mapping is from the attachment.....in the blog the attachment is in XML format and hence there was no need for any conversion.....yours is however a CSV file so you need to convert it to XML first and then do the further processing.....you can either use the MessageTransformationBean as shown in this blog:
/people/gabrielsagayaselvam.panneerselvam/blog/2009/08/31/solve-key-field-problem-using-structplain2xml-in-messagetransformationbean
Or write your own module code for the conversion.
Regards,
Abhishek. -
Sender Mail Adapter with PayloadSwapBean
Hello Experts!
I have a Sender Mail Adapter receiving emails with attachments! I'm using PayloadSwapBean, because I have to manipulate (to do mapping) the XML attachment.
Sender Mail Adapter Configuration:
Default Interface Namespace = urn:mynamespace.com
Default Interface Name = abs_async_myInterface
swap.keyName = Content-Disposition
swap.keyName = Content-Description
swap.keyValue = attachment;filename="MailAttachment-1.xml"
swap.keyValue = MailAttachment-1
Well, my problems are:
1) Although my Default Interface Namespace is urn:mynamespace.com, sometimes the namespace that cames to SXMB_MONI is http://sap.com/xi/XI/System/Mail. In that case, an Receiver Determination error happens.
2) My XML can be the first (MailAttachment-1), the second (MailAttachment-2), the third (MailAttachment-3), or any other attachment position. Since my swap.keyValue is set to "MailAttachment-1", I'm able to pick the XML only if it is the first attachment.Hi Julio,
Writing an Adapter Module for the same can make your task easy.
Thanks'
Sunil Singh
Maybe you are looking for
-
Hi, I have designed the GUI, which contains JTable. Every time the table is loaded with some values dynamically, after doing some operation. The table values are first stored in the vector and set to DefaultTableModel. The DefaultTableModel contains
-
Inventory Management (0IC_C03) Business Content queries
I have the following queries which are delivered when I activate 0IC_C03. The queries below have also been activated as part of the model. Is there any additional queries which should/can be activated against this InfoProvider and of the list below
-
A way to re-enable scroll bar buttons in Gnome (GTK) 3?
Is there a way to re-enable or add the scrollbar buttons (on the top and bottom of vertical scrollbars or on the left and right of horizontal scrollbars) in Gnome (GTK) 3?
-
Ampersands not being encoded in recordset paging
Trying to validate a page and it appears that the ampersands are not being encoded, thus not validating the page. When I create a link and use parameters the ampersands get encoded correctly, its just the next/previous links that don't appear to get
-
Missing description for FI standard values (ie posting key 40)
Hello, I'm deploying the SAP ECC6 Financials solution in French and I'm facing a very strange issue. The standard descriptions for some very classical SAP values are missing in my language (French). For instance, the french description is blank for a