Duplicate File Handling Issues - Sender File Adapter - SAP PO 7.31 - Single Stack

Hi All,
We have a requirement to avoid processing of duplicate files. Our system is PI 7.31 Enh. Pack 1 SP 23. I tried using the 'Duplicate File Handling' feature in Sender File Adapter but things are not working out as expected. I processed same file again and again and PO is creating successful messages everytime rather than generating alerts/warnings or deactivating the channel.
I went through the link  Michal's PI tips: Duplicate handling in file adapter - 7.31  . I have maintained similar setting but unable to get the functionality achieved. Is there anything I am missing or any setting that is required apart from the Duplicate file handling check box and a threshold count??
Any help will be highly appreciated.
Thanks,
Abhishek

Hello Sarvjeet,
I'd to write a UDF in message mapping to identify duplicate files and throw an exception. In my case, I had to compare with the file load directory (source directory) with the archive directory to identify whether the new file is a duplicate or not. I'm not sure if this is the same case with you. See if below helps: (I used parameterized mapping to input the file locations in integration directory rather than hard-coding it in the mapping)
AbstractTrace trace;
    trace = container.getTrace();
    double archiveFileSize = 0;
    double newFileSizeDouble = Double.parseDouble(newFileSize);
    String archiveFile = "";
    String archiveFileTrimmed = "";
    int var2 = 0;
    File directory = new File(directoryName);
    File[] fList = directory.listFiles();
    Arrays.sort(fList, Collections.reverseOrder());
    // Traversing through all the files
    for (File file : fList){   
        // If the directory element is a file
        if (file.isFile()){       
                        trace.addInfo("Filename: " + file.getName()+ ":: Archive File Time: "+ Long.toString(file.lastModified()));
                        archiveFile = file.getName();
                      archiveFileTrimmed = archiveFile.substring(20);       
                      archiveFileSize = file.length();
                        if (archiveFileTrimmed.equals(newFile) && archiveFileSize == newFileSizeDouble ) {
                                var2 = var2 + 1;
                                trace.addInfo("Duplicate File Found."+newFile);
                                if (var2 == 2) {
                                        break;
                        else {
                                continue;
    if (var2 == 2) {
        var2 = 0;
        throw new StreamTransformationException("Duplicate File Found. Processing for the current file is stopped. File: "+newFile+", File Size: "+newFileSize);
return Integer.toString(var2);
Regards,
Abhishek

Similar Messages

  • What is the use of additional file(s) in  sender file adapter?

    Hi experts,
    what is the use of  additional files parameter in sender file adapter?
    give me some example.......
    Thanks & Regards
    E.Ravi Chandra Reddy

    Hi,
    please check the below link,
    you can specify additional files to be included in the XI message as attachments.
    http://help.sap.com/saphelp_tm90/helpdata/en/44/692ab8a4b633eae10000000a1553f6/content.htm
    Regards

  • SAP PI 7.3 Single stack- Set tracing and logging

    Hi experts
    We  have configured a SOAP to SOAP sync scenario in SAP PI 7.3  single stack(Java Only).
    I have sent some test messages from WSNavigator to PI .
    But when i checked  messages in adapter engine, it is showing*"Unable to retrieve payload or you don't have sufficient authorization to view the content" I am able to monitor payloads of Async messages.
    How can we set Logging and trace levels in Single stack PI? I couldn't find any options in RWB os NWA.
    Thanks,
    Dhanish

    Hello Dhanish,
    As it was stated by Kenneth in his post, if you would like to see payload of a synchronous message in Message Display Tool (e.g. from Runtime WorkBench), you should set value of property messaging.SyncMessageRemover.removeBody of J2EE service XPI Service: Messaging System to 'false'. Please note that this affects only synchronous messages in final states (DLVD and FAIL).
    Regarding the second part of your question - logging. In PI 7.3, you can persist the message in Adapter Framework in two ways - stage it or log it. Staging allows you to edit/restart the message later from the stage where the message was persisted and is relevant for asynchronous messages; logging allows you to only display the logged message and is relevant for both synchronous and asynchronous messages. Please also note that staging affects performance of message processing more greatly than logging, extensive staging (e.g. staging on several processing stages) can even be a reason of performance degradation for processed messages, so if you only need to display details of the message on different processing steps in Adapter Framework, logging should be sufficient. Both staging and logging can be configured using properties xiadapter.stage.conf (for staging) and xiadapter.logger.conf (for logging) of J2EE service XPI Adapter: XI.
    Regards,
    Vadim

  • Want to learn SAP PI 7.4 Single stack

    Hi Experts,
    I am a beginner in SAP PI and started by journey with SAP PI 7.0. Now, we are upgrading it to SAP PI 7.4 single stack.
    I want to learn it as much as possible before the migration but when I search for the topics in SCN, I am getting confused with the different topics and its naming conventions explained. (For Eg PI and PO). So, will it possible for you experts to provide me the links which can actually help me to get the full depth knowledge on PI 7.4 (Single stack). Am just hoping to be a productive member of this SAP family:)
    Regards,
    Adarsh

    Hi Adarsh,
    SAP Process Orchestration is the new name of SAP Process Integration (SAP PI). SAP changed the name with the release 7.3 to include the additional features of SAP NetWeaver Business Process Management (nBPM), Advanced Adapter Engine Extended (AEX) and SAP NetWeaver Business Rules Management (BRM).
    Source - Latest version is SAP PO 7.4  or SAP PI 7.4 (commonly known as of now). Good part is that PO 7.4 license includes BPM and BRM. Till PO 7.4 SAP still provides the dual stack (ABAP + JAVA) option to install. But going forward it would be single stack (JAVA) only i.e. only swing tool for ESR and ID or NWDS. no more transactions/tocde.
    From a developer standpoint:
    You got all adapter based on JAVA. IDOC and HTTP are now IDOC_AAE and HTTP_AAE, also proxy scenario can be done using SOAP adapter XI protocol and there is no ccBPM.
    Regards,
    Sachin Dhingra

  • SAP PI7.31 Java Single Stack  - Default Delete Job Retention period

    Hi
    anybody know where the Default Delete Job Retention periods can be set ?     I'm on a SAP PI7.31 Java Single Stack.

    thanks  - in milliseconds  - very precise.
    1) NWA-->Configuration-->Infrastructure -->Java System Properties
    2) Go to Services tab, and type XPI and select – XPI Adapter: XI
    3) Type “persist” in Properties filter
    4) for example Set Retention period in Milli seconds and save
    2592000000 = 30 Days

  • Production issue - Sender File adapter not picking up the files from folder

    Hi Guys,
    Ever since the upgrade from XI 3.0 to PI 7.1, we have come acrossinstances of weird error.
    Thsi time again - now the 3rd time - tandom basis, in our production PI server, we have teh file slying in the source directory folder in the server.
    I can see the files lying there in AL11.
    However, it looks like that the file polling has just stopped and the channel is going blank in channel monitoring.
    I have checked in SXMB_MONI and there are no messages since the morning.
    I have tried craeting a replica of the current channel but it is not working.
    This is teh production server and thsi has alraedy created production issues.
    I ahve checked in the SDN forum but am not able to find the details.
    Plaese help me.
    I am anyway going to raise the issue with SAP now.
    Regards,
    Archana
    <REMOVED BY MODERATOR>
    Edited by: Prateek Raj Srivastava on Jun 8, 2010 4:50 PM

    Hi Prateek,
    I have trying all sorts since the morning and then just checked teh file permissions.
    The file permissions were incorrect as compared ot the other files that were processed successfully today.
    Somehow the permissions were changed on the server and the interface channel was not able to poll the files.
    I got teh permissions changed back to 666 and all the files were pikced up in a minute.
    I got the folder checked and it seems like that the permissions were changed somewhere very early in the morning and we are trying to find out how it happened and who did that.
    However, another question i had - this sender file adapter was polling the source directory and deleting the files from there.
    I would have expected that if the channel had issues with the file permission because of which it was not able to access the file, it would have thrown an error something like the file permissions error.
    But there was not a single error in the channel monitoring.
    How can we configure it in a beter way so that we at least soem kind of error indication?
    Please advice.
    Regards,
    Archana

  • Regarding issue sender file adapter in clustered  environment(PI 7.0)

    Hi Experts,
    we  are using  sender  file adapter in clustered environment(there are 6 J2EE cluster nodes in XI system) for an interface.the  file sender communication channel  for this interface  is scheduled to run twice  every day. recently   the   channel stopped polling (picking the files from the source directory) and i dont see any error.
    when i open Communication Channel monitoring in RWB and select the file sender communication channel  and run it manually, none of the cluster nodes  are polling for the file.
    i have tried   editing the communication channel in Integration Directory   and  activating  it. but it does not pick the file.
    Can you let me know how  the issue can be resolved.
    Thanks
    -Kaushik
    Edited by: Kausik M on Dec 18, 2008 4:13 AM

    Kausik,
    A computer cluster is a group of linked computers, working together closely so that in many respects they form a single computer. The components of a cluster are commonly, but not always, connected to each other through fast local area networks. Clusters are usually deployed to improve performance and/or availability over that provided by a single computer, while typically being much more cost-effective than single computers of comparable speed or availability.
    clearly your cluster nodes are out of sync...!!!!
    It is possible that your ftp server went down for a while . And in the profile of FTP machine the entry of XI server is not made permanent .
    1. Try to ping the FTP site from XI server.
    BTW are u getting any error msg at RWB ?
    Regards,

  • Read multi-tabbed excel file attachments from Sender Mail Adapter.

    There is a need to read excel attachments from incoming email to a
    mailbox. We know we can use Sender Mail adapter to easily read .xml, .txt
    or .csv attachments.
    For excel attachments we know from SDN that you have to write
    adapter modules to handle excel. However the excel file we need to read has
    multiple worksheets(tabs) and data may be contained in any of them.
    Is it possible to use SAP XI Mailsender adapter to read such a file as an attachment? What kind of module development would we need for this? I am not much of a Java programmer so examples or links to other documentation would help.
    Thanks,
    Rudra

    Rudra,
    Use Java Mapping.  There is a free java api available called JExcelAPI to achieve this. 
    Shabarish's blog describes about this.  This might be helpful to you
    /people/shabarish.vijayakumar/blog/2009/04/05/excel-files--how-to-handle-them-in-sap-xipi-the-alternatives

  • How to count the  number of files read through  sender file adapter

    Hi  ,
    I have a scenario where I am reading  files from a third party system and trying to send those files to R/3 system .The frequency is 1 file per day .But there can be situation where  the source system can put  2 to 3 files in source folder and so XI sender adapter will pick up all the 3 files at time . And I want to send only 1 file at a time to r/3 .
    Do you know any way to handle this requirement ?
    Thanks ,
    Suvarna

    Hi,
    Like Bhavesh pointed out, you could EOIO as the Quality of Servie in the sender file adapter.
    But I guess this would solve your issue only to a certain extent.
    Marking this QOS in the sender file adapter would only mean sequential processing of the files. That is, the second file will be sent only when the first file is successfully received by the end system.
    It would not ensure that the files are sent only after 15 mins of the first file is sent.
    If the 15 mins time period is important, then this needs to be achieved using a BPM which ensures that the messages are sent to the target only every 15 mins.
    In case, the frequency of the incoming files is not known (in which case, the having a BPM would be a bad idea) you could use a ztable, which stores the filename and time the file was sent to the R/3.
    You could query this table each time, before sending the file data to the R/3
    Regards,
    Smitha.
    Message was edited by:
            Smitha Rao

  • OS command before file processing in Sender File adapter

    Hi there,
    I'm having troubles running a os command from the sender file (NFS) adapter.  The batch file which I try to run is not getting executed at all.
    When I manually run the same batch file from the command prompt then it works perfectly.
    The OS command looks like this from the adapter config:
    myserver\xi\interface\in\dothis.bat
    I have also try with this notation
    G:\myserver\xi\interface\in\dothis.bat
    Please give me some tips how can I solve this problem, is there any way how can I debug the OS command? When I look at the adapter monitonr no errors are showed.
    Thanks for any tips.
    Roberto

    Hi all,
    The problem is solved.
    Issue: File Receiver Channel does not execute the OS Command before message processing.
    Reason: XI always expects an input file (in my case the sender communication channel) on the source folder. If no input files are found then the rest of the adapter configuration is not executed at all.
    In our scenario the OS command is responsible for retrieving the input files from a FTP server the adapter. SO XI will never trigger the OS Command.
    Solution: Place a dummy input file on the source folder , the sender adapter will always read in this file and put it back on the same location.(e.g. using a condition in the receiver determination).
    Thanks,
    Roberto

  • Case Insensitive File Names in Sender File Adapter

    Hi,
    I've tried my best to search SDN on this issue with no help...
    My sender file name can have any case (upper or lower) e.g.
    ABC_123.txt
    or
    ABc_345.txt
    or
    aBC_456.txt
    However configuring the file name in the sender file channel as 'ABC*' did not work
    only files with name starting with the capital letters ABC got picked up and lower case did not get picked up...
    any suggestions on how this can be overcome
    Thanks
    Bharath Sai

    what if my file name has to be F0215DBFR* ??
    should I give 4*4 = 16 combinations ?
    looks funny... but feasible..
    was hoping SAP has a standard solution like
    [Ff]0215[Dd][Bb][Ff][Rr]* ?
    Anywise.. thanks a lot for your help Satish.. will use this technique (16 combinations for my req..)
    Edited by: Bharath Sai R on Sep 25, 2009 4:37 PM

  • File missing from Sender File Adapter

    Hi,
    I have got some serious issue in the production environment where the file picked up by the J2EE Sender File Adapter has disappeared and I can't see any trace in sxmb_moni, adapter engine monitoring, integration server monitoring within the Message Monitoring.
    I have tried increasing the log to 1 in the sxmb_adm-->integration server configuration, still no help.
    Can somebody please suggest where should I look at.
    TIA.
    Ranjan Koirala
    The issue was that I was using a separate queue name and somehow the queue was corrupted thats why the message was not going anywhere.
    Message was edited by: Ranjan Koirala

    Ranjan,
    Incase you are trying to find out what happened to your message, one option could be to use the JMS commands - in particular 'JMS LIST DEADMSGS'. this command i believe lists the destinations for all the dead message on the server.
    regards,
    Sapknowledge

  • File Content Conversion - Sender File Adapter - Record Delimeter ~

    The inbound file has file has ~ as record delimeter. I am using the FCC at sender file adapter to covert this file into XML. Somehow, the file adapter is not able to interpret "~" as my record delimeter even thoough I specified "record.endSeparator = ~" in FCC.
    Would someone help me with a solution?

    Raju,
    You can also try to use the '0x7E' as endSeperator condition.
    I am not sure if the HTML tag will work but this should do the trick. This should be the HEX corresponding entry
    char       description        hex               char code       html
    " ~ "         "Tilde"               "0x7e"         "~"                      &!tilde; (without !)
    greets.
    in adition to this see SAP help
    http://help.sap.com/saphelp_nwpi71/helpdata/en/44/655453b48a4ddfe10000000a1553f7/frameset.htm
    Special Characters in Strings for Separators
    In all strings for separators (NameA.fieldSeparator, NameA.beginSeparator, NameA.endSeparator), you can specify non-printable ASCII characters. These characters can each be inserted individually in the strings in the form ´0xHH´ (including the quotation marks), where HH represents the character encoded as a hexadecimal value.
    Please also ensure that the "recordSet Structure" also need to be configured Correctly
    for example:
    Header,1,Detail,*
    Header.fieldSeperator  --> %parameter%
    Detail.fieldSeperator --> %parameter%
    Detail.endSeparator --> '0x7e'
    Greets

  • Which file fails in sender file adapter

    Hi.
    Is there a place in the monitoring landscape, that can tell me the filename of a file, that fails in a sender file adapter (lets say I receive files with filename *.txt).
    The file adapter uses content conversion.
    Right now, the RWB only tells me that something went wrong in the content conversion. The filename would be nice for people working in a CCC to forward to second level support!
    Regards...
    Peter

    Hi,
    In the sender file CC..
    Check the option filename and filetype under the adapter specific attribute so  that the payload will have the filename too...which make the life easy...
    Regards
    San
    Remember to set the thread to solved when you have received a solution there is a Way.

  • File renaming in Sender file adapter usins OS command

    Hi Guys ,
    Can anyone explain on how to use the rename command in Sender file adapter using OS command parameter.
    Thanks,
    KC.

    Hey
    run the following OS command
    mv <originalFileName> <newFileName>
    This command will copy the <originalFileName> to a new file called <newFileName> and will delete the <originalFileName>
    There is no rename command in Unix,mv is used to rename the files
    Thanx
    Aamir

Maybe you are looking for