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;

Similar Messages

  • File Adapter - Create File Name from Payload

    Hello,
    I have a scenario where I'm sending deductions to external vendors (wage types) following a payroll run, via XI. Part of the message payload includes a data element 'Vendor Name' (e.g. Zurich Insurance). When the XI File Adapter creates the file, I want to create the files as /usr/file/xi/<Vendor Name>.csv
    How to I pick up the 'Vendor Name' from the message payload and pass this into the "File Name:" field of the "File Access Parameters in the File Adapter communication channel configured?

    hi,
    The dynamic filename generation concept is as follows.
    In your filename field. just give a variable with % symbols. (eg: %file% ).
    Now, under the option Variable Name Substitution, you can give how the value has to be created.
    It can be your interface name, sender service name, etc or it can be some value dynamically from your payload.
    For the former, your give
    message:interface_name ,etc
    and for the payload part you give,
    Payload: "your element root which u wanna acecss"
    Just check this link out,
    http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
    And read the contents under variable substitution and it will help you understand the concepts better.
    If you have any clarifications, do get back,
    Regards,
    Bhavesh

  • XI3.0 - file adapter create directory

    Hi,
    Is there anyway in 3.0 to prevent a receiver file adapter from creating a directory if it does not already exist.  There was a parameter in the J2SE adapter but I do not know if or how this has been implemented in 3.0.
    Regards
    Ian

    Ian,
    SPS 17 introduces a new configuration setting for the receiver file adapter: "Create Target Directory" which does exactly what you want.
    See http://help.sap.com/saphelp_nw04/helpdata/en/57/a21f407b402402e10000000a1550b0/frameset.htm
    Regards,
    Koen

  • How to use File Adapter to transport files

    Hi,
    Can i use File Adapter Additional Files settings to Transfer files from one system to other without conversion?
    File Adapter's Additional Files documentation says "additional attachments require a receiver that can process them". In my case receiver is also
    File Adapter.
    Please let me know if there is any other way to achive this.
    Thanks in Advance
    Jayant

    Hi Jayant -
    Here is the link to the documentation related to this:
    http://help.sap.com/saphelp_nw04/helpdata/en/3c/b4a6490a08cd41a8c91759c3d2f401/content.htm
    Notice in "Rules for Additional Files":
    "Messages with additional attachments require a receiver that can process them."
    Currently, the receiver file adapter does not support the processing of attachments.
    Regards,
    Jin

  • File Adapter : Archive bad files

    Hi Friends,
    If we select the archive option while configuring the file adapter, following behaviour is seen.
    1. Files that are successfully processed, get archived to provided folder
    2. However, failed/bad files get deleted from source folder and do not get archived
    Is it possible to configure the adapter so that only failed/bad files get archived?
    Thanks,
    Sachin

    Hi Sachin,
    You can configure to handle the rejected messages in different way as given under (11.1.1.6 - check documentation for your version):
    http://docs.oracle.com/cd/E23943_01/integration.1111/e10231/life_cycle.htm#BABBHJEA
    To achieve archival of only bad files, remove Archive property from your File Adapter and configure only the rejection handler.
    Regards,
    Neeraj Sehgal

  • File Adapter Stores temp file?

    I'm assuming a sender file adapter will store a copy of the retrieved file in the OS somewhere.  Does anyone know where this file would be stored and does it only exist until the adapter has completed processing of the file?

    Sorry folks I don't think I was clear in my original question.  All I want to know is when the sender file adapter connects to some remote system to retrieve a file...
    1) Does XI physically move the file to the XI box (regardless of the archive/delete/test setting) or does it simply load it in RAM?  For the adapter to be able to process the file my assumption is that it has to be loaded somewhere on the XI box.
    2) If it physically moves the file to the XI box where does it temporarily place it?
    I'm aware of the archive setting and other options for creating local copies.  I just want to know the "inner workings" of how the sender file adapter moves the files.

  • File Adapter not writing file when processed from one node in a clustered environment

    In our environment, we have 4 server nodes running. We are using a file adapter to write file to a location in the server. the adapter is writing files when its processing data in all nodes except one.
    Below is the JCA File
    <connection-factory location="eis/FileAdapter" adapterRef=""/>
    <endpoint-interaction portType="Write_ptt" operation="Write">
    <interaction-spec className="oracle.tip.adapter.file.outbound.FileInteractionSpec">
    <property name="PhysicalDirectory" value="/data/prd"/>
    <property name="FileNamingConvention" value="Sample.dat"/>
    <property name="Append" value="true"/>
    </interaction-spec>
    </endpoint-interaction>
    the File Adapter health is running OK. What would be the potential cause

    In our environment, we have 4 server nodes running. We are using a file adapter to write file to a location in the server. the adapter is writing files when its processing data in all nodes except one.
    Below is the JCA File
    <connection-factory location="eis/FileAdapter" adapterRef=""/>
    <endpoint-interaction portType="Write_ptt" operation="Write">
    <interaction-spec className="oracle.tip.adapter.file.outbound.FileInteractionSpec">
    <property name="PhysicalDirectory" value="/data/prd"/>
    <property name="FileNamingConvention" value="Sample.dat"/>
    <property name="Append" value="true"/>
    </interaction-spec>
    </endpoint-interaction>
    the File Adapter health is running OK. What would be the potential cause

  • File Adapter not processing Files which has COMMA in it

    Hi Experts,
    I am working on Project in SOA 11.1.1.6.
    I am trying to process a file which has comma in it. for eg - XXXXXXX-XX_XX_XXX11,99.pdf
    I am picking the file using file adapter from SOURCE directory and using another file adapter to WRITE to destination directory. Polling processing is working fine.
    I am picking the file from SOURCE directory as ATTACHMENT and WRITING to DESTINATION folder through File Adapter
    While doing file WRITE its failing. While reading the file the values of Content Type, Character Set and Encoding are NULL for the ATTACHMENT as they are optional properties.
    The error I am getting while File WRITE is
    <remoteFault>
    <part name="summary">
    <summary>java.lang.RuntimeException: Failed to decode properties string att.encoding=null,att.charset=null,att.contentId=AReadFile/XXXXXXXX_XX_XXX11,99.pdf_1352184009640,att.contentType=null,att.partName=attach</summary>
    </part>
    <part name="detail">
    <detail>1</detail>
    </part>
    </remoteFault>

    Comma is usually treated as a separator/delimiter and hence it is not really common to have comma in filename. I think because of this reason File adapter does not support it (have to cross-verify). If you really have a requirement to read/write files with comma in filename then better log a SR with Oracle support.
    Regards,
    Anuj

  • File adapter picking up files with wrong content

    Hello, We configured a file adapter to read *.xml files. We also defined the xsd for the files. We expected that the adapter would only pick up files that conform to the xsd. However we found that all *.xml files (even renamed jpeg's) are read. Is this intended behaviour? Or did we miss some configuration setting?
    Richard

    A short follow-up:
    To make matters worse. If I take a completely different file (like the jpeg) and rename it .xml it gets picked up by the file adpater but there is no audit trail of the BPEL process instance. The file is not archived either, so it's completely gone! If I just change one of the elements the file is read and archived. I can also have the file adapter write the file with the wrong content.
    I found a reference to a bug. (bug 5926809 or SR 6327165.994) is this related, is it solved?
    Richard

  • File Adapter : read XML file with data validation and file rejection ?

    Hello,
    In order to read a XML file with the file adapter, I have defined a XSD that I have imported to my project.
    Now the File Adapter reads the file correctly but it does not give an error when:
    - the data types are not valid. Ex: dateTime is expected in a node and a string is provided
    - the XML file has invalid attributes.
    How can I manage error handling for XML files ?
    Should I write my own Java XPath function to validate the file after is processed ? (here is an example for doing this : http://www.experts-exchange.com/Web/Web_Languages/XML/Q_21058568.html)
    Thanks.

    one option is to specify validateXML on the partnerlink (that describes the file adapter endpoint) such as shown here
    <partnerLinkBinding name="StarLoanService">
    <property name="wsdlLocation"> http://<hostname>:9700/orabpel/default/StarLoan/StarLoan?wsdl</property>
    <property name="validateXML">true</property>
    </partnerLinkBinding>
    hth clemens

  • Cannot open files or create new files in Photoshop cc trial

    Hi,
    after getting no support from your phone support line. I am writing here in hopes that this issue can be resolved. I cannot open files or create new files in Photoshop CC trial. Please help

    You can open Photoshop, you cannot create new documents. If you click file>new, the normal new dialog box opens, if you click "ok" it goes away. If you double click a PSD it focuses the Photoshop window. Nothing else happens.
    For me this is a new issue today. My computer is an i7/780, more than capable of Photoshop, and has run it fine up until now. My keyboard started freaking out last night and doing things I didn't want it to. I suspect it changed a setting or broke something.
    I have uninstalled and re-installed and it did not resolve the issue.
    This is obviously a critical issue that needs immediate attention.

  • Text Content Conversion - File Adapter - Creates empty file

    I am running XI 7.0.
    Mapping from abap proxy to file - text content conversion.
    The process works, generates and sends file from mySAP, maps through XI, logs onto ftp site and creates file, but doesn't write any data into the file!
    I am really confused as to what is happening!
    This is taken from the communication channel!
    Audit Log for Message: 5ccc2e46-c0f2-5349-e100-00000ddf240f
    Time Stamp Status Description
    2007-04-28 10:37:21 Success Message successfully received by messaging system. Profile: XI URL: http://host.fqdn:55000/MessagingSystem/receive/AFW/XI Credential (User): XIISUSER
    2007-04-28 10:37:21 Success Using connection File_http://sap.com/xi/XI/System. Trying to put the message into the receive queue.
    2007-04-28 10:37:21 Success Message successfully put into the queue.
    2007-04-28 10:37:21 Success The message was successfully retrieved from the receive queue.
    2007-04-28 10:37:21 Success The message status set to DLNG.
    2007-04-28 10:37:21 Success Delivering to channel: EPIW_FTP_Receiver_EmployeeRecords
    2007-04-28 10:37:21 Success File adapter receiver: processing started; QoS required: ExactlyOnce
    2007-04-28 10:37:21 Success File adapter receiver channel EPIW_FTP_Receiver_EmployeeRecords: start processing: party " ", service "XE_DEV_3RD_EPIW_001"
    2007-04-28 10:37:21 Success Connect to FTP server "ftp.ftp.ftp.ftp", directory "/ECS/Target"
    2007-04-28 10:37:21 Success Write to FTP server "ftp.ftp.ftp.ftp", directory "/ECS/Target",   file "epiw_output.dat"
    2007-04-28 10:37:21 Success Transfer: "BIN" mode, size 125 bytes, character encoding -
    2007-04-28 10:37:21 Success Start converting XML document content to plain text
    2007-04-28 10:37:21 Success File processing complete
    2007-04-28 10:37:21 Success The message was successfully delivered to the application using connection File_http://sap.com/xi/XI/System.
    2007-04-28 10:37:21 Success The message status set to DLVD.
    I can see the data before and after...  Any ideas?

    hi,
    this is starange:)
    did you refresh FTP (F5) ?
    maybe you're checking wrong ftp server? with the same folders ?
    ups - I thought I doens't create any file...
    as suggested check your mapping as per my blog:
    /people/michal.krawczyk2/blog/2005/09/16/xi-how-to-test-your-mapping-in-real-life-scenarios
    just use TCODe for abap mapping tests - SXI_MAPPING_TEST
    Regards,
    michal
    <a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

  • Receiver file  adapter creates an innecesarry extra line

    Hi,
    I have an issue with an extra line that add the receiver file adapter with the content conversion.
    The file XML that the file adapter has to convert, is the next;
    <root>
    <cofig>
      <FileName>NameOfTheFile.txt</FileName>
      </cofig>
    <lines>
    <line>
      <data>BBBBBBBBBBBBBBBBBBBBBB</data>
      <data>Aaaaaaaaaaaaaaaaaaaaaa</data>
    </lines>
    </root>
    Because FileName is not necessary, I remove it with:
    cofig.fieldFixedLengths 0
    cofig.fixedLengthTooShortHandling CUT
    but it leaves an empty line that i don't want. that is, the text in the file start in the second line.
    Any help?
    Thank you in advance.

    Can you do a small change in your mesg. structure ?
    change it to....
    <root>
    <lines>
    <line>
    <data>BBBBBBBBBBBBBBBBBBBBBB</data>
    <data>Aaaaaaaaaaaaaaaaaaaaaa</data>
    </lines>
    <i><b><cofig>
    <FileName>NameOfTheFile.txt</FileName>
    </cofig></b></i>
    </root>
    and then use
    cofig.fieldFixedLengths 0
    cofig.fixedLengthTooShortHandling CUT
    followed by
    endSeparator 0
    Ref: Suppressing Field In Receiver File Adapter for more details.

  • Receiver File Adapter - Create File on another SAP System

    I am working on a project that includes this requirement:  PDF files to be copied from a third party company via SFTP to a directory on our ECC system.
    We have worked out the sender side config, and the transfer of the files into PI works fine via SFTP.
    However, the PDF files are ending up in a directory on the PI system and not on our ECC system as expected.
    The receiver communication channel is set up as follows:
    Party = blank
    Communication Component = communication component of the ECC business system
    Adapter type = File
    ('Receiver' is ticked)
    Transport Protocol = File System (NFS)  (etc)
    Target directory = /tmp   (using this temporarily for testing)
    I would have thought using the ECC business system would mean the files would end up on that system, but instead they end up on the /tmp directory on the PI system.
    We are not permitted to use FTP between our SAP systems, so I can't go with that option.
    I've searched for help on this and only see conflicting and vague statements about whether the NFS protocol can or can't be used for transfer to another SAP system in the landscape. 
    Any suggestions and help on the above, and the best method of transferring the files to the end SAP system would be very appreciated.
    Regards,
    Christine

    remember that NFS means that it is referring to a file system on PI server.
    What you could do is mount a space on SAP PI onto SAP ECC so that ECC will be able to access the files on SAP PI.
    Guess that should solve the problem.

  • Receiver file adapter problem in file to file scenario

    My situation is: I created the scanrios with file adapters, using
    FTP, the sender adapter is picking up the file, but the output file
    is not been created in the path mentioned, both the adapter status
    looks green,  I have no error message in the sxmb_moni for this
    scenario. my adapter status looks as below:
      kris_scenario1_filetofile_receiverCC Receiver Adapter v2112 for
    Party '', Service 'krishna_bussystem01':
    Configured at 2006-05-28 20:14:19 EDT
    No message processing until now
      kris_scenario1_filetofile_senderCC Sender Adapter v2126 for
    Party '', Service 'krishna_bussystem01':
    Configured at 2006-05-28 20:11:35 EDT
    History:
    - 2006-05-28 20:16:25 EDT: Polling interval started. Length: 10.000 s
    - 2006-05-28 20:16:25 EDT: Processing finished successfully
    - 2006-05-28 20:16:25 EDT: Processing started
    - 2006-05-28 20:16:15 EDT: Polling interval started. Length: 10.000 s
    - 2006-05-28 20:16:15 EDT: Processing finished successfully

    Moorthy,
    as you suggested I checked in MDT, FYI I am doing without content coversion. from the below message I dont see any problem, so what could be a problem
    The sender has 'delivered' status but the receiver has 'to be delivered' status
    <b>Receiver audit log:</b>
    2006-05-29 00:07:56 Success The message was successfully received by the messaging system. Profile: XI URL:
    2006-05-29 00:07:56 Success Using connection AFW. Trying to put the message into the receive queue.
    2006-05-29 00:07:56 Success Message successfully put into the queue.
    <b>Sender audit log:</b>
    2006-05-29 00:07:54 Success Send binary file "filetofile.xml" from FTP server "xx.xx.xxx.xxx:/yyyyy", size 221 bytes with QoS EO
    2006-05-29 00:07:54 Success Application attempting to send an XI message asynchronously using connection AFW.
    2006-05-29 00:07:54 Success Trying to put the message into the send queue.
    2006-05-29 00:07:54 Success Message successfully put into the queue.
    2006-05-29 00:07:54 Success The application sent the message asynchronously using connection AFW. Returning to application.
    2006-05-29 00:07:54 Success The message was successfully retrieved from the send queue.
    2006-05-29 00:07:54 Success File "filetofile.xml" deleted after processing
    2006-05-29 00:07:54 Success The message status set to DLNG.
    2006-05-29 00:07:55 Success The message was successfully transmitted to endpoint http://host:port/sap/xi/engine?type=entry using connection AFW.
    2006-05-29 00:07:55 Success The message status set to DLVD.

Maybe you are looking for

  • User-defined fields in Enjoy transactions

    Hi, we have created two user-defined fields and added these in the entry variant for Enjoy transactions. However, we would like the fields to show with fewer characters. We have tried to reduce the length in the entry variant, but it seems that you c

  • How can you tell if apps have auto updated?

    When turning on Auto Update of apps in iOS 7, will iOS tell you if it has actually done an auto update? If so, how will it do this? Notification Center?

  • Cisco MXE Problem

    Hello all i need help for my MXE Cluster , i have 5 X MXE 3500 and i need to do cluster between the 5 X MXE3500. I faced  problems ( 2 of MXEs have 2 X VM and other 3 X MXE have 3 X VM (Virtual machines)  , i need to know the difference between then

  • Wired stream:  yes; wireless stream:  no

    I'll start by saying that I have read through the forum, the tips and troubleshooting, and other areas and couldn't find the specific answer I was looking for. However, if this is a duplicate, I apologize! I have an Apple TV along with three Macs: a

  • What does the attached files I email turn into dat files

    when I send email or receive email with attachments such as pdf or .docx, the files are unreadable on my iphone and become dat files.