File Adapter Overwriting the output files

Hi All,
I´m using a File Receiver Adapter to write flat files on to an FTP. Same Communication Channel is used for all types of output files (As per the business requirement the file name(
MzOutput.txt) shud b same for Deliverz orders, Purchase orders etc...). The receiver legacz szstem reads one file at atime and deletes it. So if i´m writing a Deliverz Order File, i have to wait until the file MzOutput.txt gets deleted and then i have to write the next file using the same name. in order to acheive this, i had used a module processor which waits until that MzOutput.txt gets deleted. Mz problem is
As there are ´n´ no of orders waiting in the queue, if at 12:14:00 the MzOutput.txt gets deleted, then two threads which check for the existance of the MzOutput.txt file finds nothing and tries to write at same time. as a result, first file got overwritten by the second file.
I dint check the indicator OverwriteExisting File in the CC configuration.If i use two different CC channels to write the same file, it is giving FTP Exception which is true.
I´m loosing few deliveries as a result of the above case. Can anzone please help me out in this regard?
Thnx in Advance
Anil

Hi Anil,
Why dont you write the files with 'Add time stamp' option on for the file name and then the third party/legacy system to read the files in the order which they were created.?
Another option will be to write these files into a folder with these Add time stamp option/counter option and make a shell script check the folder for the MzOutput.txt file exists in the folder from where the third party/legacy system reads the file and once it has deleted the existing file, then ur files shud be moved in the order in which they were written n the temporary folder.
This will avoid the queue of messages in the adapter engine.
Cheers
JK

