Problem in Receiver File adapter :Module XML2PLAIN

Hi Friends,
I have a FILE -> FILE scenario ,In this when I am downloading the data in XML format it is getting downloaded successfully.The output look like this ...
<b>I have only one field to be displayed in the output</b>.
<?xml version="1.0" encoding="utf-8" ?>
<Returnkey>
<field1>000000000621185CA</field1>
</Returnkey>
Module Name                                                      Modulekey
localejbs/AF_Modules/MessageTransformBean      XML2Plain
<b>Module key parametername                      parameter value</b>
XML2Plain      Transform.Class            com.sap.aii.messaging.adapter.Conversion
XML2Plain      Transform.ContentType   text/plain;charset=utf-8
XML2Plain      xml.addHeaderLine         0
XML2Plain      xml.conversionType       SimpleXML2Plain
XML2Plain      xml.fieldFixedLengths    25
Please some one help me out I,I have tried all the options  and I cant use File content conversion in this case ,(I have JMS adapter which actually sends this information to MQ,as  it is working in XML format AND not in plain format ,I am testing this temporarily with a receiver file scenario)
Thanks in advance.

Hi
you can use the following modules and the parameters.
Processing sequence :
localejbs/AF_Modules/MessageTransformBean
localejbs/SAP XI JMS Adapter/ConvertMessageToBinary
localejbs/SAP XI JMS Adapter/SendBinarytoXIJMSService
Module Configuration:
Transform.Class----
>com.sap.aii.messaging.adapter.Conversion
TransformContentType----
>text/plain;charset=utf-8
xml.addHeaderLine----
>0
xml.conversionType----
>SimpleXML2Plain
xml.fieldFixedLengths----
>10,10,10(for ex)
xml.fixedLengthTooShortHandling----
>Cut
if you still face the problem please reply me back.
Thanks
Rinku

