File name check during a BPM.

Hi All,
Can we configure the file sender/receiver adapter to just check whether a file with a particulat file name exists in a directory?
I want to do this check at a particular stage in BPM. If the file name is detected, I would like to proceed in a BPM.
Kindly assist.
Thanks,
John

Hi John,
You can use this code in the udf if the file directory is in the local file system
public String fileExists(Container container) throws StreamTransformationException{
   String FilePath = "C:\\FileName.txt";
   String reslt = "false";
   File f = new File(FilePath);  // You can even get this FilePath through function parameter as var1
   if(f.exists)
      reslt = "true";
   else
      reslt = "false";
   return reslt;
The function will return a string "true" if the file exists and "false" if not.
Regards,
Aravind

Similar Messages

  • File name collision during build that includes Report Generation toolkit. How to correct?

    When I switched to LV 8.6 (it's also in 8.6.1) I started getting a file name collision warning when building an installer that included the Report Generation toolkit. The executable works, but I don't like to leave warnings uninvestigated. I don't understand 1) why it's happening now and 2) what it's recommending for the fix. Here's part of the actual warning it gives.
    LabVIEW prevented a file name collision during the
    build. Duplicate file names cannot be copied to the same destination. You can
    rename files as part of the build process to avoid name conflicts.
    The following files were moved to a unique
    location:
    C:\Program Files\National Instruments\LabVIEW
    8.6\vi.lib\Utility\NIReport.llb\Append Control Image to Report.vi
    C:\Program
    Files\National Instruments\LabVIEW 8.6\vi.lib\Utility\NIReport.llb\HTML\Append
    Control Image to Report.vi
    C:\Program Files\National Instruments\LabVIEW
    8.6\vi.lib\Utility\NIReport.llb\Append File to Report.vi
    C:\Program
    Files\National Instruments\LabVIEW 8.6\vi.lib\Utility\NIReport.llb\HTML\Append
    File to Report.vi
    C:\Program Files\National Instruments\LabVIEW
    8.6\vi.lib\Utility\NIReport.llb\Append Horizontal Line to Report.vi...........

    Hi GS,
    The architecture of the Report Generation Toolkit was changed in LabVIEW 8.6 to utilize LabVIEW Classes.  As such, there are some warnings during an EXE build because the class VIs have identical names.  Classes were not used in the toolkit in LabVIEW 8.5 and previous...that's why you didn't see any warnings during the build until now.
    Your EXE should still function properly, and you shouldn't have to change anything about your build.  The purpose of the warnings is to let you know that the duplicate-named VIs needed to be handled differently during the build.
    -D
    Darren Nattinger, CLA
    LabVIEW Artisan and Nugget Penman

  • Regarding the file name checking

    Hi ,
         I m using the below program which will upload the XL sheet , here i want to validate the file name which i m selecting from the destop. the file name should be named as "Suresh.XLS", where and how i can do validation for checking the file name..
    I gave the code for the refernce...
      please let me know the solution ASAP..
    REPORT  ZSURESH13062007                         .
    types: begin of ttab ,
          fld1(30) type c,
          fld2(30) type c,
          fld3(30) type c,
          fld4(30) type c,
          fld5(30) type c,
          end of ttab.
    data: itab type table of ttab with header line.
    selection-screen skip 1.
    parameters: p_file type localfile         .
    selection-screen skip 1.
    at selection-screen on value-request for p_file.
      call function 'KD_GET_FILENAME_ON_F4'
           exporting
                static    = 'X'
           changing
                file_name = p_file.
      start-of-SELECTION.
       IF  p_file IS INITIAL.
    MESSAGE S398(00) WITH 'No input file specified.'.
      ELSE.
    clear itab.
        refresh itab.
        PERFORM upload_data.
    loop at itab.
        write:/ itab-fld1, itab-fld2, itab-fld3, itab-fld4, itab-fld5.
      endloop.
      endif.
    form upload_data.
      data: file type  rlgrap-filename.
      data: xcel type table of alsmex_tabline with header line.
      file = p_file.
      call function 'ALSM_EXCEL_TO_INTERNAL_TABLE'
           exporting
                filename                = file
                i_begin_col             = '1'
                i_begin_row             = '1'
                i_end_col               = '200'
                i_end_row               = '5000'
           tables
                intern                  = xcel
           exceptions
                inconsistent_parameters = 1
                upload_ole              = 2
                others                  = 3.
       loop at xcel.
        case xcel-col.
          when '0001'.
            itab-fld1 = xcel-value.
          when '0002'.
            itab-fld2 = xcel-value.
          when '0003'.
            itab-fld3 = xcel-value.
          when '0004'.
            itab-fld4 = xcel-value.
          when '0005'.
            itab-fld5 = xcel-value.
        endcase.
        at end of row.
          append itab.
          clear itab.
        endat.
      endloop.
    ENDFORM.
    Thanks,
    Suresh...

    Hi Suresh,
    Check the Function Modules,
    PC_CHECK_FILENAME_WITH_EXT,
    PC_CHECK_FILENAME.
    Thanks,
    Reward If Helpful.

  • Duplicate File name check

    Hi, 
           I need to check whether the incoming file is already processed or not. The files are been placed on XI server. If the file with same file name comes then i dont want to process it. I am polling for files on xi server using file adapter.
    regards,
    Miten

    Hi,
    You can check the file name using the lookup. Maintain the table at R3 end, Send the file name at the R3 end and for the first time u update the entry of file name in R3 table.
    Now when second time ur scenario runs then send the file name to R3, in the FM check the file name with the file name which is maintained in the table if its not the same then update the table with the new file name and if it is same then pass the false value to XI and it will suppress the root node in message mapping.
    If file name is different then pass true value to XI and generate the Root node.
    Lookup:
    Lookup method from GUI mapping can be called using any of the following ways.
    •     RFC lookup using JCO (without communication channel)
          /people/sravya.talanki2/blog/2005/12/21/use-this-crazy-piece-for-any-rfc-mapping-lookups
    •     RFC lookup with communication channel.
                     /people/alessandro.guarneri/blog/2006/03/27/sap-xi-lookup-api-the-killer
    The steps are as follows:
    •     Develop and test ABAP function module.
    •     Develop and test Java method within Integration Repository/message mapping tool.
    Thnx
    Chirag

  • File name overwrites during Batch process

    Mac, OSX, CS2. (and Windows CS2, CS3)
    I've searched and read plenty of posts about this problem, but I don't see any solutions. Maybe a few workarounds. So, I'll try myself. This problem does not exist prior to CS2 for me.
    I'm writing an action that involves opening a PDF, trimming, etc, then saving as a TIFF.
    My result is one file, overwriting itself (with the contents of my source folder) with the name of the file I used to write the Action. I don't "touch" the file name in the "save as" dialog box, but of course I have to "save as", because I need a different file format than the source.
    I've been using Actions/Batch/Droplets since they became available, maybe Photoshop 4. I just don't get this.
    Thanks for your consideration.

    duplicate post
    Ask your question only once.

  • Extract Preserved File Name

    I have gone through about 1000 photos and batch renamed them. During this process I made sure that the "Preserve File Name" check box was turned on. My ultimate goal is to somehow take the preserved file name and put it into a normal metadata field (i.e. Keywords). Right now, it exists under the "Raw Data" tab in the file info panel. There is a script that is floating around that will copy the current file name to the "Keywords" metadata. However, I would like to access the Preserved File Name. Anyone have any thoughts on this or somewhere I can look for a script that will do this? I have a feeling this isn't the first time someone has tried to do this, but I have yet to find any scripts or posts that deal with this specifically.

    This should do the job...
    #target bridge
    addPreserved = {};
    addPreserved.execute = function(){
      var sels = app.document.selections;
      for (var i = 0; i < sels.length; i++){
    var md = sels[i].synchronousMetadata;
        md.namespace = "http://ns.adobe.com/xap/1.0/mm/";
        var preservedFname = md.PreservedFileName;
        md.namespace = "http://ns.adobe.com/photoshop/1.0/";
        md.Keywords = md.Keywords + ";" + preservedFname;
    if (BridgeTalk.appName == "bridge"){
    var menu = MenuElement.create( "command", "Preserved Filename to Keywords", "at the end of Tools");
      menu.onSelect = addPreserved.execute;

  • B2B 11g: Getting File Name in inbound integration and passing it to SOA

    Hi,
    I am Reading a EDI x12 file in inbound B2B .I am checking the 'preserve File Name' check Box at Listening channel properties.....Then Integrating B2B to soa using AQ Adapter.But I couldn't find any property where I can pass the file name which I read through B2b to Composite. I need the file name because I am inserting all the records in Database and client wants to see which record in DB has been inserted from which file.
    Any pointers would be helpful.

    Hello,
    Try to use the b2b.fileName property. Although it probably is not shown on the list you should be able to access it.
    Also, please check the patch 18021286 which has many improvements and allows for two cases that can be useful for you:
    - Get information on back-end about which channel and agreement was used to deliver
    - Using callout Ret values which allow for specific properties to be set on callouts and passed all the way until the back-end application.
    Hope this helps.
    Best Regards
    Tiago Teixeira

  • HT4221 Synched Photos from PC should be in File Name Order, not by last modified date

    Since installing IOS 7 the sorting of my photos from my PC sent to my Iphone have become totally random.
    Apple claims the files are by Last Date Modified.
    I have a very detailed file naming system on my PC which makes Photo Retrieval by Date, Name, Subject easy.
    Is there any software that recognizes the Windows File Name?  The sequence file names given during SYNCH are useless.

    When you import into iPhoto, each imported set goes into a folder called Last Import.
    One way to do what you want without losing your organization:
    iPhoto / File / Import to Library. Navigate to the first folder on the pc. and click on Import. The contents of the folder on the PC will all come together.
    On the Mac the photos will be in the folder called Last Import.
    On the Mac, create a new folder with the name you want. (File Menu / New folder)
    Move the photos as a batch (select all) from the Last Import folder to the one you just named.
    Do this as many time as you have folders.

  • How to identify transport file name

    Hello Experts,
    I have one scenario that i need to transport to production.
    Now the problem is this scenario is already migrated upto Quality XI just need to migrate to Production XI.
    Our client is concern that if there will be some problem we want to revert back the whole scenario.
    For that i thought that we can identify the file which we had transported from XIQ to XIP previously and save that somewhere.
    If there will be problem again then we can again import that file.
    But i am not able to understand that how can i identify that file for that perticular scenario, as it is with numbers.
    Please help me out in that.
    Thanks in advance.
    Hetal

    Hi,
    you can check the exported object file name from Tools-->find Trasports option.
    it is better to add your export files to a Transport Request in ABAP stack, which will keep you track of all the files which were transported.
    ??But i am not able to understand that how can i identify that file for that perticular scenario, as it is with numbers.
    --> i think you are checking the Transport ID number not the file name.
    check it from Find transports menu. it will give clear details.
    Regards,
    Sukarna

  • The user name or password is incorrect in the CRM system checks during installation

    Hi everyone
    I'm installing CRM 2013 on 2 servers (server 2012) - CRM Full server + SQL Server 2012.
    I created 2 service accounts for this - CRMSVC + CRMSANDBOX (one for sandbox and another one for all the rest).
    I'm getting the following error in the system checks during setup:
    I've verified a billion times that the service accounts and passwords are valid - I even tried using different service accounts - same problem. As for now I also added the service accounts to the local admins groups just to be sure that it's not some permissions
    issue (I also added them to the 'log on as service' & performance logs groups). 
    If i try to use NETWORK SERVICES instead of a service account - the installation goes through flawlessly - no issues at all.
    I'm also gonna say that i tried another installation on a fresh server - SAME ISSUE.
    So for now my ideas are either it's a GPO somehow blocking the service accounts - or some kind of other security issue.
    I also found out that the security event log shows these two errors when these show up in the system checks:
    Inside i found 'NULL SID' entry - it does not recognize the service accounts account and 0xC0000064 in the Sub
    Status Codes
    It's not a typo issue so don't bother - if i write a wrong password in purpose - it actually says that the password i typed for domain\service account is incorrect - here it seems that the service account is not being recognized.
    Any ideas anyone?
    Thanks
    Please vote if you find my post helpful - Thanks

    Not sure you understood my point.
    The installation process necessarily runs under the account of the installing user. The installation will query AD to identify information about the service accounts, and will add them to the relevant CRM AD groups. It is possible that the installing user
    account does not have sufficient privileges on the AD objects for the service accounts to be able to identify them, and to add them to groups. This scenario is consistent with the errors that you get, and also with being able to install CRM to run under NetworkServices
    (which doesn't have its own AD object)
    Microsoft CRM MVP - http://mscrmuk.blogspot.com/ http://www.excitation.co.uk
    Hi David
    I understand this, but as far as i know running it under NETWORK SERVICES will add the machine names to the OU security groups - hence the user installing still needs to have delegated permissions on that OU. Anyway as mentioned above - ignoring the checks
    and running the installation solved this and also added the accounts to the security groups - so this whole mess looks like some bug to me - not sure i will ever find out what it was :)
    Please vote if you find my post helpful - Thanks

  • Run time exception while checking dynamic file name in mesage mapping

    Hi Experts,
    In my file to idoc scenario i need to know the file name dynamicalyy as i require this file name during mesage mapping.
    for that i have created UDF with the following code.
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    String ourSourceFileName = conf.get(key);
    but when i am testing this code in mesage mapping in IR i am getting runtime exception.why its giving so ?
    RuntimeException in Message-Mapping transformation: Runtime exception during processing target field mapping /ns0:Messages/ns0:Message1/ORDERS05/IDOC/EDI_DC40/MANDT. The message is: Exception:http://java.lang.NullPointerException in class com.sap.xi.tf._MM_EDI_HospitalsToORDERS05_ method filename$com.sap.aii.mappingtool.tf3.rt.Context@545f545f
    Can we test this in message mapping itself ?
    Best Regards,
    Rohit

    One more question - I hope you didn't forget return statement in your java code.
    this worx 4 sure:
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    String ourSourceFileName = conf.get(key);
    return  ourSourceFileName;

  • Get File name of the inbound file during mapping

    Scenario: to read the file name of the inbound file (which has date required for the mapping) during runtime.
    The requirement is to read the date of the inbound file (passed to the XI pipline by the file adapter) and populate the same in the outbound mapping structure.
    Any idea about how to do this?
    (I went through few options of using java.util.map. not successful yet)

    Hi Anand,
    I posted the same question a time ago, without any help....
    Can I find out the full filename of input file in message mapping?
    Posted: Nov 23, 2004 1:00 PM
    I have in XI 2.0 the following scenario :
    In the inbound fileadapter I read my input file. The filename of the input file is part fixed, part variable (Like INDATA01.txt, INDATA03.txt, etc).
    So in my Adapterconfiguration, I specify the filename with a wildcard (INDATA*.txt).
    What I now want to do, is in my Message Mapping use the full filename , so I can do something different for every filenumber. Is there a way where I can get the full filename available in my message mapping (I did not find the filename in the XML in the message trace).

  • Condition check (based on sender file name) at receiver determination step

    Hi,
    My scenario is File to AS2 (Sender side file adapter and receiver side AS2 adapter)
    We have 5 customers, but the source location is same to pick the files, Here we are not using any ESR objects.
    Based on the source file name PI need to determine to whoom this file need to send at receiver determination step
    Craeted objects
    1 Sender CC,
    1 Sender agreement,
    1 Receiver determination
    5 Interface determinations
    5 Receiver agreements
    5 Receiver CCs.
    Could you please provide me your valuable inputs.
    Thanks
    Ramesh

    Hi Venkataramesh,
    I understand your scenario as, picking files (different file naming standard for different target customer) from one source folder. Based on file name, that payload should be sent to corresponding target customer. You have mentioned u201CHere we are not using any ESR objectsu201D. I can see two reasons for this decision
    1. PI is used to route the messages, i.e., no need to transform the payload. OR
    2. Files can binary files like PDF, ZIP, JPG, GIFu2026
    Now I can see two possible solutions
    1.     Simple solution, as proposed by u201CPrabhu Rajesh Janardananu201D, make it into 5 different scenarios  (5 sender channels).
    2.     Bit complex solution, only one sender channel, using extended receiver determination
    Step 1:- In Sender File channel check u201CAdapter u2013 Specific Message Adapteru201D in Advanced tab. File Name should be checked.
    Step 2:- In Receiver Determination, Select Type of Receiver Determination as u201CExtendedu201D. http://help.sap.com/saphelp_nwpi711/helpdata/en/48/ce2a423a8e5430e10000000a42189b/frameset.htm
    Step 3:- Do a Graphical Mapping (use it Operation Mapping in Receiver Determination).
    Step 4:-
    Source and target of graphical mapping will be same (below), because you donu2019t want to access input payload (it can be XML, flat file, JGP, GIF and you donu2019t have its structure).
    <Receivers>
       <Receiver>
          <Party agency="" scheme=""></Party>
          <Service></Service>
       </Receiver>
    </Receivers>
    Step 5:- Write a UDF in Graphical mapping as below. http://help.sap.com/saphelp_nwpi71/helpdata/EN/43/03612cdecc6e76e10000000a422035/frameset.htm Pay attention to method declaration
    public String Determine_Receiver( Container container) throws StreamTransformationException
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create(u201Chttp://sap.com/xi/XI/System/Fileu201D,u201CFileNameu201D);
    String valueOld = conf.get(key);
    //Put your logic here
    if (valueOld.equal(u201Cuser1u201D)) {
    return u201Cuser1u201D;}
    if (valueOld.equal(u201Cuser2u201D)) {
    return u201Cuser2u201D;}
    if (valueOld.equal(u201Cuser3u201D)) {
    return u201Cuser3u201D;}
    Step 6: Now use this UDF to map to u201CReceiveru201D and u201C Serviceu201D.
    This solution need more fine tuning.
    Regards,
    Raghu_Vamsee
    Edited by: Raghu Vamsee on Jan 8, 2011 5:56 PM

  • RIDC check in the file name encoding issue

    Hi,
    When I use the RIDC to upload the chinese file name, the native file field become ??.pdf.
    TransferFile tf = new TransferFile(new File("c:/中文.pdf"), "application/pdf");
    dataBinder.addFile("primaryFile", tf);
    Thanks!

    This is rather a Java than RIDC question.
    Check these links, maybe you will find something useful:
    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4185525
    http://stackoverflow.com/questions/3610013/file-listfiles-mangles-unicode-names-with-jdk-6-unicode-normalization-issues

  • Error in File name or class name not found during Automation operation: 'CreateObj​ect'

    Hello Team,
    When I am trying to execute the below code i am getting the following error. Any help would be greatly appreciated.
    Set oFSO = CreateObject("Scripting.FileSystemObject")
    If Not oFSO.FolderExists(SavePath) Then
    Set f = oFSO.CreateFolder(SavePath)
    Else
    End If
    53 4/11/2014 12:27:22 PM Error:
    Error in <NoName(4).VBS> (Line: 9, Column: 1):
    File name or class name not found during Automation operation: 'CreateObject'
    I have googled through the error and tried to re-register the scrrun.dll using regsvr32 eventhogh it is successfully registered, i am getting the following error. My PC is windows 7 32bit OS.
    any help is greatly appreciated.

    The following script class will write a log file entry. See if it will run for you.
    The script is using a class object that you might not have seen before. A little intro:  The top section is just for testing the class. Normally I just comment this out after the class is working well.  It should run right way. I would save the vbs file in the editor, That way when you are using autoactpath or currentscriptpath variables they will be able resolve the paths.
    Paul
    Attachments:
    LoggingCode_V2.VBS ‏5 KB

Maybe you are looking for