Similar Messages

  • 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

  • Sender File Adapter picking the same file twice

    We are facing a weird issue with File Sender Adapter
    We are using PI File Adapter ( NFS ) to read files for a NFS folder and
    processing those in PI.Normally it works fine. But for a scenario we
    are noticing it sometimes process the same file twice before archiving,
    thus duplicating the financial postings.
    What we have is :
    File Sender Adapter - NFS, Polling interval 60 secs, and Processign
    mdoe Archive. File name includes Wildcards - JE_Upload*.txt
    what we are noticing is that :
    when it picks up a file, it immediately polls again to check for
    another file, and sometimes the file is not yet archived so it picks up
    and reprocess the same file.
    If you see the message below, both belong to the same file, and it
    picked up the same file again in 12 secs after processing it the first
    time
       Successful 02.11.2009 15:01:00 02.11.2009 15:01:01   APMANUAL     urn:bl:i2g:003:100
    SI_SKF_FIDOC_OB XI Message
       Successful 02.11.2009 15:00:49 02.11.2009 15:00:50   APMANUAL     urn:bl:i2g:003:100
    SI_SKF_FIDOC_OB XI Message
    Anyone seen this behavior before?

    Hi,
    Please check the script which creates file in source NFS Folders. There is possibility that script is making change in file when PI is picking up the file.
    When PI picks the file first time it creates one message ID in system. After that if script is making any change in file without file name change (This need not necessary data change), for PI it becomes new file and new message gets generated in PI for same file.
    This error normally comes when File adapter is not able to archive file succesfully. For eg. file with same name alredy exists in Archive folder.
    File adapter generates the new message id whenfile get modified(eg.change in its length or data change) even though
    the file name is same and when file get change ,XI file adapter thinks that its new file and hence generate the new message id for same file.
    If file has same name and notmodified then XI adapter will not generate new message id and will keep on throw the error till you remove that file with same name from the
    archieve directory.
    -Warm Regards,
    Gouri

  • Exe file not producing the output files

    Could anyone please help me with my exe file. I have an exe file "exeFile" which takes more than one file as input from the source "c:/files" and produces some files as output into the destination "c:/files". Both my source and destination is same. My code given below is neither showing any error nor outputting any files. My code is:
    private static void compilingFiles() throws IOException
         String FirstParam = "C:/files";      
         String SecondParam = "C:/files";
         Process proc =Runtime.getRuntime().exec("cmd /c start /MIN C:/files/exeFile " + FirstParam, (String[])null, new File(SecondParam));
    }

    After going through The reference, I modified my code as under. My first exe file "tex" is doing the necessary as before, that is producing the output files to the destination, but the second exe file "fi2t1" is not producing the necessary output.
    My output after running this file is:
    <ERROR>
    </ERROR>
    Process exitValue1: 0
    <ERROR>
    </ERROR>
    Process exitValue2: 0
    <ERROR>
    </ERROR>
    Process exitValue1: 0
    <ERROR>
    </ERROR>
    Process exitValue2: 0
    <ERROR>
    </ERROR>
    Process exitValue1: 0
    <ERROR>
    </ERROR>
    Process exitValue2: 0
    So as per The reference, I think my code is right - "So, MediocreExecJavac works and produces an exit value of 2. Normally, an exit value of 0 indicates success; any nonzero value indicates an error.".
    So please tell me where am I wrong. My code is:
    import java.io.BufferedReader;
    import java.io.File;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    import java.util.*;
    public class FontDriverCompile
         public FontDriverCompile()
         void compileFile(File newFile, String renameSub, File outputfile) throws IOException
              String FirstParam = "C:\\Temp\\sample\\font-driver.tex";  
              String FirstParam2 = "C:\\Temp\\sample";
              String SecondParam = "C:\\Temp\\sample";  
              try
                   Process proc1 =Runtime.getRuntime().exec("cmd /c start /MIN C:/Temp/sample/tex " + FirstParam, (String[])null, new File(SecondParam));
                   InputStream stderr = proc1.getErrorStream();
                   InputStreamReader isr = new InputStreamReader(stderr);
                   BufferedReader br = new BufferedReader(isr);
                   String line = null;
                   System.out.println("<ERROR>");
                   while ( (line = br.readLine()) != null)
                        System.out.println(line);
                   System.out.println("</ERROR>");
                   int exitVal1 = proc1.waitFor();
                   System.out.println("Process exitValue11: " + exitVal1);
              catch (Throwable t)
                   System.out.println("t.printStackTrace()_1");
                   t.printStackTrace();
              try
                   Process proc2 =Runtime.getRuntime().exec("cmd /c start /MIN C:/Temp/sample/fi2t1 " + FirstParam2, (String[])null, new File(SecondParam));
                   InputStream stderr = proc2.getErrorStream();
                   InputStreamReader isr = new InputStreamReader(stderr);
                   BufferedReader br = new BufferedReader(isr);
                   String line = null;
                   System.out.println("<ERROR>");
                   while( (line = br.readLine()) != null)
                        System.out.println(line);
                   System.out.println("</ERROR>");
                   int exitVal2 = proc2.waitFor();
                   System.out.println("Process exitValue2: " + exitVal2);
              catch (Throwable t)
                   System.out.println("t.printStackTrace()_2");
                   t.printStackTrace();
    }Message was edited by:
    sony_tj

  • Why the output file is so big?

    Dear All,
             I am trying to write some data to the binary file. But the output file is very big. When I write 1M*4kB ,the file will more than 20MB. I don't know why.
            This is my vi, Please help me to find the fault,OK? Thank you very much.
            Thanks.
    Attachments:
    question1.vi ‏105 KB

    It is NOT the same vi!!! You need to familiarize yourself with dataflow, LabVIEW does NOT execute left to right, any part can execute if all inputs have data.
    In your particular case, the "file info" will execute at the same time you are building the file path. In addition, you are measuring the size of the stripped path and not of the new file. Try execution highlighting!
    To fix your code:
    You need to get the "file info" from the path AFTER you add the new filename.
    Use the error cluster to enforce proper execution order as in my example. WIre the error out of "close" to the error in of "File info". Now the "File info" must wait until all inputs have data, which can only happen after "close" has completed.
    All clear?
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    SizeTest.vi ‏29 KB

  • File adapter picking up partial files

    Hi All,
    We are facing a wierd problem with the File Adapter.
    The problem is that, we are getting the xml files from the source system, and PI is supposed to pick them up and process them. Sometimes, the file adapter is picking up the empty files / partial files, i.e., before the file is completely written on to the FTP folder.
    We tried increasing the polling interval. But this did not help. Since we are taking the files from the FTP, the option "MSecs" in Additional Parameters also will not work. As we are on PI 7.0 SP13, we tried to search for the "Empty File Handling" option wherein we can make the file adapter skip the 0kb files. But we are not able to find that option anywhere.
    Please help us find a solution to this problem.
    Thanks,
    Hari.

    Hari,
    In sender communication channel click on  Advanced. Then you see the paramter Msecs to Wait Before Modification Check. Add a value 3000. Then you should be good.
    Regards,
    ---Satish

  • Input file should be deleted only after the output file is successful.

    Hi Experts,
    Could you pleas solve the below issue.
                           In  a file to file scenario, the input file will be picked from a directory location and after processing output file will be placed in the output directory location specified in the receiver communication channel.
    In the sender communication channel for the scenario mentioned above, if the processing mode is given as delete, the input file will be delete as soon as the file was successfully read by the adapter, but this will not ensure that the file processing is complete and the output file is being created.
    If we have a scenario in such as way that the input file should be deleted from the input folder only if the complete process is successful and the output is generated. how can we achieve this functionality?.
    And one more thing if we got the successful output the output file should be placed in one folder. and the if the output file is having errors it should be placed in other folder.

    Hi,
    In Receiver communication channel I have used the below command in Run Operating System
    .And I have kept the processing mode of sender communication channel as test.
    cmd.exe: /C "del /Leela/test.xml"
    You are running the comman line program configured in the receiver File Adapter,but in command line you mentioned the Sender File Folder , So i guess it's not getting processed.
    Try this:
    Try to run the command line in the Sender File Adapter Side
    "Place this in " --> Run OS Command After Message Processing.
    Hope this would work and get in parrallel with u r requirement.
    regards
    Srini

  • IDOC to XML : error in opening the output file in iexplorer

    Hi Frnds,
    I have a scenario IDoc to xml where in Im getting some non ascii values in the idoc for which I used ISO-8859-1 encoding technique but still the conversion is not done. Iam unable to opend the output file in internet explorer giving the follwoing error as :
    An invalid character was found in text content. Error processing resource
    Please help me how to overcome this issue.
    Thanks in advance,

    Hi,
    As i posted previously in xi UTF-8 is the default encoding if message protocal is FILE.
    And UTF-8 encoding support unicodes..
    Can reconfigure your receiver file adapter with file type as Binary and check once again.
    go through http://help.sap.com/saphelp_nw04/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/frameset.htm  
    refer  File Type
    now i check with a japanese double byte character and i can open in iexplorer.
    regards,
    pradeep A.

  • Same setting for two file adapter but different output

    Hi ,
    I am having two receiver file adapter for two differrent scenario with same settings but different structure.
    I want the output of the file for both the scenario should be displayed line by line but it is working fine for one scenario.File type,file encoding and FCC are same in both the interface except the fieldsnames in FCC.
    When i check both the output file i found that the scenario which is working fine  having OA OD hexadecimal value at the end of line of each line.and the second scenario which is giving the output in single line is having only OA.
    waitng for Valueable inputs!!!
    Thanks
    Santosh

    Hi Santosh,
    Kindly elaborate your question.
    it would be helpful if you post the content conversion parameters of the erroneous file channel.
    Regards,
    Varun

  • How do you configure AME CS5.5 to overwrite existing output files?

    How do you configure AME CS5.5 to overwrite existing output files?  So far the only options I have found are to increment the output file name or fail.  From the explaination of file increment I would have expected overwrite to be the alternative.  We work daily with the same file(s) on an hourly basis and convert via watch folder to over a dozen file types and network mapped destinations.  Re-using the same file name is critical to the final project (updating website content). Does anyone have any suggestions?

    Has there been any updates on overwriting output files in CS6? This would be extremely helpful.

  • 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

  • How to get the Output File Name as One of the Field Value From Payload

    Hi All,
    I want to get the Output file name as one of the Field value from payload.
    Example:
    Source XML
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns0:MT_TEST xmlns:ns0="http://sample.com">
    - <Header>
      <NAME>Bopanna</NAME>
      </Header>
      </ns0:MT_TEST>
    I want to get the Output file name as " Bopanna.xml"
    Please suggest me on this.
    Regards
    Bopanna

    Hi,
    There are couple of links already available for this. Just for info see the below details,
    The Output file name could be used from the field value of payload. For this you need to use the UDF DynamicFile name with below code,
    //       Description: Function to create dynamic Filename
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File" , "FileName");
    conf.put(key,a);
    return "";
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File" , "FileName");
    conf.put(key,a);
    return "";
    With this udf map it with the MessageType as
    (File Name field from Payload) > DynamicFileConfiguration>MTReceiver
    Thanks
    Swarup

  • Why is the output file jerky ?

    Hi there,
    I have AE CS5 on my Mac. My system is 27" iMac core i5 with 12 GB RAM DDR3 1333 MHz with quad core.
    I rendered a 40 seconds clip with an earth spinning.
    I output it to mov format in 1920 x 1080.
    When I did a RAM preview, it was fine & the earth was spinning smoothly.
    But the output file (in mov) - (I did thru Composition > Make movie) when I play using QuickTime player is jerky at 20th Sec to 29th sec.
    I then import this mov file into Final Cut, it look stuck in the Viewer but was perfect on the Canvas.
    When I render in Final Cut, the output file as mov and use the same Quick Time player to play it & it is perfect.
    Can I know what is the reason that it is not working in Quick Time the first time when it was fresh out from AE ?
    Thank you.
    Cheers

    The default render settings use Quicktime Animation codec at best quality. These files will not playback smoothly because the data rate is too high for the hard drives to keep up with. The animation codec is a lossless codec designed not designed for playback.
    Final Cut uses compressed codecs designed for playback as the default. I'd suggest that you open up the help files (F1) and read the entire section on Rendering and Exporting (link).

  • I have this following problem in Adobe Premiere Elements 11: Error of export: You don't have permissions to create or delete the output file.

    Hey guys,
    I have this following problem:
    When i export my movie to my desktop from premiere elements 11 it fails and says "Error of export: You are not permitted to create or delete the output file."
    This is the first time i had this problem.
    I have no ideas to solve this problem ... I don't found it on this page neither in the whole web -.-
    I look forward to get requests

    S
    QuickTime is a requirement for Premiere Elements (any version). Please download and install it so that we can continue this troubleshooting. Among other things, without QuickTime installed, you will not have QuickTime presets in Publish+Share and will not have available to you codecs supplied by that player.
    Please right click the Premiere Elements 11 desktop icon and apply Run As Administrator. Please review computer permissions..
    In the meanwhile, please reply to all the questions, including
    What is the description for your export choice and does it make a difference if your Export Save In location is the desktop or to Video Folder in Documents?
    What is a description of your computer resources?
    Please consider and supply details need to help us help you.
    We want you to succeed.
    Thank you.
    ATR

  • Question about file conversion in the sender file adapter

    Hi, all.
    I am trying to get the file adapter to parse a file. The message type is the following:
    JOB
       Msg  0..1
          Transaction  0 ... unbounded
             Data   0 ... 1
                f1 string
                f2 string
    How would you define the recordset name and recordset structure to produce the same structure in the converted xml. I tried:
    recordset name : Msg
    recordset structure : Data, *
    But the transaction is missing. I tried:
    recordset name: Msg
    recordset structure : Transaction, *
    Then the data is missing. Note that the actual data in f1, f2 ... are loaded successfully though.
    Thanks,
    Jonathan.

    Hi, Hareesh
    I agree. But that is how it is defined now by someone else. It is hard to change it as he defines the same structure on the receiving side. I didn't want to change the receiving structure as it touches the proxy code too. So I want to make something short and sweet.
    Basically the data looks like this:
    11,222
    55,666
    The result xml should be something like:
    <JOB>
      <Msg>
         <Transaction>
            <DATA>
               11
               222
            </DATA>
         </Transaction>
         <Transaction>
            <DATA>
              55
              666
            </DATA>
          </Transaction>
      </MSG>
    </JOB>
    I know either the DATA has no meaning and it's giving me a headache ... but that's how it's done and I don't want to rock the boat too much. There are lots of mapping that I have changed otherwise.
    Thanks,
    Jonathan.

Maybe you are looking for