Payload as File name at Receiver File Adapter
Hi All,
I have a requirement for a PROXY to File Scenario where Receiver files has to be named dynamically with a value from the Payload that I get. Also the particular field that has the file name should be unmapped with the Receiver.
For Example,
<row>
<Name>Alex</Name>
<DOB>27062014</DOB>
<City>Delhi</City>
</row>
If this is the Payload I get, I want the Receiver file name to be "27062014.txt". At the same time this particular field should not be mapped at the Receiver end.
I have tried a few links which confuse me further.Kindly help me,
Thanks in advance,
Sree Ram
Hi Sree,
Please check if the case is correct. refer the below discussion
Problem in variable substitution
reference blog for variable substitution
Variable Substitution for Directory or File name.
regards,
Harish
Similar Messages
-
How can i get message id as file name in Receiver Mail Adapter
Hi All,
We are working on file to mail scenario. Client requirement is " Attached file name should be the message id" How can we achieve this.
Thanks & Regards,
PurshothammHi,
To have the file name as message id, I think the below blogs can help you
/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
/people/jayakrishnan.nair/blog/2005/06/28/dynamic-file-namexslt-mapping-with-java-enhancement-using-xi-30-sp12-part-ii
Regards,
Vijay N -
Zipping the payload using File adapter
Hi Experts,
I have a 620 MB xml file, which need to be archived on daily basis.
but the XI server shows 503 service unavailable message, while trying to process the huge file.
also used the Zippayloadbean module in the file adapter, but no luck.
Please suggest on how to archive 620 MB xml file.
Thanks in advance.Hi mk,
I know that there is a bean for the adapter module that unzips attachments. Have a look if there is a module for zipping.
Zip or Unzip your Payload with the new PayloadZipBean module of the XI Adapter Framework
/people/stefan.grube/blog/2007/02/20/working-with-the-payloadzipbean-module-of-the-xi-adapter-framework
and check the CASE 2 in this blog:
/people/michal.krawczyk2/blog/2007/02/08/xipi-command-line-sample-functions
Regards Mario -
Dynamic attachment name in receiver mail adapter for 1 attachment?
Hi,
seems to be a tricky thing....
The sender interface (file) picks up an xml file and a pdf document.
The receiver wants to get the xml file as a txt file and the pdf, both sent together by mail.
We are following this thread:
"Sending multiple attachments winthin a single Receiver Mail adapter in required format".
So far we are able to generate the txt file and send it together with the pdf to the recipient.
The txt file gets its name from the payload of the xml file.
Unfortunately the pdf should be renamed to the same name as the txt file.
And here we are stuck.
We generate the filename for the txt file in the mapping to the mail message (as usual ximail30.xsd).
But for the pdf we are only able to set a static name in the channel module page using
Transform.ContentDisposition.
Any ideas how to solve this are really welcome!!!!
(Solutions that do not talk about using a new module to be written are prefered.)
Regards
DirkHi,
seems to be a tricky thing....
The sender interface (file) picks up an xml file and a pdf document.
The receiver wants to get the xml file as a txt file and the pdf, both sent together by mail.
We are following this thread:
"Sending multiple attachments winthin a single Receiver Mail adapter in required format".
So far we are able to generate the txt file and send it together with the pdf to the recipient.
The txt file gets its name from the payload of the xml file.
Unfortunately the pdf should be renamed to the same name as the txt file.
And here we are stuck.
We generate the filename for the txt file in the mapping to the mail message (as usual ximail30.xsd).
But for the pdf we are only able to set a static name in the channel module page using
Transform.ContentDisposition.
Any ideas how to solve this are really welcome!!!!
(Solutions that do not talk about using a new module to be written are prefered.)
Regards
Dirk -
Dynamic attachment name with receiver mail adapter and use mail package
We need to send mapped XML payload as attachment (with dynamic name) to a recepient (recepient email id is part of input xml payload, but not part of the mapped XML payload).
I could probably do this using the adapter module (as per the following link),
http://wiki.sdn.sap.com/wiki/display/XI/Adapter%20Module%20PI%207.0%20Set%20Attachment%20Name?bc=true
I would like to explore if this would be feasible using Mail package and XI payload.I already have a Java mapping that is converting the input XML to required Output format. If I am using Mail package (XI Payload), how do I go about sending this Output XML from java mapping as attachment to email id available in the input payload?Hi,
1) XML payload as attachment (with dynamic name)
2) recipient (recipient email id is part of input xml payload, but not part of the mapped XML payload)
These two is possible by using Mail Package. You have a standard xsd for mail package which you can download from the SAP Note 748024.
The xml created in you java mapping which will be your attachment should be put into the <content> tag of the mail package xml structure. and the file name can be set in the <Content_Type> tag.
<?xml version="1.0"; encoding="UTF-8"?>
<p2:Mail xmlns:p2="http://sap.com/xi/XI/Mail/30">
<Subject>My Invoice</Subject>
<From>from email address<;/From>
<To>to email address</To>
<Content_Type>text/plain;name="MyFile.csv";</Content_Type> --> file name here
<Content>123;A49;aaa</Content> -> attachment xml here
</p2:Mail>
And you have to select MailPackage in the receiver mail adapter.
Regards,
Aravind -
Table name in Receiver JDBC Adapter
Hi All,
I am using receiver JDBC adapter.
But table name consist of " like BPC."#II" .
After mapping table name becomes BPC."#II" .
I am getting error while pulling data from DB.
Is the table name creating a problem.
Please remedy of this if you have come across such scenario.
Regards
PiyushHi Piyush,
All that i could get from the SAP Help regarding JDBC Adapters are these links where i never found anything much regarding the table name.anyways just go through these links and see if you find anything useful.
http://help.sap.com/bp_bpmv130/Documentation/Planning/XIUnicodeGuide030411.pdf
<a href="http://help.sap.com/saphelp_nw04/helpdata/en/b0/676b3c255b1475e10000000a114084/content.htm">Configuring the Receiver JDBC Adapter</a>
<a href="http://help.sap.com/saphelp_nw04/helpdata/en/cf/406642ea59c753e10000000a1550b0/content.htm">Mapping Lookups</a>
<a href="http://help.sap.com/saphelp_nw04/helpdata/en/22/b4d13b633f7748b4d34f3191529946/content.htm">JDBC Adapter</a>
<a href="http://help.sap.com/saphelp_nw04/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/content.htm">Configuring the Receiver JDBC Adapter - part 2</a>
This is all i got from the help files, anyways you can also go through those links and see if you find anything else useful.
- Escape Symbol for Apostrophe
The apostrophe character () is a reserved character in SQL syntax and is therefore replaced by an escape character if it occurs within value strings. This replacement character can be database-specific. Typical replacement characters are \ or (default value). If a character occurs that is invalid for the database being used, the adapter triggers an error message (an SQL exception) concerning the SQL syntax that is generated by the database.
- Column Name Delimiter
Depending on the database being used, column names can be enclosed by a special delimiter character, for example, if the names can contain special characters (such as ). This character can be specified at this point. The default setting is no delimiter character. If a character occurs that i
Also check if there are notes in the service market place related to the same.
Regards,
abhy
Message was edited by: Abhy Thomas -
How to send the payload to a jsp using receiver Http adapter?
Hi experts,
I have this scenario from Legacy to XI to external app server.I have a test jsp to execute that functionality .Its a jsp which has 1 textarea named "test" and when I click on the submit buton I get a response back.This way I am able to test this independently.Now from XI when I am executing my scenario I am getting status code '1250' and message as ' http request(test) is null'.Now in the scenario in http adapter I just provide the target host : ip of server ,
service number : port no ,
path: the container or the request handler. But this scenario fails and gives me the above erroneous response.Now Basically I am not able to get how to send the value to the textarea "test"? please provide help as soon as possible.Do we have to put the name of the jsp in the "path" in http adapter and use prolog as test=.I tried this but it doesnt work.
Is there any way to check the URL that it forms after appending the querystring in the url ...?
So please provide help on this or suggest a solution to [email protected] as soon as possible.....
Thanx in advance.
Akshatahey Shekhar,
thanx for that prompt reply but I have configured the communication channel in the same manner as suggested by u.
actually I have this jsp page http://xx.xx.xx.xx:8080/abcdef/try/efg.jsp where there is a textarea "test" which has to be filled and there is a submit button.When I test this http client i.e the above jsp page independently then it goes to handler
http://xx.xx.xx.xx:8080/abcdef/trial/ And it gives a proper response message after clicking on the submit button.
now I want to carry out the same using receiver http adapter. I need to pass the value for this inputfield names "test" on that jsp . so right now I have configyured the adapter as
addressing type: url
target host : xx.xx.xx.xx
service no:8080
path : here I have given the path of handler i.e /abcdef/trial I tried giving the jsp page also but logically I guess it should be the handler.
content type: text/xml; charset=iso-8859-1
xml code: UTF-8
Mask special characters (URL escaping) checked.
now since the name of the inputfield is "test" in the prolog I gave test=
But it doesnt work I get this error "http request parameter [test] is null" in the response message which I guess suggests that it is not able to send the value for the field"test" to that handler.Please suggest how to send this and tell me if there are any other configurations that I have to do in the receiver communication channel.
Thanx ,
Akshata -
Not renaming attachment xml file name in receiver mail adapter
Hi,
I receive SOAP from GRC and need send to Partner an email.
I have SOAP to MAIL scenario where an xml file is picked up and transformed and zipped into the target format in XI which has to be sent as an attachement in an email on the receiver side.
I am getting the mail with the attachement. But I would like to rename the attachment as the name "NFE.XML" and the ZIP File as the name "nfe.zip"
I am using MAIL adapter with Modules above.
Number Module Name Module Type Module Key
1 AF_Modules/PayloadSwapBean Local Enterprise Bean Transform
2 AF_Modules/MessageTransformBean Local Enterprise Bean ContentType
3 AF_Modules/PayloadZipBean Local Enterprise Bean zip
4 sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean Local Enterprise Bean mail
Module Configuration :
Module Key Parameter Name Parameter Value
Transform swap.keyName payload-name
Transform swap.keyValue NFE
ContentType Transform.ContentType application/xml; name="NFe.xml"
zip zip.filenameKey ContentType
zip zip.mode zip
I am using transport protocol "XIPAYLOAD" and set "KEEP ATTACHMENTS"
I have with result example above :
Name from ZIP : PayloadName.zipu200E(4KB)u200E
Name from attachment : PayloadName
Regards,
RicardoHi Shobhit,
The module tab of your mail adapter will look like this.
Processing Sequence
Module Name Type Module Key
localejbs/AF_Modules/MessageTransformBean rename LocalEnterpriseBean
sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean mail Local EnterpriseBean
Module Configuration
Module Key Parameter Name Parameter Value
rename Transform.ContentDescription File
rename Transform.ContentDescription attachement;filename="yourfilename.ext"
rename Transform.ContentType application/text;name="yourfilename.ext"
Thanks
Amitanshu -
Renaming attachment file name in receiver mail adapter
Experts,
I have a file to mail scenario where an xml file is picked up and transformed into the target format in XI which has to be sent as an attachement in an email on the receiver side.
I am getting the mail with the attachement. But I would like to rename the attachment as the name of the picked up file.
I am using Adapter specific message attributes on both sides but the attachment is named as untitled.xml.
Please advise. Can this be achieved by using the swap bean or the message transform bean?
Regards,
ShobhitHi Shobhit,
The module tab of your mail adapter will look like this.
Processing Sequence
Module Name Type Module Key
localejbs/AF_Modules/MessageTransformBean rename LocalEnterpriseBean
sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean mail Local EnterpriseBean
Module Configuration
Module Key Parameter Name Parameter Value
rename Transform.ContentDescription File
rename Transform.ContentDescription attachement;filename="yourfilename.ext"
rename Transform.ContentType application/text;name="yourfilename.ext"
Thanks
Amitanshu -
Dynamic attachment name in receiver mail adapter
Hi all,
i am doing a receiver mail scenario (PI 7.1). my requirement is like this :
Receiver file need to be send in receiver mail attachment and attachment name should be dynamic
format for the attachment name should be like this
R+value from a particular field in payload +Timestamp
for example my file name should be like this R001_510815021009062532.xml
which is R+ 001_510815 + 021009062532 + .xml
can anybody suggest me how to go for this requirement? is ther any UDF or should i go for adapter module developement?
Thanks
sandeep sharma
Edited by: sandeep sharma on Oct 13, 2009 8:55 AMHi K Fatima,
I read your solution.I have a similar requiement but I need to send the entire output payload as an attachment,so I am using XSLT to send the payload as an attachment.
I am creating the file name through dynamic configuration in XSLT but the name of attachment is not as required but its any random generated name:
*code used:*
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:map="java:java.util.Map"
xmlns:dyn="java:com.sap.aii.mapping.api.DynamicConfiguration"
xmlns:key="java:com.sap.aii.mapping.api.DynamicConfigurationKey">
<xsl:output method="xml" version="1.0" encoding="UTF-8" />
<xsl:output indent="yes" />
<xsl:param name="inputparam"/>
<!-- mail parameters -->
<xsl:template match="*">
<ns:Mail xmlns:ns="http://sap.com/xi/XI/Mail/30">
<xsl:variable name="new-value" select="Shipment/InternalShipmentNum"/>
<Subject>Mail</Subject>
<From>xyz</From>
<To>abc</To>
<xsl:variable name="dynamic-conf"
select="map:get($inputparam, 'DynamicConfiguration')" />
<xsl:variable name="dynamic-key"
select="key:create('http://sap.com/xi/XI/System/File', 'Directory')" />
<xsl:variable name="dynamic-value"
select="dyn:get($dynamic-conf, $dynamic-key)" />
<xsl:variable name="new-value"
select="concat($dynamic-value, 'subfolder\')" />
<xsl:variable name="dummy"
select="dyn:put($dynamic-conf, $dynamic-key, $new-value)" />
<!--Content type -->
<Content_Type>application/xml</Content_Type>
<!Content Description>
<Content_Disposition>attachment;filename "<xsl:copy-of select="$new-value"/>"</Content_Disposition>
<!--Content Disposition -->
<Content_Description><xsl:copy-of select="$new-value"/></Content_Description>
<Content>
<xsl:copy-of select=".">
<xsl:apply-templates/>
</xsl:copy-of>
</Content>
</ns:Mail>
</xsl:template>
</xsl:stylesheet>
Please suggest ! I need the value in "Shipment/InternalShipmentNum" as name of attachment.
Thanks in advance!
Indu Khurana -
PayloadSwapBean in recevier file adapter
Hi Experts,
Mine is SOAP to File scenario. i'm getting attachemnts in SOAP channel, i'm using the payloadSwapBean to swap the main doc with this attachemnt in my receiver file adapter and the attachemnt content should go to the file. but i'm getting this error in adapter engine 'MP: Processing local module localejbs/AF_Modules/PayloadSwapBean Warning Swap: message is empty or has no payload '
in file adapter module configuration, what should i give for swap.keyName? i tried with payload-name, content-type - all of them leading to same warning message above.
the content of the message taken from the adapter engine is:
--SAP_4A8ABB9075B066E9E10000009B7D1E4D_END
content-id: <soap-4A8ABB8F75B066E9E100*** sap.com>
Content-Type: text/xml; charset=utf-8
<SOAP:Envelope xmlns:SOAP='http://schemas.xmlsoap.org/soap/envelope/'><SOAP:Header> . . . </SOAP:Body></SOAP:Envelope>
--SAP_4A8ABB9075B066E9E10000009B7D1E4D_END
content-id: att-605bf2608bdf11deb447***sap.com
content-type: text/plain;charset=Cp1251
1000001,"Z001","RU �������� ����","2999901553","20090803",25,0,"20090804",2999901553,""
1000002,"Z001","RU �������� ����","2999901549","20090803",25,0,"20090804",2999901549,""
--SAP_4A8ABB9075B066E9E10000009B7D1E4D_END
content-id: payload-60662b908bdf11de861b0****sap.com
content-type: text/xml;charset=utf-8
<?xml version="1.0" encoding="UTF-8"?>
<ns0:InboundOrder xmlns:ns0="http://________"><FileName>headers.txt</FileName></ns0:InboundOrder>
SAP_4A8ABB9075B066E9E10000009B7D1E4D_END
i strongly feel the issue must be with the swap.KeyName that i'm giving.
can anybody help me in this?
Regards,
RashmiRashmi,
Check the order of the processing sequence in the modules that you have configured in the CC.
It should be in the following pattern:-
PROCESSING SEQUENCE
Module Name -- localejbs/AF_Modules/PayloadSwapBean
Module Key -- SwapAttachment
Module Name -- CallSapAdapter
Module Key -- 0
MODULE CONFIGURATION
Module Key -- SwapAttachment
Parameter Name -- swap.keyName
Parameter Value -- Content-Type
Module Key -- SwapAttachment
Parameter Name -- swap.keyValue
Parameter Value -- application/txt
Let us know if you still face any trouble.
regards,
Neetesh
Edited by: Neetesh Raj on Aug 18, 2009 10:01 AM -
Setting dynamic file name in Receiver file adapter - not from payload
Guys I just remember reading a weblog but can't find it now that I need it, on how to set the file name in message mapping dynamically but not using any payload field.
Please let me know if you remember this.
Thanks a lot,
Viktor Vargaalso u can check in
<a href="/people/jayakrishnan.nair/blog/2005/06/28/dynamic-file-namexslt-mapping-with-java-enhancement-using-xi-30-sp12-part-ii file name(XSLT Mapping with Java Enhancement) using XI 3.0 SP12 Part -II</a>
<a href="/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14: The same filename from a sender to a receiver file adapter - SP14</a> -
Email attachment name in sender mail adapter to the receiver file adapter
HI ,
Ths is regarding email to file scenario. I am trying to create file (in rceiver file adapter) with the same name as the email attachment that i read from mail sender adapter. I want ro use adapter module for this. I could find from blogs that there is module - GetAttachmentName - available that i can use for this in sender mail adapter.
Can you please let me know what whetehr i neeed to mention any module key and parameters for this.
I assume , i need to do following steps :Please confirm.
1. i can use this module - after payload swap module and before standard mail adapter module in sender mail adapter
2. select ASMA option in advanced tab in sender mail adapter
3. In receiver file adapter select ASMA option in advanced tab in sender mail adapter
4. Also select file name option in ASMA in sender mail adapter
Thanks,
VamsiHi Vamsi,
your scenario is also described here: Re: sender mail adapter - attachment name
If you use the Module getAttachmentName, which is described here,
http://wiki.sdn.sap.com/wiki/display/XI/AdapterModulePI7.0GetAttachmentName
your scenario should work as you described it.
You just need to make sure that the Attachment Name that you read in the first place, is mapped to the Filename Attribute of the
Fileadapter (http://sap.com/xi/XI/System/File/FileName).
regards,
Daniel -
Need to get the Mail attachment name as it is to the receiver file adapter
I am doing a Mail to File scenario. I need to get the attachment from the mail and store it on the file server. I am using the PayloadSwap bean in the sender mail adapter. My requirement is to carry forward the attachement name as it is to the receiver file adapter side and store the file with the same name.
Did any one try doing this? I was looking at developing an adapter module but got struck as I could not find whether the attachement name is stored in the XI payload after it has got swapped using the swap bean.
Any help would be appreciated.
VJOops pressed the send key. Take two.
This is becoming a damn nightmare. When I run the adapter I am getting ModuleExceptions. Can you pass your eyes over these Java config settings to see what I am doing wrong. Using NWDS CE 7.1 with PI 7.1 both at SP07. All the imports were taken from PI 7.1 after SP07 was applied. The build id of NWDS is
SAP NetWeaver Developer Studio
SAP NetWeaver 7.1 Composition Environment SP07 PAT0001
Build id: 200901152336
APPLICATION.XML
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN"
"http://java.sun.com/dtd/application_1_3.dtd">
<application>
<display-name>MailPOP_EAR</display-name>
<description>EAR description</description>
<module>
<ejb>MailPOP_EJB.jar</ejb>
</module>
</application>
APPLICATION-J2EE-ENGINE.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE application-j2ee-engine SYSTEM "application-j2ee-engine.dtd">
<application-j2ee-engine>
<reference reference-type="hard">
<reference-target provider-name="sap.com" target-type="service">engine.security.facade</reference-target>
</reference>
<reference reference-type="hard">
<reference-target provider-name="sap.com" target-type="library">engine.j2ee14.facade</reference-target>
</reference>
<reference reference-type="hard">
<reference-target provider-name="sap.com" target-type="service">com.sap.aii.af.svc.facade</reference-target>
</reference>
<reference reference-type="hard">
<reference-target provider-name="sap.com" target-type="interface">com.sap.aii.af.ifc.facade</reference-target>
</reference>
<reference reference-type="hard">
<reference-target provider-name="sap.com" target-type="library">com.sap.aii.af.lib.facade</reference-target>
</reference>
<reference reference-type="hard">
<reference-target provider-name="sap.com" target-type="library">com.sap.base.technology.facade</reference-target>
</reference>
<fail-over-enable mode="disable" />
</application-j2ee-engine>
EJB-J2EE-ENGINE.XML
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-j2ee-engine SYSTEM "ejb-j2ee-engine.dtd">
<ejb-j2ee-engine>
<enterprise-beans>
<enterprise-bean>
<ejb-name>GetMailAttachment</ejb-name>
<jndi-name>GetMailAttachment</jndi-name>
<session-props/>
</enterprise-bean>
</enterprise-beans>
</ejb-j2ee-engine>
EJB-JAR.XML
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans
2.0//EN"
"http://java.sun.com/dtd/ejb-jar_2_0.dtd">
<ejb-jar>
<description>EJB JAR description</description>
<display-name>EJB JAR</display-name>
<enterprise-beans>
<session>
<ejb-name>GetMailAttachment</ejb-name>
<home>com.sap.aii.af.lib.mp.module.ModuleHome</home>
<remote>com.sap.aii.af.lib.mp.module.ModuleRemote</remote>
<local-home>com.sap.aii.af.lib.mp.module.ModuleLocalHome</local-home>
<local>com.sap.aii.af.lib.mp.module.ModuleLocal</local>
<ejb-class>sample.GetMailAttachment</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</session>
</enterprise-beans>
</ejb-jar>
SENDER MAIL ADAPTER modules
1 AF_Modules/PayloadSwapBean Local EB 1
2 GetMailAttachment Local EB 2
3 sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean Local EB 3
1 swap.keyName payload-name
1 swap.keyValue MailAttachment-1
RECEIVER FILE MODULES
1 localejbs/AF_Modules/DynamicConfigurationBean Local Enterprise Bean 1
2 localejbs/CallSapAdapter Local Enterprise Bean 2
1 key.0 write http://sap.com/xi/XI/System/File FileName
1 value.0 message.interface
VARIABLE FILENAME SUBST WITH ASMA TURNED ON
fName message:interface_name
JAVA SOURCE
package sample;
import javax.ejb.CreateException;
import javax.ejb.SessionBean;
import javax.ejb.SessionContext;
import com.sap.aii.af.lib.mp.module.Module;
import com.sap.aii.af.lib.mp.module.ModuleContext;
import com.sap.aii.af.lib.mp.module.ModuleData;
import com.sap.aii.af.lib.mp.module.ModuleException;
import com.sap.engine.interfaces.messaging.api.Message;
import com.sap.engine.interfaces.messaging.api.MessagePropertyKey;
import com.sap.engine.interfaces.messaging.api.TextPayload;
import com.sap.engine.interfaces.messaging.api.XMLPayload;
import com.sap.aii.af.service.cpa.Channel;
@ejbHome <{com.sap.aii.af.lib.mp.module.ModuleHome}>
@ejbLocal <{com.sap.aii.af.lib.mp.module.ModuleLocal}>
@ejbLocalHome <{com.sap.aii.af.lib.mp.module.ModuleLocalHome}>
@ejbRemote <{com.sap.aii.af.lib.mp.module.ModuleRemote}>
@stateless
<code>GetMailAttachment</code>
@SuppressWarnings("unused")
public class GetMailAttachment implements SessionBean, Module {
private static final long serialVersionUID = 7612238514043673502L;
private SessionContext myContext;
private MessagePropertyKey myFileName;
public void ejbRemove() {
public void ejbActivate() {
public void ejbPassivate() {
public void setSessionContext(SessionContext context) {
myContext = context;
@throws CreateException
public void ejbCreate() throws CreateException {
public void getMessageProperty(MessagePropertyKey FileName) {
myFileName = FileName;
@param moduleContext
Contains data of the module processor that might be important
for the module implementation such as current channel ID
@param inputModuleData
Contains the input XI message as principal data plus eventual
set supplemental data
@return ModuleData Contains the (changed) output XI message. Might be the
response message if the module is the last in the chain.
@exception ModuleException
Describes the cause of the exception and indicates whether
an retry is sensible or not.
@SuppressWarnings("deprecation")
public ModuleData process(ModuleContext moduleContext,
ModuleData inputModuleData) throws ModuleException {
try {
Message msg = (Message) inputModuleData.getPrincipalData();
TextPayload payload = msg.getDocument();
String contentType = payload.getContentType();
// Content Type could be something like
// text/plain;charset="UTF-8";name="file.txt"
contentType = contentType.replaceAll("\"", "");
int i = contentType.lastIndexOf("=") + 1;
String fileName = contentType.substring(i);
msg.setMessageProperty(myFileName, fileName);
inputModuleData.setPrincipalData(msg);
} catch (Exception e) {
return inputModuleData;
JAVA ERRORS
2009-02-04 11:41:14 Information Mail: calling the module processor for channel LMK_Common_Mail_Sender
2009-02-04 11:41:14 Information Swap: swapping by payload-name ? MailAttachment-1
2009-02-04 11:41:14 Information Swap: successfully swapped
2009-02-04 11:41:14 Information Mail: message leaving the adapter (call)
2009-02-04 11:41:14 Information The application tries to send an XI message asynchronously using connection AFW.
2009-02-04 11:41:14 Information Backward validation is enabled
2009-02-04 11:41:14 Error Unable to validate the message with message ID 8702df71-f254-11dd-9b9b-001a64a73518
2009-02-04 11:41:14 Error Returning to application. Exception: com.sap.engine.interfaces.messaging.api.exception.MessagingException: Content is not allowed in prolog.
2009-02-04 11:41:14 Error Mail: error occured: com.sap.engine.interfaces.messaging.api.exception.MessagingException: Content is not allowed in prolog.
2009-02-04 11:41:14 Error Mail: error occured: com.sap.aii.af.lib.mp.module.ModuleException -
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 -
Dynamic file name (Date) in Receiver File Adapter
Hi,
can any one tell me how to create outbound file name with receiver file adapter in format like Name_22-08-2006.dat. I need from a current Date in the name of the message (without any other information). In message payload I dont have that date. Is it possible to use variable from user defined function in message mapping for that name?
Regards,
NaychoNaycho,
that's exactly what I've managed to perform using DynamicConfiguration. Check these links:
http://help.sap.com/saphelp_nw2004s/helpdata/en/43/03612cdecc6e76e10000000a422035/frameset.htm
http://help.sap.com/saphelp_nw2004s/helpdata/en/43/09b16006526e72e10000000a422035/frameset.htm
http://help.sap.com/saphelp_nw2004s/helpdata/en/43/03fe1bdc7821ade10000000a1553f6/frameset.htm
Particularly, I've created a Java API for using setDirectory and setFileName methods through mappings. I use XSLT with java enhancement because it's a million times easier to parse and get node values with XSL than pure java.
I'm writing a blog on the subject, if you don't resolve the problem until it's out, let me know.
Regards,
Henrique.
Maybe you are looking for
-
Hi, I am a MM consultant and have to start work in WM. Need to have some guidance for basic steps and its settings in Configuration and Master Data for Putaway and Picking Strategies. Can anyone provide some guidance that how Putaway and Picking Stra
-
Error while transfering catalog items to shoping cart...
Hi We are on SRM4.0 and ECC5.0 and Requisite BugsEye4.0. Trying to create shopping cart with descriptive items. Item is added and then select the item to check the details before ordering. Then getting following error message. URL http://xxx:1080/sap
-
Dynamically pass subject via mail adapter without using mail package
Hi, We have requirement to pass the Dynamic variable as Mail subject we can't use Mail Package as we need to capture the data from Dynamic SOAP header Data from incomming channel Dynamic SOAP Header variable (XHeaderName1) comming from Sender SOAP ch
-
i tryed to extracte links from url page. and now i have some errors can you place help me.my errors only in the first part of code. thanks alot. package hw; import java.*; import java.net.URI; import java.util.ArrayList; import java.util.Collection;
-
Identify Old pricing conditions
Hello, Can any one help. How to identify old conditions (Non Active) which are not using from last 3 years? I executed Table KONV in background also to find active conditions but its giving dump due to memory. is there anyway to find this?