Process 0kb empty file and deliver to target directory

Hello Experts,
We had a requirements to process an empty file handling and send it to the receiver/target directory. We had configured to "Process Empty File" Handling and “Write Empty File. The 0KB file polling successfully and archived to the directory with empty payload, but the message output was never created/sent to the target directory. In smxi_moni error message displayed:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
- <!--
Request Message Mapping
  -->
- <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="MAPPING">CANNOT_READ_PAYLOAD</SAP:Code>
  <SAP:P1 />
  <SAP:P2 />
  <SAP:P3 />
  <SAP:P4 />
  <SAP:AdditionalText />
  <SAP:ApplicationFaultMessage namespace="" />
  <SAP:Stack>Unable to read payload from the message object</SAP:Stack>
  <SAP:Retry>M</SAP:Retry>
  </SAP:Error>
Since this is an empty file, there are no mappings involved.  Is there a way to that we could check for 0kb file? If it is empty file, we want to pass/place the empty file to the target directory and if it is not empty, we want the message to process in the standard way.

Hi David,
"Since this is an empty file, there are no mappings involved. "
do you mean you didnt do the mapping at all cos it is empty file ?
though it is empty file still you need to do the mapping as usually,but when you check the option process the empty file both in sender and receiver adapter ,then it will process even an empty file comes.if you dont check these options and you get an empty file during the process then the mapping will fail.
in real time you don't know which one is empty file right,but her you know cos you are placing empty file.
I think you got to do all the steps you do in eneral for a scenario and top on that you have to check process empty file in both sender and receiver adapters,but you may not see the payload in SXMB_MONI.
but search in SDn you get lot stuff.