Similar Messages

  • Problem with Receiver File adapter

    Hi
    I have a problem with receiver file FTP adapter, while writting file in target folder, connection is failing, after retries, it writting file again. How to avoid this situation, is there any way to write the leftout part in the file.
    VS

    Hi
    Thank u all,  Problem is solved, i changed write mode to Over write existing file. It is working fine.
    VS

  • Receiver File Adapter Module processor issue

    Hello all,
    I have deployed (using SDM) a specific module for one of my file communication channel.
    In MDT, I have the following error :
    Exceptions survenues pour Adapter Framework : Object not found in lookup of Module0001
    La diffusion du message vers l'application via File_http://sap.com/xi/XI/System a échoué en raison de : com.sap.aii.af.ra.ms.api.RecoverableException: Object not found in lookup of Module0001.: com.sap.engine.services.jndi.persistent.exceptions.NameNotFoundException: Object not found in lookup of Module0001.
    Where can be the source of this problem ?
    Thanks a lot

    Jean
    Also check if the "JNDI" name that you have specified in the Receiver Adapter module
    excluding localejbs matches the deployed name in the "J2ee Aministartor Deploy service.
    for example if you have
    localejbs/sap.com/BeanName
    you should have
    the service deployed under
    /sap.com/BeanName
    regards
    krishna

  • Problem with receiver file adapter printing data line by line in .txt file

    We are working on e-payments integration with one of the bank. As part of text file generation, we have a written a UDF which accumulates all Invoice details( 10 input fields information ) into one string and then sends output line by line with a delimiter separation for each invoice.
    H
    D
    E
    E
    E
    T
    Bank requires a file in above format separating invoice in separate E band.( one invoice collection in one E band)
    As per our scenario, multiple invoice details from an idoc(PAYEXT) have to be written to a text file line by line.  i.e one invoice details per one row.
    After the execution of the scenario, in SXMB_MONI, the message display clearly showing that the invoice details are printed line by line. A java function used in message mapping for the writing the invoice details line by line.
    But actual file that is written to a text file is showing all the invoice details in written in single row.
    When I enable the option Word wrap in the notepad, then only I can see the details in desired format.
    Please guide us where we are going wrong.
    Can notepad settings make any difference while displaying the text file???
    Is there any way to write the file as desired without enabling the word wrap in notepad.
    Thanks in advance.
    Nagendar

    Hi venkatnrj,
    i hope this UDF might be its helps
    public void CombineText(String[] var1, String[] var2, String[] var3, String[] var4, String[] var5, ResultList result, Container container) throws StreamTransformationException{
    String s = "";
    for( int i = 0 ; i < var1.length ; i++)
         if ( var1<i> != ResultList.CC)
         s = s +  var1<i> + "," + var2<i> + "," + var3<i> + "," + var4<i> + "," + var5<i>  + "\n" ;
    result.addValue( s );
    Output diplay like below the format by using above udf:
    aaa,bbb,cccc,dddd,eee,fff,
    aaa,bbb,cccc,dddd,eee,fff,
    aaa,bbb,cccc,dddd,eee,fff,
    aaa,bbb,cccc,dddd,eee,fff,

  • Problem with file content conversion in receiver file adapter

    Hi All
    I have a problem with file content conversion in receiver file adapter.
    This is my recordset structure: Header_Record,1,Claim_Record,*,Check_Rec,1
    These are the content conversion parameters:
    Header_Record.fieldSeparator = ,
    Header_Record.endSeparator = 'nl'
    Claim_Record.fieldSeparator = ,
    Claim_Record.endSeparator = 'nl'
    Check_Rec.fieldSeparator = ,
    Check_Rec.endSeparator = 'nl'
    In SXMB_MONI, i can see that the data is correctly extracted from proxy, and correctly mapped to receiver message, and i see a checkered flag (success).
    But, Adapter status is RED with the following error message:
    Conversion initialization failed: java.lang.Exception: java.lang.Exception: Error(s) in XML conversion parameters found: Parameter '1.fieldFixedLengths' or '1.fieldSeparator' is missing
    In communication channel monitoring, i get the following error message:
    Message processing failed. Cause: com.sap.aii.af.ra.ms.api.RecoverableException: Channel has not been correctly initialized and cannot process messages
    What is going wrong here? Can anyone please tell me?
    Thanks
    Chandra

    Posted in Incorrect forum.
    Posted again in Process Integration forum

  • Problem with fixedlenthgs in receiver file adapter

    HI,
    I am doing XML to flat file scenario  and using mutli mapping concept without BPM.
    in the receiver file adapter I am using FCC with fixedlengths,then it generated just 3 output files out of nearly 100 source files.the errored one are succcessful in the SXMB_MONI and failing in RWB-->Message moni with waiting status and MDT says that XI_J2EE_ADAPTER_FILE ,Error Code PROCESSING_ERROR .
    i tried in SDN and then found something like enable the disablesecurity check box in variable substitution parameters ,then I got 4 files out.
    these are my FCC params for all structures:
    struc1.fieldFixedLengths
    struc1.fixedLengthTooShortHandling
    struc1.endSeparator
    and I tried with fieldSeparator then it gives successfully all output files.
    so,where is the problem?I didnt understand?
    any suggestion.
    thank you,
    regards,
    Babu Sri

    Bhavesh,
    I felt the same way,but assumed that ,in that way fixedlenghths wont work.
    in my target structure most of the fields have 0-1 occurences ,and even in the source structure too.so,I think it might be the reason.Then I have to make all my about 60fields 1-1 madatory and using mapWithDefaultValue function, as my sources are optional.
    you think it will work just using the "mapWithDefaultValue" function without changing my occurences to 1-1 in the target structure(mandatory)?infact I can try but ,cos of pain for changing like 60 fields....:) and even dont know which fields are causing the problem,so that we can apply "mapWithDefaultValue" function only on those fields.
    thank you,
    Babu Sri

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

  • Receiver File Adapter Content Conversion Problem.

    Hi All,
    I am getting in receiver file adapter due to content conversion setting. Problem is that all the fields coming in file adapter are optional. In content conversion , i have specified fieldfixedlengths. So whenever any optional field is not present , it fails . How should we handle it? is there any option to declare fields as optional, I know that is the there for sender adapter. But no. of fields is also very large, so putting each and every field as optional is very time consuming.
    What should i do?
    Ranjeet Singh.

    Hi Daniele,
    Instead of using the standard funciton , i created a UDF for handling this situation.
    My logic is UDF is like
       //write your code here
    int Size = Integer.parseInt(Truncate_Size);
    String Return_Value = "";
         if  (!("".equals(Input)) )
              if  (Input.length() > Size )
                   Return_Value = Input.substring(0,Size);
              else
                   Return_Value = Input.substring(0, Input.length());
         else
              for(int i = 0; i< Size ; i++)
              Return_Value = Return_Value + " " ;
    return Return_Value;
    SO in this case also , it should be able to handle empy source element. But it is not working.

  • Problem: The same filename from a sender to a receiver file adapter - SP14

    Blog : /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
    My Problem:
    The thing works for me and i am able to get my input files name as my output file name. But one thing i noticed is that in my target message, the field where i have mapped the code it always returns the value "null" but finally when the file is created i get the required result.
    My input file name is input.txt and i get the same name in my output file too.
    In sxmb_moni if i check DynamicConfiguration link i see the following
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!-- Response
    -->
    - <sap:DynamicConfiguration xmlns:sap="http://sap.com/xi/XI/Message/30">
    <sap:Record namespace="http://sap.com/xi/XI/System/File" name="SourceFTPHost">10.25.116.98:21</sap:Record>
    <sap:Record namespace="http://sap.com/xi/XI/System/File" name="Directory">/input/test</sap:Record>
    <sap:Record namespace="http://sap.com/xi/XI/System/File" name="SourceFileTimestamp">20060228T112200Z</sap:Record>
    <sap:Record namespace="http://sap.com/xi/XI/System/File" name="FileType">bin</sap:Record>
    <b><sap:Record namespace="http://sap.com/xi/XI/System/File" name="FileName">input.txt</sap:Record></b>
    <sap:Record namespace="http://sap.com/xi/XI/System/File" name="SourceFileSize">770</sap:Record>
    </sap:DynamicConfiguration>
    But when i check my mapped field i see
    <field3>BodyC</field3>
    <keyfield>02</keyfield>
    <field5>BodyE</field5>
    <field6>BodyF</field6>
    </Body>
    - <Trailer>
    <keyfield>03</keyfield>
    <b><field2>null</field2> -> Null value instead of input.txt</b>
    </Trailer>
    </ns0:MT_Putfile>
    The code i have used to map the field2 of the trailer is the following ....
    <i>DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileType");
    String valueOld = conf.get(key);
    return  valueOld;  </i>
    Any clues ?

    Gosh this is spooky
    Anyway i tried with that line of code but it throws me an error during activation ...
    Activation of the change list canceled Check result for Message Mapping mm_IS | http://t-systems.com/Shabarish:  Starting compilation  Source code has syntax error:  /usr/sap/TXT/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Map387c7300a9ac11da9d280011256afae8/source/com/sap/xi/tf/_mm_IS_.java:104: cannot resolve symbol symbol : method getTransformationParameters () location: interface com.sap.aii.mappingtool.tf3.rt.GlobalContainer DynamicConfiguration conf = (DynamicConfiguration) container.getGlobalContainer().getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION); ^ 1 error
    The code is :
    DynamicConfiguration conf = (DynamicConfiguration) container.getGlobalContainer().getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    //DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    //String valueOld = conf.get(key);
    String valueOld = conf.toString();
    return  valueOld; 
    Thanx Renjith so far .. but i hope this gets resolved (else i will loose my sleep thinkin abt the situation)

  • Problem in Overwriting the file in Receiver File adapter

    Hi  all,
    I configured my scenario Proxy to File. Every day the back ground job runs in SAP and send all Employee Details to XI, XI then write it into File in XI server, in Receiver File adapter i enable overwrite existing file.
    But some times its over writing the file some times came up with error like "Access Denied".
    Can any one tell me what could be the problem.
    Kind Regards,
    Kiran

    > But some times its over writing the file some times
    > came up with error like "Access Denied".
    This can be a Authorization problem...may be at that time you are unable to write any file in that directory..or some other application is using it and it make a lock at that time.
    Thanks
    Farooq.

  • Problem with File Content Conversion (Receiver FIle Adapter)

    Hi Experts,
    I have following structure in receiver side:
    MT_Test
       F1
       F2
       F3
       F4
    Now I want a CSV file in target side in below format:
    F1,F2,F3,F4
    I have provided below config in receiver file adapter under content conversion tab:
    Recordset Structure : MT_Test
    MT_Test.fieldSeperator= ,
    MT_Test.endSeperator= 'nl'
    But this is generating blank CSV files in target directory..What might be the reason.. I have checked the msg in adapter engine, the XML file is correct and contains valid values for the fields..Its something like below:
    <?xml version="1.0" encoding="UTF-8" ?>
    <MT_Test>
       <F1>Hai</F1>
       <F2>Hello</F2>
       <F3>Bye</F3>
       <F4>Hi</F4>
    </MT_Test>
    I should get CSV file as
    Hai,Hello,Bye,Hi
    But I am getting a blank file with above said config parameters in content conversion tab.
    What might be the reason for getting blank CSV files in target side???
    Thanks,
    Adi

    Hi Adi,
    >>My target structure in below format:
    <?xml version="1.0" encoding="UTF-8" ?>
    - <MT_Test>
    <F1>Hai</F1>
    <F2>Hello</F2>
    <F3>Bye</F3>
    <F4>Hi</F4>
    </MT_Test>
    So, try to edit Data type and include hierarchy level above <F1>.
    Finally your Target Structure will resembles like this.
    <?xml version="1.0" encoding="UTF-8" ?>
    - <MT_Test>
    <Structure>
    <F1>Hai</F1>
    <F2>Hello</F2>
    <F3>Bye</F3>
    <F4>Hi</F4>
    </Structure>
    </MT_Test>
    FCC Parameters will be like this.
    Structure.fieldSeparator = ,
    Structure.endSeparator = 'nl'
    Hope you were clear.
    Thanks,
    Siva.

  • 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

  • Receiver file adapter creates empty files, Empty-Message Handling SP19

    Hello,
    We have just upgraded the system to SP19.
    One of the new features is that it should be possible to determine how XI messages with an empty main payload are to be handled in the receiver file adapter.
    If the parameter Empty-Message Handling is set to 'Ignore' no file should be created if the main payload is empty. In our case an empty file (size 0 kb) is still created even though the main payload is empty and the flag is set to 'Ignore'.
    Has anybody experienced the same problem?
    //  Best regards  Hans

    This should work:
    Use your own adapter module that parses incoming message and checks if it has any record sets in the document. If it does not have any record sets, then set the message to empty and then give this modified message to File receiver.
    For example, see the example code below:
    Module imports..
    Audit log import..
    DOM imports/SAX imports..
    public ModuleData process(ModuleContext moduleContext, ModuleData inputModuleData) throws ModuleException {
              try {
                   // get the XI message from the environment
                   Message msg = (Message) inputModuleData.getPrincipalData();
                   AuditMessageKey amk = new AuditMessageKey(msg.getMessageId(),AuditDirection.INBOUND);
                   Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS,"RemoveRootTag: Module called");
                   XMLPayload payLoad = msg.getDocument();
                   Document doc = parseXmlFile(payLoad.getInputStream());
                   if(doc != null){
                        if(!doc.getDocumentElement().hasChildNodes()){
                             Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS, "Document is empty!!");
                             payLoad.setContent("".getBytes());
                             msg.setDocument(payLoad);
                   // provide the XI message for returning
                   inputModuleData.setPrincipalData(msg);
                   } catch (Exception e) {
                   // raise exception, when an error occurred
                   ModuleException me = new ModuleException(e);
                   throw me;
                   // return XI message
              return inputModuleData;
         private Document parseXmlFile(InputStream xmlpayload) {
              try {
                   DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
                   factory.setValidating(false);
                   //        Create the builder and parse the file
                   Document doc = factory.newDocumentBuilder().parse(xmlpayload);
                   return doc;
              } catch (SAXException e) {
              } catch (ParserConfigurationException e) {
              } catch(IOException e){
              return null;

  • Empty Message Handling with Receiver File adapter

    Hi,
         We were using the "Empty-Message-Handling" (status set to Ignore) of Receiver file adapter to stop a 0 KB file from being written to the specified directory.
    However, inspite of this, a 0KB file continues to be written.
    The specifications are given below-
    File Construction Mode - Add Time Stamp
    Put File - Directly
    Empty Message Handling - Ignore
    Maximum Concurrency - 1
    File Type - Binary
    Can anyone please help with this.
    Thanks and Regards,
    Shiladitya

    HI,
    In one of thread the same problem was coming. Just look at the thread.
    Receiver file adapter creates empty files, Empty-Message Handling SP19
    Or
    Follow the weblog for the same requirement.
    /people/gowtham.kuchipudi2/blog/2006/01/13/stop-creation-of-an-empty-file-from-file-adapter-using-module
    Thnx
    Chirag
    Reward points if it helps.

Maybe you are looking for

  • Maximum DB Size?

    Mark, hello; can you please provide some kind of formula to estimate BDB JE limits? maximum database size? maximum number or records? maximum record size? maximum key size? thank you! Andrei.

  • Nokia 500 Belle Updating problem

    Hello, I've installed the latest version of Nokia Suite. It showed me Nokia Belle Demo and I installed but I cannot find Nokia Belle update. I'm currently using Anna version. Please help.

  • Find collective Search Help for partner function at runtime

    Hi experts, I have a screen very similar to VF05. When I enter the partner function, the corresponding field for the partner function, I want a collective search help to open. If I enter the partner function - Employee responsible, then the search he

  • Fading a bitmap

    I am trying to do a fade on a symbol against the backdrop of a bitmap picture. I have a solid shape, a movie clip from the library that I apply: "color, Advanced, settings" I take the alpha down to about -93. I can now see through my solid into the p

  • Trying to Export 16:9 to letterboxed 4:3

    I am using Final Cut Express HD 3.5. I am trying to Export my 16:9 widescreen HD Project to a 4:3 Letterboxed Quicktime Movie. I cannot get this to work correctly, never can get it letterboxed. Please, any Help...!!!!!!!!!!!!!!!!!!!