Dynamic file name as mail attachment in receiver Mail Adapter?
Hi,
Can any one tell the possibility of attaching file as a mail attachment without using mail Package with dynamic filename.
Business requirement is to send error response as mail attachment with dynamic name.
Ex: Error_Response_20110802_13.24 where 20110802 is Date and next part represents time stamp.
File attachment name should change dynamically in Mail receiver Adapter. Thanks
Regards,
Sreeramulu Konjeti.
there is no standard way.
you will have to write a module to get this in place.
other ways are;
XI Mail Adapter: An approach for sending emails with attachment with help of Java mapping - /people/stefan.grube/blog/2007/04/17/xi-mail-adapter-an-approach-for-sending-emails-with-attachment-with-help-of-java-mapping
Dynamic name in the mail attachment - pseudo "variable substitution" :
/people/michal.krawczyk2/blog/2006/02/23/xi-dynamic-name-in-the-mail-attachment--pseudo-variable-substitution
Similar Messages
-
Dynamic file name of the attachment in receiver mail adapter
Hi
I have configured a receiver mail adapter which receives the payload as an xml attachment.
Right now the file name of the attachment is hardcoded to "invoice.xml".
I want to set it to dynamic ie. instead of "invoice.xml"... i want it as "invoice<invoicenumber>.xml".
Invoice number is present in the payload.
please suggest a solution w/o the need to develop a custom adapter module.
Thanks!
Regards,
Faria MithaniHi,
Go through this thread..
Dynamic File Name for Receiver File Adapter
Regards,
Sarvesh -
Dynamic file name of the attachment in sender mail adapter
Hi
I have configured a sender mail adapter which receives some attachments.
Right now the file name of the attachment is hardcoded to "MailAttachment-1" "MailAttachment-2" using the content-description from "AF_Modules/PayloadSwapBean" module.
I want to set it to dynamic ie. instead of "MailAttachment-1"... i want it with real name of the attach.
please suggest a solution w/o the need to develop a custom adapter module.
Thanks!
Regards,
Mariano.Thanks Prateek,
Now, i can see that the name of the original file is into the content type named as text/xml; name"name of the file.xml" when i send the email from outlook.
If i send it from hotmail, this is not happend.
Do you know why happend this?
If i always would have the original name inside the content type, my problem will be solved.
Edited by: Mariano Vidal on Feb 13, 2009 2:26 PM -
Mail Receiver adapter - dynamic file name without mail package
I know that we can get the dynamic attachment name using mail package... As per the FAQ Mail adapter, the Mail package use is deprecated and hence we do not want to go that route.
I have seen the following wiki entry for setting the file attachment name...
http://wiki.sdn.sap.com/wiki/display/XI/Adapter%20Module%20PI%207.0%20Set%20Attachment%20Name?bc=true
Is this the only approach to dynamic attachment name using Mail adapter (and without Mail package). Or a different approach without Adapter module is possible?There is a different approach without using mail package or adapter module.
Have a look at this Wiki:
http://wiki.sdn.sap.com/wiki/display/ESOAInfrastructure/Dynamic+Email+Attachment+name+for+Received+Mails+with+ASMA+and+without+using+mail+package -
Setting up the File Name of email Attachment from Received File Name
Hello All,
I have to send the Received File in attachment to an Email if there is any exception. Here I can attach the file, but I cannot set the file name of attachment as the Received File Name. Is there anyway of doing this without using custom pipeline component.
Here I am using the Orchestration and SMTP Adapter.Any help is greatly appreciated.
ThanksIt might work if you use a custom pipeline component on your send port and in the Execute method populate the MIME.FileName property of the body part.
Something like:
public IBaseMessage Execute(IPipelineContext pc, IBaseMessage inmsg)
string filename = inmsg.Context.Read("ReceivedFileName", "http://schemas.microsoft.com/BizTalk/2003/file-properties");
inmsg.BodyPart.PartProperties.Write( "FileName", "http://schemas.microsoft.com/BizTalk/2003/mime-properties", "filename);
return inmsg;
You can take reference from similar post here
SMTP - Setting attachment filename
Anther good article with MIME is here
Setting attachment filename with the SMTP Adapter
For MIME case your SMTP message construct statement would be like below
multipartMessage.MessagePart_1= InMSG;
multipartMessage.MessagePart_2="This is message part2 as a string";
multipartMessage(SMTP.Subject) ="Email From Dynamic Port";
multipartMessage(SMTP.From) ="[email protected]";
multipartMessage(SMTP.SMTPHost) ="yoursmypserver.com";
multipartMessage.MessagePart_2(MIME.FileName) = "Attachment_Name";
multipartMessage(SMTP.SMTPAuthenticate) =0;
Thanks
Abhishek -
Dynamic File Name attachment in Mail Adpater
Hi All,
We have Requirement where we need attach file with Dynamic Names in mail adapter PI7.0 .Right now we are using some of the modules to genarate file attachement with hard coded value for name of the file.
Java beans we are using are
localejbs/AF_Modules/StrictXml2PlainBean
localejbs/AF_Modules/MessageTransformBean
localejbs/AF_Modules/TextCodepageConversionBean
sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean
Please let us know how we can acheive this.
Thanks,
MadhuHi Madhusudhan,
File attachment with the dynamic name is possible by using the Adapter module as well as without the Adpater module through coding.
let me know which kind of attachment you want in mail and which is your sending system (like SAP R/3)?
Thanks & Regards
Jagesh -
Error dynamic File Name in Receiver File Adapter
Hi all,
Dynamic file name for Receiver file Adapter Problem
my multi mapping look like this in design mode
messages
message1
SD01_E
FileName
row
message2
SD02_E
FileName
row
by processing the xml look like this:
<ns2:SD01_E xmlns:ns2="urn:lsv.de/SAP/XXX">
<FileName>L40SA939.xiConstant</FileName>
- <row>
or
<ns2:SD02_E xmlns:ns2="urn:lsv.de/SAP/XXX">
<FileName>L40SA939.xiConstant</FileName>
- <row>
in file receivere adapter i have try this but it dos not work
payload:SD01_E,1,FileName,1
Error:com.sap.engine.lib.xml.parser.ParserException: XMLParser: No data allowed here: (hex) 0(:main:, row:1, col:0)
is there any way to have access to Filename in different root elements??
regards
RalfHi Ralf,
i think, you need for each XML msg (each different root element) a new adapter -> a new IF determination, new rec agreement and a new channel.
Regards,
Udo -
Xml file in dynamic file name in file receiver adapter
Hi,
I'm doing the dynamic file name in file receiver adapter. I have done as per instructed in /people/jayakrishnan.nair/blog/2005/06/20/dynamic-file-name-using-xi-30-sp12-part--i
All turned out okay. I have got the file name I require. Except that the file format is XML and I need to suppress the filename node occupied by the dynamic file name.
The content conversion mentioned in /people/sravya.talanki2/blog/2005/08/11/solution-to-the-problem-encountered-using-variable-substitution-with-xi-sp12, does not seem to solve my problem. As it is only for file format other than the XML one, because we only do the content conversion if we want to "convert" the format of the content from XML to the other format.
Does anybody have the solution to my problem? thanks in advanceThank you Raj for the direction
The way to do it is :
1. In ID, advanced tab, put a check on the adapter-specific message attributes - file name.
2. Put a "*" on the file name scheme
3. In IR, create a UDF to set up target file name :
DynamicConfiguration conf = (DynamicConfiguration) container
.getTransformationParameters()
.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
// set up file name for receiver adapter
String SourceFileName = conf.get(key);
conf.put(key, TargetFileName);
return " ";
4. Map the above UDF to the header level of the target structure.
Regards,
Idi -
How to give a dynamic File Name for Receiver File/FTP Adapter.
Hi Experts,
I have one scenario in which we are creating a flat file of IDOC which is coming from R/3 & sending it to FTP location. For this we have configured Receiver FTP adapter with File Name Scheme as "NT.out" & in File Consturction mode i have given as "Add Time Stamp".
therfore while creating a file it is creating as NTyyyyMMdd-HHmmss-SSS.out
where as my requirement is only to to add Time & not the Date. (NThhmmss.out)
How to do this ?
for your info we are using ABAP Mapping.
Pl help me
Regards,
UmeshHi Umesh,
Add one more field to your target structure for your file name and populate that field as per your requirement like NTyyyyMMdd.out. In receiver communication channel use Variable subtiution option and give the refrence of Payload and file construction mode set as create.
And refer the below weblogs for Variable Subtiutuion File Name Scheme
/people/jayakrishnan.nair/blog/2005/06/20/dynamic-file-name-using-xi-30-sp12-part--i - Dynamic File Name Part 1
/people/jayakrishnan.nair/blog/2005/06/28/dynamic-file-namexslt-mapping-with-java-enhancement-using-xi-30-sp12-part-ii - Dynamic File Name Part 2
Hope this way would be solve u r problem.
Cheers
Veera
>>>Reward points, if it is needful -
Dynamic file name in receiver channal
Hi, All,
I would like to set dynamic file name in receiver channal. My xml payload will be like this:
<file_name>file1.txt</file_name>
<text_content>balabala......</text_content>
I would like to output an text file which text content will be the value of <text_content>, file name will be the value of <file_name> in the xml payload.
Is there anyone could help me?
Helpful answer will be surely awarded. Thanks
YangPlease look at the below description from help.sap.com. You can use the below steps to name the file from a value in the payload. You would have to use File Content Conversion to insert the value of the <text_content> in the file.
Variable Substitution (Target Directory/File Name Scheme)
If you set the Enable indicator, you can enter variables for the Target Directory and File Name Scheme. Enter the names of the variables and references in the table.
● Enter each variable that you reference in the Target Directory and File Name Scheme fields without the surrounding percentage sign under Name of Variables in the table.
The variables can refer to attributes of the message header or elements of the message payload.
○ If the variables are to refer to an attribute of the message header, add the prefix message: to the name of the variable under Reference. You can specify the following attributes of the message header:
sender_party, sender_service, receiver_party, receiver_service, interface_name, interface_namespace,
message_id (message ID with hyphens, for example 9fbe1ff1-9a0d-11d9-8665-cbf10a126331)
message_id_hex (message ID in hexadecimal format, for example 9fbe1ff19a0d11d98665cbf10a126331)
For example, if you want to specify the interface name from the message header in the target directory or in the file name scheme, enter message:interface_name as the reference.
If one of the message attributes contains characters that are not permitted in a file name, for example \, /, :, *, ?, ", <, >, |, then these characters are replaced by an underscore ("_").
○ If the variable refers to an element in XML schema, add the prefix payload: to the information under Reference. The reference then comprises a pseudo path description in the form of a comma-separated list with the schema namea,na,nameb,nb,....
namea,nameb,...corresponds to the element name and na,nb,... corresponds to the occurrence of the element name at the respective level in the document.
The description begins at the root of the document and ends at the respective element.
To reference the element that is in bold in the example, the following expression is used: payload:root,1,e1,1,e2,2
The parser searches for the first occurrence of the root element at the first level. It then searches for the first occurrence of e1 at the second level and for the second occurrence of e2 at the third level. The content of the last element (u201CExample Valueu201D) is set as the value for a specified variable.
<?xml version="1.0" encoding="UTF-8" ?>
<root>
<dummy>
<e1>
<e2>Data_1</e2>
<f/>
<g attr="abc">text</g>
<e2>Data_2</e2>
</e1>
</dummy>
<e1>
<e2>illegal/value</e2>
<f/>
<g attr="abc">text</g>
<e2 attr="fghij">Example Value</e2>
</e1>
</root>
Thanks
Praveen M -
Dynamic File Name on Receiver Side using XSLT mapping
Hi,
My scenario is a Proxy to File scenario.The File on the receiving side is a TEXT file generated due to XSLT mapping. The file name has to be dynamic like- TEST<DDMMYYHHMMSS>File.DAT.
If somebody knows how to do the same please help.
Regards
RituHi Ritu,
I agree to Krishna.With your XSLT mapping create a XML output which can be converted to a text file with content conversion.
And for the dynamic file name, i guess its the date that matters which needs to be in DDMMYYHHMMSS format. the same can be accomplished by a Java function and calling it in your XSLT .
Do refer this weblog it will help you accomplish the same.
>>> /people/pooja.pandey/blog/2005/06/27/xslt-mapping-with-java-enhancement-for-beginners
Regards,
Shabarish -
Dynamic file name in communication channel
hello
is it possible to give in the communication channel, under the 'File Access Parameters', a dynamic file name?
to get it out of a table or something?
Thanks
KfirHi,
Yes its bit possible to use the dynamic file name at File access paramters
The dynamic filename generation concept is as follows.
In your filename field. just give a variable with % symbols. (eg: %file% ).
Now, under the option Variable Name Substitution, you can give how the value has to be created.
It can be your interface name, sender service name, etc or it can be some value dynamically from your payload.
For the former, your give
message:interface_name ,etc
and for the payload part you give,
Payload: "your element root which u wanna acecss"
Just check this link out,
http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
And read the contents under variable substitution and it will help you understand the concepts better.
If you have any clarifications, do get back,
Refer below links for more in depth details about it
Re: Dynamic file name in Receiver File Adapter
http://help.sap.com/saphelp_nw2004s/helpdata/en/21/6faf35c2d74295a3cb97f6f3ccf43c/frameset.htm
/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
/people/sap.user72/blog/2005/10/01/xi-new-features-in-sp14
/people/jayakrishnan.nair/blog/2005/06/20/dynamic-file-name-using-xi-30-sp12-part--i
/people/jayakrishnan.nair/blog/2005/06/28/dynamic-file-namexslt-mapping-with-java-enhancement-using-xi-30-sp12-part-ii
/people/michal.krawczyk2/blog/2006/02/23/xi-dynamic-name-in-the-mail-attachment--pseudo-variable-substitution
http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
Check out this URL
http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
Check these weblogs as well...
/people/sravya.talanki2/blog/2005/08/11/solution-to-the-problem-encountered-using-variable-substitution-with-xi-sp12
/people/sameer.shadab/blog/2005/09/23/an-interesting-usage-of-variable-substitution-in-xi
Thanks
Swarup -
Dynamic file name from messsage payload
Hi Friends,
My requirement is to read one .xml file , which has Purchase Order deatails and place .html file on receiver side, we are using XSLT for mapping.
The file name should be "POnumber.html " , i've gone through below but couldn't get much
http://help.sap.com/saphelp_nw04/helpdata/en/43/03612cdecc6e76e10000000a422035/content.htm
Can any one send the that code , and steps to add that code in side XSLT.
Thanks
JohnHi,
With above links
/people/jayakrishnan.nair/blog/2005/06/20/dynamic-file-name-using-xi-30-sp12-part--i - Dynamic File Name Part 1
/people/jayakrishnan.nair/blog/2005/06/28/dynamic-file-namexslt-mapping-with-java-enhancement-using-xi-30-sp12-part-ii - Dynamic File Name Part 2
See in the below Michal blog , how to conver the file as html , take that part only.
/people/michal.krawczyk2/blog/2005/11/23/xi-html-e-mails-from-the-receiver-mail-adapter
Regards
Chilla -
Dynamic file name inside the ZIP file
Hi Experts,
I have done proxy to file scenario, reciever side is the file ZIP file, i have done successfully done Zip file using adapter modules in Communication Channel.
The file name is hard coded like this.
contentType-----Transform.ContentType--
text/plain;charset="UTF-8";name="Billing.txt"
Is there any possible to do dynamic file name instead of hardcoded like add time stamp.
Kind Regards,
Praveen.hi,
you can always do it using an adapter module like shown in my blog:
/people/michal.krawczyk2/blog/2006/02/23/xi-dynamic-name-in-the-mail-attachment--pseudo-variable-substitution
Regards,
Michal Krawczyk -
Hi,
I am following this blog to name the target file/directory dynamically at the runtime :
/people/sameer.shadab/blog/2005/09/23/an-interesting-usage-of-variable-substitution-in-xi
But I am getting this error in the CC monitoring :
Could not process due to error: com.sap.aii.adapter.file.configuration.DynamicConfigurationException: Error during variable substitution: com.sap.aii.adapter.file.varsubst.VariableDataSourceException: Unknown message header category 'interface_name ' for variable 'var1'.Hi,
Try following this weblog for dynamic file name.
/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
Dynamic filename come under the Dynamic configuration in moni, for your messages.
This is the code used inside.
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
String ourSourceFileName = conf.get(key);
return ourSourceFileName;
That is why Dynamic configuration is coming in output.. It is a class to generate dynamic configuration file at runtime provided by SAP XI.
Hope this will help you.
regards
Aashish Sinha
PS : reward points if helpful
Maybe you are looking for
-
Can I share my apple calendar with an android user?
Can I share my apple calendar with an android user? I use Apple products and my partner uses Android products i.e Samsung Galaxy S3. We want to share our calendars with each other.
-
Today my iPod touch (3rd gen) fell onto the floor and the screen turned black. It was almost put of battery anyways so I wasn't exactly worried.... But when I tried to turn it back on it wouldn't. It wouldn't hold a charge. I tried hooking it up to t
-
Library items in DWT templates
I have setup a dynamic menu and created a library item from it. When I insert it into a new document (or update the library item) the urls within it keep getting the prefix /library/ added and so don't work: original menu =========== <div id="lhsidem
-
Safari and Itunes quit unexpectedly
Hey everyone, Both Safari and Itunes when I try opening them quit unexpectedly. I tried resetting Safari- no changes. I repaired the Disk- no changes. Below is the report from safari. If anyone can help- I'd appreciate it! Thanks!! Date/Time: 2010-02
-
Restoring IPhone in Recovery mode
I'm trying to restore my iphone because it said I can not receive or make any calls and I need to restore it because it's in recovery mode (no idea on what that means). So iI began the process of restoring it. It "extracts software" but then the ipho