Similar Messages

  • How to Process an Empty File and deliver to the receiver channel

    Hello Gurus,
    We had a requirements to process an empty file and send it to the receiver channel .  We had successfully configured and polling an empty file, but the message output of the empty file was never sent to the receiver channel.  Is there any solution to process an empty file and move it to the receiver directory.
    XI 7.0 with latest sp
    Thanks so much in advanced,
    dn

    Thanks guys for a quick response!
    As mentioned above, we had already configured to handling "Process empty files" and were able to have the files polling successfully. The problem that we are facing is that, the output file were never created or delivered to the receiver directory. We want all files to process and deliver to the recipients even though it is an empty file.
    Thanks,
    David

  • FCC file channel cannot process the empty file

    Hi,
    My requirement is like that a msg mapping getting two files from different sources and combining into one file and send to the receiver. There is a possibility that any one of the file can be empty.. now  problem is how to process the empty file in FCC file channel. When we trying to process the msg we are getting the error msg like "file end of exception". we already check the option empty file in file comm channel....under processing tab. But no use.Though we achieved through a module in sender channel. i want to know how to achieve this through simple content conversion by the FCC channel.
    In Content conversion. Record----> item,.. here what is mean ''? 0 to outbound or 1 to outbound?
    Regards
    Balaji

    Hi Balaji,
    here what is mean ''? 0 to outbound or 1 to outbound*
    means 0 to unbounded.
    Let me remind u ... the requirement cannot be achived in this way.. if file is empty.
    I hope u already checked the option..
    process empty files.
    I think u can handle this by, using a adapter module, in which..
    if file size(ASMA) is zero.. create a empty message and send it
    to the PI.
    Babu
    Edited by: hlbabu123 on Mar 9, 2010 2:36 PM

  • Traversing files and directories underneath a directory

    I'm looking at some sample code about traversing files and directories underneath a directory. I'm trying to understand exactly what the code is doing. I see that dir.list() is building a string array of filenames and directory names. Then it tests each to see whether it's a directory. If it's a directory then is looks and each file and or directory in that directory.
    But I don't understand how it keeps going below just the second level directory. The two lines of code I'm not sure I understand are:
    1) process(dir);
    2) visitAllDirsAndFiles(new File(dir, children));
    Can anyone help me to understand exactly how this code block can traverse beyond just the second directory level?
    // Process all files and directories under dir
        public static void visitAllDirsAndFiles(File dir) {
            process(dir);
            if (dir.isDirectory()) {
                String[] children = dir.list();
                for (int i=0; i<children.length; i++) {
                    visitAllDirsAndFiles(new File(dir, children));

    No, I guess they might be assuming somethings. Here is the page with the sample code:
    [http://exampledepot.com/egs/java.io/TraverseTree.html]

  • How to find files and subdirectories in a directory

    can anyone tell me how to find files and subdirectories in a directory .

    Here's a code snippet,
    http://javaalmanac.com/egs/java.io/TraverseTree.html

  • Processing an empty file with file adapter

    Hi,
    We have a scenario where we are merging multiple files via a BPM.  One of the files that we read is a delta file, which at times can be blank/empty.  The multiple receive steps in the BPM are in one fork and the end condition is set up so that all the messages are received prior to the transformation step.
    When we attempt to read an empty file by activating the adapter, the adapter monitor reads that the message was processed successfully.  But, no message is created in XI.  Is this correct?  If yes, is there any way we can create a message for an empty file w/o using a module to change the contents of the file?
    Any suggestions or help is greatly appreciated.
    Thanks in advance.
    Best Regards,
    Duke

    Hi Duke,
    One suggestion:
    You can construct a message with some fields and use exists() function in mapping.
    try this link:
    http://help.sap.com/saphelp_nw04/helpdata/en/db/83f7b88528424c9113b15d5e0fb516/content.htm
    Regards
    Priyanka

  • Process Chain : Read PSA and Update Data Target in BI 7.0

    Hello Experts,
    In my Process Chain I have a variant Execute Infopackage to load the data only into PSA. then I have next variant as *Read PSA and Update Data Target*. my data target was a Master Data table Hierarchy
    In the variant " Read PSA and Update Data Target". the selection Parameters were
    PSA.Table : 0GLACCEXT_T011_HIER_BA1
    Selection Object Type : same Infopackage in Varaint Execute Infopackage
    the Error message was Variant doesnot contain a valid combination request/data target
    I checked the PSA-Table using RSA1OLD Transaction then I find four PSA Tables:
    0GLACCEXT_T011_HIER_BA1
    0GLACCEXT_T011_HIER_BA2
    0GLACCEXT_T011_HIER_BA3
    0GLACCEXT_T011_HIER_BA4
    All the requests are linked to PSA Table *0GLACCEXT_T011_HIER_BA4*.
    I can't understand why there exists four PSA Tables?
    I try to link the PSA-table 0GLACCEXT_T011_HIER_BA4 in the variant *Read PSA and Update Data Target and try to save it it raises short dump.
    If I select 0GLACCEXT_T011_HIER_BA1 in the varaint I shouldn't face any problems.?
    but the process chain raises an Error message Variant doesnot contain a valid combination request/data target with this variant.
    How shall I handle this issue?
    Please carify me the issues as soon as possible.
    thanks in advance
    Regards
    sailekha

    Hello,
    In the Variant Read PSA and Update Data Target I have to select  the PSA Tabelle Name from the preselection list in the System it shows me all the four PSA Tables that I mentioned.
    I can select any one of them. So I trieed with all the four PSA Tables in the list but I can selct only the XXXX......BA1 table  then only I can save and  include it in the PC. If I select the remaining tables BA2, BA3, BA4.........while I try to save the Variant it raises short dump.
    I checked the PSA using the Transaction  RSA1OLD under PSA...... I find 4 PSA Tables( I don't know whether they are PSA Tables or not but in the Variant it states that they are PSA Tables) in which all the requests are attached to BA4. only.
    I observed that ony for Hierarchies I find four PSA tables for remaining one only one PSA table was available.
    I totally confused how to handle this situation. any suggestions......... please help me to resolve this problem.
    Thanks & Regards

  • Sender Channel - File Archiving - No Create Target Directory option

    Hello,
    We are getting an error because our Sender channel is always trying to create the target directory when saving a file in our archive location. 
    Using a Receiver Channel the option "Create Target Directory" exists, so I can disable that option.  Is there a way to disable that option on a Sender Channel when archiving?
    Thanks,
    Matt

    Reviewing the settings available from Help.sap.com says:
    "Configure Sender File Adapter"
    Under Processing Mode, specify what is to happen to files that have been processed successfully.
    u25CB       Archive
    u25A0       To add a time stamp to the file name, select Add Time Stamp.
    The time stamp has the format yyyMMdd-hhMMss-SSS. The time stamp ensures that the archived files are not overwritten and it enables you to sort them according to the time that they were received.
    u25A0       Enter the name of the Archive Directory.
    I do not see anything in here that helps clear up this issue.
    Also, I have given a target directory.  The problem is it still tries to create that directory. 
    Thanks,
    Matt

  • 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

  • File Adapter - pass in target directory as parameter

    Hi
    I'm currently using a number of File/FTP Communication Channels
    all of which talk to the same FTP server
    but I have a requirement to send my translated file to specific directories on the FTP Server
    Ideally I'd like to have just 1 FTP Comms channel that has parameters for the Target Directory - how can this be done exactly.
    I can see in the File/FTP comms channel in advanced tab the ability to provide parameters and the saphelp
    is saying I'd need to pass in a directory paramater.... But where do I get to do this - I can think of Receiver or Interface Determination
    but I can see nothing there to do this.... what am I missing ?

    hi,
    In your Receiver Determination, you can add multiple Receievers and you can also add the condition on which the receiver has to be choosen.
    you can refer to:
    /people/shabarish.vijayakumar/blog/2006/06/07/customise-your-xpath-expressions-in-receiver-determination
    /people/shabarish.vijayakumar/blog/2005/08/03/xpath-to-show-the-path-multiple-receivers
    regards,
    ujjwal kumar

  • VB Script to find the last modified file and time in a directory

    Hi,
    I am new to VB script i need a script to find the latest modifed file and last modifed time in a directory(Contains  folders and sub folders inside it). it has to go through all the folders and get the latest file and last modifed time.

    Thanks it worked for me Get-ChildItem C:\Users\sujith.reddy.komma\Desktop\Suj1\* -recurse |?{-not $_.PsIsContainer} |Sort LastWriteTime -desc | select -first 1 now in my script i have hard coded the directory i need to run this script in different
    servers from one location i will put all the different paths in one text file and ineed to pass them to this script can you help me with this?
    Essentially you are incrementally asking us to write each line for you.  I recommend freeing yourself of this misery and leraning PowerShell.  THe answers to all of your questions are learned in the first few hours of study.
    Start here:
    http://technet.microsoft.com/en-us/scriptcenter/dd793612.aspx
    ¯\_(ツ)_/¯

  • XML files and assemblies in bin directory

    In VS 2010 the bin directory was very simple and straight forward.  Now in VS 2012 Web apps the bin directory is filled with a bunch of System and Microsoft assemblies a bunch of folders named with the two letter country code use in URLs and a bunch
    of xml files with the name of the System and Microsoft assemblies.  I can guess the reason for the assemblies is so that the web app can be deployed to servers without the .Net Framework installed or to which the installed app does not have access to
    the GAC.  But what is the reason for all of the xml files.  Then to add insult to injury, even though the project is  created with all of these xml files listed in the bin folder, each and everyone has a yellow triangle with an exclamation mark
    beside which I assume means that the file does not exist physically in the folder.  When you go to windows explorer sure enough they aren't there.
    What is the purpose of all of these xml files, and if they are needed then why aren't they added to the bin folder?  I can not publish my project because the files do not exist.  Can I delete these files with impunity?
    Edward R. Joell MCSD MCDBA

    How can you possibly think that this is an ASP.Net issue?
    Visual Studio 2012 created the listing for those files and foreign folders in the bin, NOT Asp.Net. 
    Visaul Studio 2012 listed those files in the bin and failed to create the files physically NOT Asp.Net. 
    Visual Studio 2010 does NOT put those extraneous files in the exact same kind of Asp.Net project, but Visual Studio 2012 does.
    This is behavior that only occurs with the new version of Visual Studio.  If it were an Asp.Net issue then Visual Studio 2010 would exhibit the same behavior.
    Visual Studio is the mechanism that carries out publishing the project.  This is a function of the IDE.  It is Visual Studio that is reporting it can not complete the task because it cannot find the files it did not create.
    This is new behavior from Visual Studio 2012,  which makes it impossible to work. 
    In addition, Visual Studio 2012 keeps having the Output and Errors window show up on the level where the code windows are suppose to open and the code windows open where the output window is supposed to open.
    This behavior has NOTHING to do with Asp.Net or it would be present in ALL versions of Visual Studio, but it is only happening in Visual Studio 2012.
    Are the moderators of this forum trying to avoid the hard questions, or are they trying to hide flaws in Visual Studio?
    Edward R. Joell MCSD MCDBA

  • JFileChooser - show files and directories only select directory

    I need a JFileChooser that will display directories and zip files but only allow a directory to be selected.
    basically i need to be able to select a certain directory that contains a certain zip file, so to make it easier to find i want the zip files to show up so i can find the correct directory...
    I tried...
            JFileChooser jfc = new JFileChooser();
            jfc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
            jfc.setFileFilter(new FileFilter() {
                public boolean accept(File f) {
                    if (f.isDirectory()) {
                        return true;
                    else if (f.getName().endsWith(".zip")) {
                        return true;
                    return false;
                public String getDescription() {
                    return "testing";
            });but that only displays directories in the GUI.
    The javadoc for the setFileSelectionMode() says, "Sets the JFileChooser to allow the user to just select files, just select directories, or select both files and directories. The default is JFilesChooser.FILES_ONLY. " ....which makes you think that setting the file selection mode only alters what can be SELECTED...however it alters what is displayed as well.
    ...any ideas?
    thanks

    This should display the files of interest provided the filter is tuned to do so, and allow you to select either the file of interest or the folder... If you select the file, then folder it is contained is returned.
    JFileChooser chooser = new JFileChooser();
    chooser.setCurrentDirectory(new java.io.File("."));
    MyFileFilter filter = new MyFileFilter();
    chooser.setFileFilter(filter);
    chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
    int returnVal = chooser.showOpenDialog(this);
    if (returnVal == JFileChooser.APPROVE_OPTION) {              
      System.out.println(chooser.getCurrentDirectory());
    }

  • Pick a particular file and keep on target side with the same file name

    Hi Guys,
    I have got couple of files in a folder. I need to pick only two files, I have setup BPM procedure 2 payloads merge. To keep these merged file with  the same source filename.
    Source side file Directory
    abc_12345_20100408101029.xml (abc_seq number_timestamp.xml)
    xxx12345.xml
    test.xml
    abc_12345_20100408101149.xml
    Target Side, How do I keep with the same file name?
    abc_12345_20100408111239.xml ---  same file name with diffrent timestamp.
    One more question: How to setup a file adapter to trigger between 2:00am to 5:00 am? in a particular time
    Does anybody has got quick idea, any links etc.,
    Your quick and positive response will be much appreciates.
    Kind Regards
    San

    Hi,
    One more question: How to setup a file adapter to trigger between 2:00am to 5:00 am? in a particular time
    For this you can Availability time planning (i.e you can schedule the file adapter to poll for the files with in the time interval i.e 2 -5)...
    for generating the file name at target side you need to look for the Dynamic Configuration as you need to change the timestamp for the file..and i am not sure how this works in BPM..
    in normal scenarios dynamic configuration will help....
    HTH
    Rajesh

  • BPEL process having one file and one FTP adapters and single instance

    hi All,
    We have a customer requirement where we have to read from FTP location (XML every 5 Mins) and Local file system (CSV every Min).
    There is no correlation between the files ...this file data could be same, only difference is some user will copy it in FTP location some in the local file system.
    We need to pickup these file as it arrive in respective locations and read one particular value from it and set a global value and do some processing.
    Next time when file arrives in any location (FTP or local) it should pickup the file compare the particular value to the global value which was set at the previous stage and do processing based on whether is greater or lesser and this reading should go on.
    As files needs to be picked up every Minute, customer doesnt want to initiate multiple BPEL process ...everything should happen in the single instance.
    how do solve this , pls help.
    Regards,
    Surendra

    Hi Surendra,
    When you say " everything should happen in the single instance", I hope you mean everything shud happen in the same BPEL process irrespective of the location(FTP or local) where file is copied.
    So, what you can do here is instead of using a single receive activity. Make use of Flow activity and put 2 separate receive activities( one each for polling local and FTP location) in parallel.
    After that you can separately act upon the variable from both the receive activities.
    thanks
    Saurabh

Maybe you are looking for

  • How I tried fix my partitions and restore a Dell Diagnostic Partition.

    UPDATED: 2 September 2012 UPDATE: Now that I reflect back on the incidence, I realize that the Dell Utility partition had lost its ability to boot long before I had messed up my partition table. But I realized it only when I was testing all my partit

  • Can I find out who is connected to my Personal Hotspot?

    I have turned my Personal Hotspot on. It says that there are 5 connections, yet only 4 people are actually using it. Just interested to see if someone hacked in, or if I'm just a tool

  • Need some urgent help on printing HTML

    I am trying to print an HTML using JEditorPane. I used all the GURU's views in this forum and copied the code. It works fine, but the images or not getting printed correctly Here is my HTML: <html> <head> <title>test</title> </head> <body> <h1>HELLO<

  • Multiple post mystery

    I've just caught myself sending multiple posts. I'm not sure exactly which sequence of keys I hit, but when I pressed the spacebar, I noticed the screen flashing and stopped typinf.  Fortunately, only two made it and I cancelled the third one.  I may

  • Nca.connect not workds for Oracle forms

    Hello, I recorded my Oracle forms script, did some parametrization changes. on nca.connect script failed: Connection Error: Session migration in progress       my example code: public void run() throws Exception {           beginStep("[1] QA - WebUti