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,
Rashmi

Rashmi,
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

Similar Messages

  • Spaces in recevier file adapter

    Hi,
    We are converting IDOC -> fixed length file. There are several fields which may not exsist in IDOC but still need to be populated in file with spaces. Is there anyway I can set some param in file adpater to default field value to spaces if it is not provided?
    When I specify length =25 for certain field in file adapter and it receives field value of length 20.. will it be possible to include extra spaces at the end so that the field length is 25. In this example - extra 5 spaces ' ' will be needed.
    Thanks
    Kunal

    Kunal,
    In the file you also create the column and link that column to a constant and fill spaces according to your requirement. Also go through the url:
    /people/shabarish.vijayakumar/blog/2006/02/27/content-conversion-the-key-field-problem
    /people/shabarish.vijayakumar/blog/2005/08/17/nab-the-tab-file-adapter
    By the way you have told fixed length file, then why do you want to change the fields length?
    ---Mohan

  • 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.
    VJ

    Oops 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

  • Receiver file adapter with attachments.

    Hi
    I would like to pass a file receiver an attachment from a proxy. I have seen bits and pieces with attachments. I have read that its similar to the mail adapter.
    In the module
    localejbs/AF_Modules/PayloadSwapBean 
    module configuration:
    Parameter Name: swap.keyName
    Parameter Value: payload-name
    Has anyone succeeded and would you explain the details?
    Thanks in advance
    Ian

    Hi,
    As far as I know, receiver file adapters do not supprt attachments.
    You can use the payloadSwapBean to swap the attachment and the actual proxy payload and then send it to the file adapter.
    Don't think it will be possible to send both the attachment and the payload to the receiver  file adapter though.
    Regards
    Bhavesh

  • Error while handling special characters ( and &) in Sender File adapter

    Dear All,
    Scenario: Third Party System --> (File adapter) SAP PI 7.1 (SP05) --> (Proxy) ECC
    We are receiving CSV file and no mapping is required in PI as all the processing is being done by third party tool. But we are receiving special characters like ',",>,< and & in the csv file.
    When we are using File Type as TEXT and File Encoding as ISO-8859-1 than we are getting error. We changed File Type to BINARY and than we are able to handle ',",> but having issue in handling < and &.
    Any idea how we can handle it.
    Please note trhere is no Mapping in SAP PI so cannot uise Java mapping.
    Thanks a lot
    Chanakya

    Hey,
    You can add ABAP Script in Receiver Proxy for eliminating or replacing with NULL or empty. Since you dont have mapping for formatting these kind of junks you can follow the above approach.
    Else, you can remove the junks at OS level while running a small script and make it available to PI.
    Or else, you need to create mapping for sender and recevier structure though it is same, then you add a very simple UDF for fine tune.
    Use this UDF
    Here a is the input value.
    String b = "";
    b = a.replaceAll(",", "0");
    b = a.replaceAll("@", "0");
    Like all the special characters you can take and replace with zero.
    return b;
    Thanx
    Pothana

  • How to use File Adapter Receiver to write attachments

    Hi,
    i have a scenario, in which our own XInotes adapter sends an XIMessage from an IBM Lotus Notes database into XI. This XIMessage contains an XML document as application main document and several PDF files as additional attachments 
    On the receiver side, i must use a File Adapter to write both the XML documents and the PDF attachments into a directory.
    The problem is i don't know how to use the file adapter receiver to write the attachments. In the Channel Monitoring, i can see that all PDF files are transferred to the file receiver. But the file adapter writes only the XML document into the directory.
    I've also tried the AF_Modules/PayloadSwapBean, but it can only swap one PDF file into the application payload. And the file name must be hard coded in the module configuration as swap.KeyName.
    Could anyone give me any ideas?
    thanks a lot in advance
    Xiang

    hi,
    receiver file adapters do not supprt attachments.
    Only File Sender adapter is capable of handling attachments not the receiver.
    http://help.sap.com/saphelp_nw2004s/helpdata/en/4b/a20c4cfea96b498b1e1af3f32f0670/frameset.htm
    Configuring the sender FILE adapter
    The sender file adapter is configured to pick the normal payload (file1.xml), which is specified in the File
    access parameters, and the additional image file (file1.jpg) that is to be sent as an attachment is configured
    under the Additional File(s) as shown in the screenshot below. The file type would still remain binary.
    Since, by default, XI sends payload and attachments in XML format, we need to call two beans, namely the
    MessageTransformBean and the PayloadSwapBean to help us is transforming the content to jpeg format
    and also change the file extension.
    The PayloadSwapBean module is used to replace the application payload of the XI message that holds the
    data with another payload which is appended to the message as an attachment. In our case, the payload
    would be file1.xml whereas the attachment would be file1.jpg
    The swap module is denoted in our scenario with the module key ‘swap’. It has two parameters from the
    MIME header.
    regards,
    pradeep.

  • Can we process files with attachments using File Adapter

    Hi All,
    I want to process files which have attachments using File Adapter.
    Is it possible to process such files?
    May be using standard modules?
    Regards,
    CBKLP

    Assuming you are talking about sender FILE channel....you can make use of PayloadSwapbean provided by SAP (standard module)...to read data from attachment.
    Regards,
    Abhishek.

  • German umlauts :Sender File Adapter

    Hi,
    I am trying to configure Sender File adapter,but it is not working properly for German umlauts.
    I have tried encoding UTF-8, UTF-16, ISO-8859-1,ISO-8859-2, ISO-8859-5 but none of them are working.
    Can anyone please help me out in this.
    Thanks a lot.
    Regards,
    Shweta

    Hi Stefan,
    I have already added this module exactly in the same way.
    But can you please confirm the sequence
    Module :
    localejbs/AF_Modules/PayloadSwapBean                     Local Enterprise Bean     swap
    localejbs/AF_Modules/MessageTransformBean     Local Enterprise Bean     Transform
    localejbs/AF_Modules/MessageTransformBean     Local Enterprise Bean     Transform
    Transform.ContentType                     text/plain;charset="UTF-8"
    Transform.ContentDisposition            attachment;filename="ABC.csv"
    Also,I noticed one thing
    The content is corrupted in SXI_MONITOR but it is correct in payload of File as well as Mail adapter in Message Monitor(RWB)
    Thanks.
    Regards,
    Shweta

  • Payload to receiver file adapter

    Hi guys,
    I have a scenario where I receive a message from SAP ERP via Proxy with a SOAP attachment. The message contains data about where on a file share the file shall be placed, and the attachment contains the PDF file to be placed. As far as I know the receiver file adapter does not support the payloadSwapBean - So the question is. Can this scenario be implemented? And if so, how?

    >>>So the question is. Can this scenario be implemented? And if so, how?
    Receiver file adapter does not support attachment. Stefan answered in a thread to use Axis File adapter. Refer below...
    How to use File Adapter Receiver to write attachments

  • Multipart Mime / File Adapter article

    I was sure that there was an article/blog about packing multiple files into email format and send it out with the file adapter in XI.
    I just can't find it anymore. Can someone post the link?
    TIA -hs

    I think You are talking about one of this,
    Most Related:
    https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1685 [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken]
    Related:
    https://media.sdn.sap.com/SDNTV/main.asp?mediaId=106
    /people/michal.krawczyk2/blog/2005/12/18/xi-sender-mail-adapter--payloadswapbean--step-by-step
    -Nilkanth.

  • FileName in Sender File Adapter Module

    Hi Folks,
    In my sender file adapter have written a module to read the picked file name. The protocol used is NFS.
    Notice that the file name read in the module has the absolute path, including the directory path. E.g The file name xyz has to be picked from source directory
    XIServer\Outbound. In the module when I retrieve the file name, it comes up as
    XIServer\Outbound\xyz. Is this expected behaviour?
    I was expecting just the file name<xyz> to be retrieved.
    Thanks,
    Anand

    HI,
    Create an UDF and write this code.
    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;
    in Adapter u will have Adapter specific parameters check the file name check box.
    Using this UDF u will get the file name at target side.
    Regards,
    Phani.

  • Getting Error while running a file adapter.

    Hi all,
    I am doing a small application where I need to read an image from a shared path and send the base64code of that image in response. For that I am using File Adapter and Read
    operation. I have just hard coded the image name didnt give any wild card or expressions. I generated a service which is a proxy using the jca of that File Adapter. I added a stage
    replacing the response body with the opaque element of the request body. When I run the proxy I am getting something like *"The invocation resulted in an error: "* in response
    and in the stack trace I am getting *"Failed to set the value of context variable "body". Value must be an instance of {http://schemas.xmlsoap.org/soap/envelope/}Body."* as the fault
    reason I am unable to detect where exactly I am going wrong. Kindly help me in resolving this.
    Thanks,
    Phanindra.

    Not sure why you want to replace. Since the response of the proxy would remain to hold the request body by default.
    If you have stored the opaque element in a variable ($var_opaque), then you can do the following.
    XPath : .
    In variable : body
    Expression : $var_opaque
    Check - "Replace node content"

  • Using a variable in "arrayTerminatedBy" clause while using a file adapter

    Hi All,
    How can read a file of sample shown below using a file adapter.
    ABC|20081010|
    2008|xxxxxxx|
    2007|yyyy|
    2009|zzzzzzz|
    3|20081010|
    first line is the header
    last line is footer
    middle portion is the body
    '3' in the footer is the total no of record count in the body
    I am able to read the header and body.
    The problem i am facing is; when it is reading the footer it is treating the footer as a record in the body and is throwing an error stating - expected the format as "yyyy"
    I have to use "arrayTerminatedBy" to indicate the end of the body. But that terminating field is a varying field. How can i use this variable field in the "arrayTerminatedBy" clause.
    Can any one help in reading this file
    Thanks in advance
    Edited by: user10308218 on 11-Oct-2008 02:23
    Edited by: user10308218 on 11-Oct-2008 02:24

    See if this helps, I haven't tested it but it will give you a hint in how to achieve it. As you can see I use the startsWith command. I'm not sure how to handle your detail as it seems to start with different elements every time.
    cheers
    James
    <?xml version="1.0" encoding="UTF-8" ?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd"
    targetNamespace="http://TargetNamespace.com/Write_File"
    xmlns:tns="http://TargetNamespace.com/Read_File"
    elementFormDefault="qualified"
    attributeFormDefault="unqualified" nxsd:encoding="ASCII" nxsd:stream="chars" nxsd:version="NXSD">
    <xsd:element name="FileRecord">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="Header" nxsd:startsWith="ABC|" maxOccurs="1">
    <xsd:complexType>
    <xsd:sequence nxsd:style="array" nxsd:arrayTerminatedBy="${eol}">
    <xsd:element name="FileDate" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="${eol}" nxsd:quotedBy="&quot;"/>
    <xsd:element name="Record" maxOccurs="unbounded">
    <xsd:complexType>
    <xsd:sequence nxsd:style="array" nxsd:arrayTerminatedBy="${eol}">
    <xsd:element name="DetailData1" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="|" nxsd:quotedBy="&quot;"/>
    <xsd:element name="DetailData2" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="${eol}" nxsd:quotedBy="&quot;"/>
    <xsd:element name="Footer" nxsd:startsWith="3|" maxOccurs="unbounded">
    <xsd:complexType>
    <xsd:sequence nxsd:style="array" nxsd:arrayTerminatedBy="${eol}">
    <xsd:element name="FooterData" type="xsd:int" nxsd:style="terminated" nxsd:terminatedBy="${eol}" nxsd:quotedBy="&quot;"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>

  • Receiver file adapter

    hi all,
    i'm using file adapter receiver and want to generate an fixed length text file. the name of the text file i want to generate it dynamically based on a field of the xml.
    the structure of xml:
    <mt_PO>
      <Header>
      </Header>
      <Detail>
      </Detail>
      <Filename>
        </name>
      </Filename>
    </mt_PO>
    For generate the name of the file i'm using variable substitution in this way:
    var1 ->  payload:mt_PO,1,filename,1,name,1
    and in the file name schema field: PO.%var1%.txt
    this it's correctly done.
    After, for generate the text file in the format i want i use content conversion:
    RecordSet structure:  Header,Detail,filename
    Name                                                Value
    Header.addHeaderLine                        0
    Header.fieldFixedLengths                    2,2,10,10,8,100
    Header.endSeparator                          'nl'
    Detail.fieldFixedLengths                      2,5,18,35,35,13,3,13,5,35,12,40,60,40,10
    Detail.endSeparator                            'nl'
    filename.fieldFixedLengths                  0
    filename.fixedLengthTooShortHandling  Cut
    The problem is that resulting text file is generated with an empty line to the end, and that is my problem. i don't know how to avoid generate that empty line.
    has anybody been in the same scenario and know how to solve this issue?
    Thanks.

    Hi,
    Ok No problem, let me give you the blog which contains all the steps,
    Dynamic Configuration of Some Communication Channel Parameters using Message Mapping
    Here you need to create one UDF in mapping and have to map it with target Message Type.
    Remove the filename from Target side structure.
    Thus at runtime it will take the value from Source side payload (Or you may pass any values in mapping )
    and that will be used in communication channel.
    The given blog have used HTTP as receiver communciation channel.
    For file adapter you need to fill-up below parameters with variable substitution.
    File Name Scheme : %Var1%
    Variable substitution -- enable
    >Var1----
    >message:message_id
    Adapter Specific Attributes
    Mark Filename & Use Adapter Specific attributes.
    PS Note : once you apply this UDF the mapping will give exception while testing from test tab. Let it be.
    This UDF will work on Runtime. Thus execute the scenario to see the results.
    Thanks
    Swarup

  • File Adapter - SP12

    Hi,
       We are in XI 30, SP12 and we were trying out passing the payload value as the file name.
    SAP help says that in the Variable Substitution, we should be giving as follows:
    Variable Name    FileName
    Reference  payload: Record,1,DT_HEADER,1,FILE_IDENTIFIER,1
    (Reference will show the XML path traversal till the least node to get the relevant value from the payload as per SAP help).
    In the filename Scheme we are mentioning the variable name <b>%FileName%</b>. But its not taking the value contained in the variable FileName which should hold the payload value. But its not happening.
    Anyone did some trial on the same pls throw some light on this issue..
    Thanks in advance
    Jayakrishnan

    To make the example if the online help run, you have to do following:
    File Access Parameters:
    -> File Name Scheme: %var1%.xml
    Processing Parameters
    -> File Construction Mode: Add Time Stamp
    Variable Substitution
    -> Enable: x
    Variable Name: var1
    Reference: payload:root,1,e1,1,e2,2
    Send this payload (use sender file adapter)
    <?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>
    Result: Your file name looks like this:
    Example Value20050607-131921-414.xml
    =====================================================
    The example of Michal was ( _ omitted):
    payload:
    <?xml version="1.0"?>
    <OutputTag>
    <From>newfilename</From>
    </OutputTag>
    same config as above, besides:
    Reference: payload:OutputTag,1,From,1
    Result: newfilename20050607-133624-145.xml
    Hope this helps
    Stefan

Maybe you are looking for