Adapter Module Receiver File Adapter

Hi All,
I am getting file name in the Mapping in my target structure in a field FILENAME and i want to use this field to create a file at the target with the name as the value in FILENAME.
I have to develop this by using Adapter Module.
Note : This can be done by Variable Substitution and Dynamic Configuration UDF.But i want to implement the same by using adapter module.
Can somebody help me out in getting the FILENAME from mapping inside the module process method of module.
Thanks,
Zabi

Try this..
private Map param;
DynamicConfiguration conf = (DynamicConfiguration) param.get(
StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey KEY_FILENAME = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
String Filename = conf.get(KEY_FILENAME);[/code]
Thanks
Sebin

Similar Messages

  • Adapter moduler in file adapter receiver - get Target Directory from param

    Hi everybody,
    We are in PI 7.1
    I need in an adapter module (file adapter receiver) to access to the Target Directory comming from parameters
    I foound the code in a weblog
    /people/sap.user72/blog/2005/07/15/copy-a-file-with-same-filename-using-xi
    Here is the code I found
    public ModuleData process(
              ModuleContext moduleContext,
              ModuleData inputModuleData)
              throws ModuleException {
              Object obj = null;
              Message msg = null;
              try {
                   Channel ch = new Channel(moduleContext.getChannelID());
                   obj = inputModuleData.getPrincipalData();
                   msg = (Message) obj;
                   XMLPayload xmlpayload = msg.getDocument();
                   String path = ch.getValueAsString("file.targetDir");
                   if (!path.endsWith("
    ") && !path.endsWith("/"))                    
                             if(path.indexOf("
    ")!=-1)
                                  path+="
                             else
                                  path += "/";
                   if (xmlpayload != null) {
                        convert(xmlpayload.getContent(), path);
                   inputModuleData.setPrincipalData(msg);
              } catch (Exception e) {}
              return null;
         private void convert(byte[] bs, String path) throws Exception {
              String bs_out = new String(bs);
              String filename =
                   bs_out.substring(
                        bs_out.indexOf("<FileName>") + 10,
                        bs_out.lastIndexOf("</FileName>"));
              bs_out =
                   bs_out.substring(
                        bs_out.indexOf("<Base64>") + 8,
                        bs_out.lastIndexOf("</Base64>"));
              byte bb[] = com.sap.aii.utilxi.base64.api.Base64.decode(bs_out);
              File f1 = new File(path + filename);
              FileOutputStream fos = new FileOutputStream(f1);
              fos.write(bb);
              fos.close();
    The object Channel come s from the package import com.sap.aii.af.service.cpa.Channel;
    The jar is in the build path (com.sap.aii.af.service.cpa.jar);
    When I write in NWDS
    Channel ch = new Channel(moduleContext.getChannelID());
    NDWS gives me an error "Cannot instantiate the type Channel".
    Can somebody help me about that, please?
    Does that code dosn't work in pi 7.1?
    Thanks in Advance for your help.
    Best Regards.
    E. Koralewski
    Edited by: Eric Koralewski on Feb 3, 2011 1:40 PM

    > When I write in NWDS
    > Channel ch = new Channel(moduleContext.getChannelID());
    > NDWS gives me an error "Cannot instantiate the type Channel".
    it should be:
    Channel ch = (Channel) LookupManager.getInstance().getCPAObject(CPAObjectType.CHANNEL, moduleContext.getChannelID());
    (taken from sample module ConvertCRLFfromToLF)
    http://help.sap.com/javadocs/pi/pi711sp03/index.html?com/sap/aii/af/service/cpa/Channel.html
    Edited by: Stefan Grube on Feb 3, 2011 2:02 PM

  • Adapter Module for File Adapter

    I have a scenario where I have 2 related files (text file and a pdf file) for the message. I need to enhance the payload (content conversion from text file) with the size of the pdf file. I have developed a adapter module for this and it is working fine if there is 1 set of text and pdf file. But if there are more than 1 set of files, it is processing the first set and giving the below error for other files.
    "Error: com.sap.engine.services.ejb.exceptions.BaseTransactionRolledbackLocalException: Exception thrown in method process. The transaction is marked for rollback."
    Regards
    Yogesh

    check this thread :
    BaseTransactionRolledbackLocalException in custom adapter module
    Exceptions in Recievr Communication Channel with Adapter Module

  • Adapter Module for File Adapter using Eclipse

    I want to develop Adapter Module using Eclipse, please let me know if it is possible?
    -How to use Eclipse to develop adapter module and deploy it on J2ee server.
    Thanks

    Hi,
    If you have NWDS , then you can directly deploy AM in PI server, if you are using eclipse to write code then genarate EAR file of your code, then you have to deploy in SDM using manual process.
    SEARCH IN SDN like how to deplot AM's, you will find many documents.
    Regards,
    RAJ

  • How to create multiple files with Receiver File Adapter in SAP PI 7.31 Java Stack

    Dear Friends,
    I am using Sender JDBC Adapter and Receiver File Adapter in Integration Flow in SAP PI 7.3 EHP 1 SP08 Java Stack environment. The requirement is that we need to create multiple files based on the row count in jdbc resultset. If there are 5 rows in resultset, we need to create 5 XML files with one row elements in one file. Similarly if there are 10 rows, we need to create 10 XML files.
    So how can we create multiple files in this scenario. I tried placing a for loop in the Java Mapping as below in the transform method:
    DynamicConfiguration conf = arg0.getDynamicConfiguration();
    StringBuffer sbFileData = new StringBuffer();
    for (int i =0; i < record.size(); i++ {
         . // Create XML for each row and Marshal the object into to the String Buffer
         String strFileName = "DC_" + new SimpleDateFormat("ddMMyyyyHHmm").format(new java.util.Date())+"_"+i+".xml";
         conf.put(KEY_FILENAME, strFileName);
         arg1.getOutputPayload().getOutputStream().write(sbFileData.toString().getBytes("UTF-8"));
         arg1.getOutputPayload().getOutputStream().flush();
    So here I'm flushing the OutputStream for each record. But it's not creating the multiple file, instead it creates only one file will all record XMLs appended to each other.
    Please let me know if I missing something or need to do some thing else.
    Regards,
    Shreyansh Shah

    Hi
    You can easily achieve this using graphical mapping.  Create your target message type like below
    MT_Target
      Details  0 to 1
          Data  0 to 1
    Source sample structure
    <resultset>
    <row>
    <column-name>column-value</ column-name>
    </row>
    Then do the message mapping like below
    map <row> with  MT_Target
    contant ----> Deatils
    column-name ------>Data
    In the signature tab of message mapping, choose the occurrence of your target message type as
    0 to unbounded.
    This will generate multiple files from multiple rows.
    Let me know if you have any doubt.

  • Error while using module in receiver file adapter??

    Hi,
           I am using user defined module(for converting EBCDIC type of data to ASCII type of data)  in receiver file adapter, while running the module it is giving erors in audit log
    Exception caught by adapter framework: class com.sap.aii.af.mp.module.ModuleLocalHomeImpl0_0 can not be casted to ModuleLocalHome or SModuleLocalHome
    MP: exception caught with cause java.lang.ClassCastException: class com.sap.aii.af.mp.module.ModuleLocalHomeImpl0_0 can not be casted to ModuleLocalHome or SModuleLocalHome
    Please help.
    Thanks.
    Madhusudhan.

    hi ....Stephan
    now we are getting the below exceptions in the message disply tool audit log
    Delivery of the message to the application using connection File_http://sap.com/xi/XI/System failed, due to: com.sap.aii.af.ra.ms.api.RecoverableException: java.lang.Exception.
    MP: exception caught with message null
    Thanks,
    Madhusudhan.

  • 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,
    Vamsi

    Hi 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

  • The same filename from a sender to a receiver file adapter

    Michal has provided us with a brilliant <a href="/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14.  I guess a lot of people have been waiting to do this. However, I have a slightly different scenario. In this case, XI is used as a medium to transfer a PDF file from one directory to another directory. There is not transformation or mapping involved.
    The message is send by File Sender Adapter and received by File Receiver Adapter. Message type is created as a simply type hexBinary. The file is supposed to be picked up as a PDF and received as a PDF, retaining the same file name. As such, the file name is neither stored in the source structure nor the target structure.
    Once the PDF file is transfered into target directory, it should be able to be open by using Acrobat directly without further conversion.
    We might add a file name file into the target structure but would that rendered the PDF non-readable upon being received by the File Receiver Adapter?
    Any feedback is highly appreciated.

    Hi
    >>We might add a file name file into the target structure but would that rendered the PDF non-readable upon being received by the File Receiver Adapter?
    No, adding file name would not hamper the properties. You can name *.pdf or something else.
    For that matter any file pdf, word, .msg format etc can be transferred by this approach. We have tried it.
    Earlier to SP14 you cannot give the same name to outgoing file without writing a Adapter module. But things are easy with SP14.
    Cheers,
    satish

  • 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 - Adapter Engine

    I am able to read files using Sender File Adapter. But when I try to write a file using Receiver File Adapter I get the following erro:
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--
    Call Adapter
    -->
    - <SAP:Error xmlns:SAP="<http://sap.com/xi/XI/Message/30>" xmlns:SOAP="
    <http://schemas.xmlsoap.org/soap/envelope/>" SOAP:mustUnderstand="">
    <SAP:Category>XIServer</SAP:Category>
    <SAP:Code area="INTERNAL">AE_DETAILS_GET_ERROR</SAP:Code>
    <SAP:P1>af.exi.usxid</SAP:P1>
    <SAP:P2 />
    <SAP:P3 />
    <SAP:P4 />
    <SAP:AdditionalText>3: No service user name found for Integration
    Server is.00.usxid</SAP:AdditionalText>
    <SAP:ApplicationFaultMessage namespace="" />
    <SAP:Stack>Error when reading the access data (URL, user, password)
    for the Adapter Engine af.exi.uswalexi</SAP:Stack>
    <SAP:Retry>M</SAP:Retry>
    </SAP:Error>
    I tried executing the function module SAI_AE_DETAILS_GET but I am not getting the error URL Not found. This was working in the past. We upgraded to SP15 this showed up again.
    Any help appreciated.

    I'm working on integration of SAP with 3rd party application. While sending data from SAP to XI, i'm getting the following error which i've found in sxmb_moni (XML Message->Call Adapter).
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    -<!-- Call Adapter --> -
    <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">
    <SAP:Category>XIServer</SAP:Category>
    <SAP:Code area="INTERNAL">AE_DETAILS_GET_ERROR</SAP:Code>
    <SAP:P1>af.xp1.sapxi</SAP:P1>
    <SAP:P2 />
    <SAP:P3 />
    <SAP:P4 />
    <SAP:AdditionalText>3: No service user name found for Integration Server is.00.sapxi</SAP:AdditionalText>
    <SAP:ApplicationFaultMessage namespace="" />
    <SAP:Stack>Error when reading the access data (URL, user, password) for the Adapter Engine af.xp1.sapxi</SAP:Stack>
    <SAP:Retry>M</SAP:Retry>
    </SAP:Error>
    Plz help me to solve this issue. If possible mail me the solution to my personal email-id [email protected]
    Note:
    1. We are using CIM 1.3
    2. In XI Server Message Monitoring, i'm getting the System Error message in Integration Engine.
    3. In Payloads, i'm getting the required information in XML format as desired.
    Thanks in advance.
    Regards,
    Navaneeth.S

  • Receiver File adapter content conversion using StrictXml2PlainBean

    Hi All,
    For receiver file adapter i am using the module StrictXml2PlainBean, and also i mentioned the module configuration like this
    parameter name                              parameter value
    recordTypes                                  Header,TransactionHeader,TransactionDetail,TransactionTrailer,FileTrailer
    FileTrailer.endSeparator                |\n
    FileTrailer.fieldSeparator               |
    Header.endSeparator                   |\n
    Header.fieldSeparator                  |
    TransactionDetail.endSeparator   |\n
    TransactionDetail.fieldSeparator  |
    TransactionHeader.endSeparator |\n
    TransactionHeader.fieldSeparator |
    TransactionTrailer.endSeparator  |\n
    TransactionTrailer.fieldSeparator |
    But when i send the idoc, The receiver CC is throwing an error
    Message processing failed. Cause: com.sap.aii.af.modules.conversion.xml2plain.ConversionException: Invalid structure name encountered during conversion: Transaction at XML element MT_DeliveryOrder,Transaction
    My actual structure is
    MT_DelvOrder
       Header  0...1
       Transaction 0....Unbounded
          TransactionHeader  1..1
           TransactionDetail     0...unbounded
            TransactionTrailer  1...1
       FileTrailer  0...1
    The module is checking for the Transaction node,but i require the rest 3.
    Same configuration i have done successfully with FCC without using the module....
    So can any one suggest me where i am missing... why the module is pointint towards, the Transaction cant i ignore this node . and continue with the rest???
    Regards,
    Sridhar
    Edited by: sridhar reddy kondam on Aug 10, 2009 12:35 AM

    Hi Rajesh,
    The same FCC configuration was working fine with FCC and when i am using this module configuration i am getting the prob...
    In the file i need the Header,TransactionHeader,TransactionDetail,TransactionTail,Filetrailer
    my sample output file is
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_DeliveryOrder>
    <Header>
    </Header>0...1
    <Transaction>0...Unbounded
        <TransactionHeader> 1..1
         </TransactionHeader>
         <TransactionDetail> 0...Unbounded
         </TransactionDetail>
          <TransactionTrailer>1...1
           </TransactionTrailer>
    </Transaction>
    <FileTrailer> 0...1
    </FileTrailer>
    Any suggestions will be great help...
    I think i need to go with other options without using this module....
    Regards,
    Sridhar
    Edited by: sridhar reddy kondam on Aug 10, 2009 6:03 AM

  • Receiver File Adapter error

    Hi all,
    I am trying to convert the XML to Plain file in receiver file adapter. I am using module - StrictXml2PlainBean
    My target structure is -
    <MT_Name>
        <records>
            <Header>
            </Header>
            <Item>
            </Item>
        </records>
    </MT_Name>
    <Header> and <Item> are at same level.
    When I use --
    1. Header.fieldSeparator = ,
    2. Item.fieldSeparator = ,
    3. recordTypes = Header,Item
    Then I get this error -
    Message processing failed. Cause: com.sap.aii.af.app.modules.conversion.xml2plain.ConversionException: Invalid structure name encountered during conversion: records at XML element MT_Name,records
    When I use --
    1. records.fieldSeparator = ,
    2. singleRecordType = records
    Then I get this error -
    Message processing failed. Cause: com.sap.aii.af.app.modules.conversion.xml2plain.ConversionException: The element nesting level for the structure MT_Name is too deep (reference: 3 levels, found: 4 levels) at XML element MT_Name,records,Header,Item
    To add more details to the scenario, multiple records can be generated but one record will have only one Header, with multiple Items.
    Any help in this regard will be highly appreciated.
    Thanks,
    Abhi

    Hi Abhi,
    Here you go....
    For your target structure as:
    <MT_Name>
    <records>
    <Header>
    </Header>
    <Item>
    </Item>
    </records>
    </MT_Name>
    Where I have assumed that <Header> and <Item> are at same level.
    DO NOT use any Module just simply configure the receiver channel as below:
    In the file Receiver Channel
    Recordset Structure = Header,Item
    Name                                                                    Value
    Header.fieldSeparator                                             ,
    Item.fieldSeparator                                                  ,
    I have tried this and it works.
    Let me know if you are facing any issues.
    Cheers
    Dhwani

  • FTP Receiver File adapter  -- CRLF In output File in Windows environment.

    Hi All,
    Idoc to File : Receiver File adapter.
    I use the endseparator 'nl' and the output file is coming correctly with NFS and It is not working when we are doing with with FTP.
    Tested with NFS (Unix environment)
    I used the endseparator 'nl' and the output file is coming with CRLF.
    Tested with FTP (Windows environment)
    When I tested the same the output file is coming with LF.
    I tried by using the module "SAP XI Sample/ConvertCRLFfromToLF" which will convert from LFToCRLF.But it is serving my purpose.
    Can anyone please suggest how I can get the CRLF in the file while putting in the output directory which is in windows environment.
    Thanks
    Seema

    Do not mention endSeparator in content conversion parameters...by default XI puts newline as endSeparator
    It should work for NFS and FTP on Windows

  • Target Directory & File Name parameters in Receiver File Adapter with ASMA

    Hi Experts..
    I have the following question....
    What am I suppose to inform in the Target Directory & File Name obligatory parameters in Receiver File Adapter if I am using ASMA to fill it? Is it any dummy value?
    Also, if you have any step by step guide/blog to forward on how to use ASMA in file adapter I will be greatful.
    Thanks in advance,
    Daniela

    You can give any dummy value in dir and file name... Just go through these blogs
    /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
    /people/madanmohan.agrawal/blog/2009/05/20/combining-three-different-aspects-of-pi-asma-af-module-and-variable-substitution-in-one-shot

  • 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

Maybe you are looking for