Changing of the timestamp in sender file adapter in archive mode

Hi,
I have a requirement where in I have to archive a file with timestamp different from that generated by XI.
Please let me know if this can be done and if so how can we handle the changes to be made to the timestamp in the sender adapter in archive mode.
regards,
Srinivas.

Srinivas,
Option 1) Create a bat file..to run the perl script you call..
Perl script..
#!/usr/bin/perl -w
print("Starter that you want to change: ");
chomp($badex = <STDIN>);
print("Starter that you want added: ");
chomp($goodex = <STDIN>);
foreach $file (<$badex*>){
    @fields = split(/$badex/,$file);
    $goodfile = ("$goodex" . "$fields[1]");
    rename("$file","$goodfile");
Run that on the os
That should fix it.........
Option 2) On your local Machine create a java file..add this code to it
public class Utils
     public static int Randomizer(){
          int randomInt = 0;
          randomInt = (int) (Math.random()*1000);
          return randomInt;
public static void main(String[] args)
     Randomizer();
save and compile..
Create a bat file to add the number returned from the random to your targetFilename
so it would be something like..
mv oldFileName Newfilename+randomizer... and also get this command written to a file..helpful later on.........
Hope that helps
Regards
Ravi Raman
PS:Dont forget the points if helpful

Similar Messages

  • Can we control the triggering of sender file adapter

    Hi,
    Can we control the tiggering of Sender file adapter with option of Run OS command before message processing
    This option is available in Sender communication channel, what are the limitations of this option?
    My actual requirement is to see the target folder whether it is empty or not, if empty then I can trigger the interface.
    For this I want to write shell script whihc execute at OS level to check whether the target is empty or not, But the constraint is will this can control the triggering of sender adapter.

    Hi Sekhar,
    I guess this can help you control the file pick up.
    If your shell script works well then using the same you  can modify the filename or its extension if the target folder is empty.
    Say in the sender file adapter you set the source-filename as "inbound_*.ready". Now when originally the source file is dropped into the source folder (by any other process) let it be named as "inbound_001.pending" and your script will change the file name to "inbound_001.ready" if the target directory is empty. I dont think you need to use the pre processing OS command for this.
    Does it make any sense?
    Regards,
    Suddha

  • Required Changes in FCC Paramenters for Sender File Adapter.

    Hi
    I am Doing File-File Scenario.I am using FCC in the Sender File Adapter. I have defined the structure as below.
    My Source Structure
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_Source xmlns:ns0="http://city.net/filecopy">
       <Message>
          <Id>123</Id>
          <Head>
             <Id>123</Id>
             <Filename>test.xml</Filename>
          </Head>
          <Body>Helloworld</Body>
       </Message>
    </ns0:MT_Source_FILE>
    So for the above structure, I have defined the FCC Parameters as
    Document Name: MT_Source (Message Type)
    Document Namespace:http://city.net/filecopy(Namespace)
    Recordset Name: Message (root node)
    Recordset Structure: Message,1,Head,1
    Recordset Sequence: Ascending
    Recordsets per message:1
    Keyfield Type: string
    In the Table Rows I have defined
    Message.fieldFixedLengths: 3,10
    Message.fieldNames: Id, Body
    Message.fieldSeparator: ,
    Message.endSeparator: 'nl'
    Head.fieldFixedLengths: 3,8
    Head.fieldSeparator: ,
    Head.endSeparator: 'nl'
    Head.fieldNames: Id, Filename.
    My Input Text file
    123,Helloworld
    123,text.xml
    I am Getting Output as
    <?xml version="1.0" encoding="utf-8" ?>
    - <ns:MT_Source xmlns:ns="http://city.net/filecopy">
    - <Message>
    - <Message>
      <Id>123</Id>
      <Body>HelloWorld</Body>
      </Message>
    - <Head>
      <Id>123</Id>
      <Filename>test.xml</Filename>
      </Head>
      </Message>
      </ns:MT_Source>
    I should get Body field after Head Structure as in the Source Structure, So Please what changes do I need to do in the Parameters Specified above to get the desired Output.
    So How should I define the FCC Paramenters For Sender File Adapter ?
    Any Help Would be Appreciated.
    Regards,
    Varun

    Hi Everyone,
    I could Succeed to some extent.
    I have defined the parameters as follows
    Recordset Structure: Message,*,Head,1
    Key Field Name: KZ
    Key Field Type: integer
    In the table, I defined the Parameters as
    Message.fieldFixedLengths:1,3
    Message.fieldNames:KZ,Id
    Message.keyFieldValue:1
    Message.keyFieldInStructure:ignore
    Message.fieldSeparator:,
    Message.endSeparator:'nl'
    Head.fieldFixedLengths:1,3,8
    Head.fieldNames:KZ,Id,filename
    Head.keyFieldValue:2
    Head.keyFieldInStructure:ignore
    Head.fieldSeparator:,
    Head.endSeparator:'nl'
    Message.fieldFixedLengths:1,11
    Message.fieldNames:KZ,Body
    Message.keyFieldValue:3
    Message.keyFieldInStructure:ignore
    Message.fieldSeparator:,
    Message.endSeparator:'nl'
    My source text file
    1,123
    2,123,test.xml
    3,Hello World
    my output is
    <?xml version="1.0" encoding="utf-8" ?>
    - <ns:MT_Source xmlns:ns="http://city.net/FileCopy">
    - <Message>
    - <Message>
      <Id>123</Id>
      </Message>
    - <Head>
      <Id>123</Id>
      <Filename>test.xml</Filename>
      </Head>
      </Message>
      </ns:MT_Source>
    I got the output almost correct except I am not getting the value in the Body
    Any help would be appreciated.
    Please correct me If I am wrong.
    Regards,
    Varun
    Edited by: Varun on Sep 2, 2008 12:06 PM
    Edited by: Varun on Sep 2, 2008 12:15 PM

  • Issue while fetching the file through *.extension by FTP sender file adapte

    Hello Experts,
    I am facing a issue while fetching the data through sender File adapter with  ' *.file extension' .I am illustarting the scenario as below .
    It is a simple scenarion of File to File inboumd scenarion.Here file is getting picked up from a third party system
    through FTP sender chanel and stored in a temp folder of PI through NFS rceiver file adapter .
        The problem is however I am getting, while picking the file with file name as "*.exo"(where exo is the file extension).
    But while fetching the file with particular name like"abcd_10032011*.exo"(file naming has been done by combination of abcd(always same)_currentdate(change according to current date)),file picked successfully .
    So here ,in the prior case file not getting picked up,but in later case it dose .
    Can anyone please let me know what might be the issue?

    Hi Sunit,
    Connect from your PI System to 3rd Party System (where are placed the Source Files)
    FTP <PartySystemHostName>
    eg. FTP 10.2.3.456 (then insert Username & Password to Login)
    Go to source directory
    cd \<SourceDirectory>
    eg. cd \donaldduck\directory\
    Execute a File List command
    ls -la *.<extension>
    eg. ls -la *.exo
    In this way you should be able to view all files with this extension (*.exo), the same action that Sap XI perform to pickup the file.
    Then, try to copy that file to your Local PI System (to check if there're some permissions issue):
    mget <filename>.exo
    eg. mpget File1_01012011.exo

  • Archive file with errors in sender file adapter not working! please help!

    Hi Experts,
       I have a file to RFC scenario. the input is a XML file. I have setup the flag in sender file adapter channel for archiving the input files with errors. But it is not working.
    For testing I have used an invalid xML file for example without the main XML tag. I have also tested with a MSWORD file saved with.xml extension. But in both the cases the files are not getting archived.
    My archive location permissions are fine and in fact normal archive operation is happening. That is, if I select the processing mode as "Archive" and gave the Archive directory then files are getting archived. The problem is only with the "Archive faulty source files" option.
    What am I missing? DO I need to do some more configurations?
    What are the prerequisites if any for this option?
    How to test this?
    Please help me! I will be greatfull to you all!
    Thanks & Regards
    Gopal

    and go thru this links
    Creating a Single Archive of the Version Files
    http://help.sap.com/saphelp_nw04/helpdata/en/79/1e7aecc315004fb4966d1548447675/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/31/8aed3ea86d3d67e10000000a114084/frameset.htm
    Note: reward points if solution found helpfull
    Regards
    Chandrakanth.k

  • Sender File Adapter - Fixed Length

    We have a Fixed File(Sender). With 3 fields. NO Header. Space is the separator for each fields
    VendorNumber  10 bytes
    VendorName    10 bytes
    City           5 bytes
    In the File we can have multiple records.
    The Root Node is Vendor.
    I am trying to define the SENDER FILE ADAPTER in the following way (I have referred mostly all the blogs) but my file is not picking up for some reason.
    File looks like this
    V123456789 A123456789 Bosto
    V234567890 B123456789 Atlan
    V334587900 C123456789 Austi
    Note : I have been asked to give the Transport Protocol as   "NFS" (Whether this is the problem???) I have summarised the complete details below. Please help me
    Adapter Type :  File       Sender
    Transport Protocol :  NFS
    Message Protocol   :  File Content Convervsion
    Adapter Engine     :  Integration Server
    FILE ACCESS PARAMETERS
    Source Directory :   /business
    file Name        :   vendor.txt
    Content Conversion Parameters
    Document Name :  Vendor
    Document NameSpace: http://sap.com/xi/XI/SplitAndMerge
    Recordsetname :  Message1
    Record Structure :  File_MT,*
    Recordset Sequence: Ascending
    Key Field type    :  String(Case Sensitive)
    Additional Parameters
    File_MT.fieldFixedLengths 10,10,5
    File_MT.fieldNames        VendorNumber,VendorName,City
    File_MT.fieldSeparator   
    File_MT..processFieldNames fromConfiguration.

    Hi Naveen,
          Do check the following things,
    >>Note : I have been asked to give the Transport Protocol as "NFS" (Whether this is the problem???) I have summarized the complete details below. Please help me
           1.If your file resides on your local network/local computer give NFS(Network file system). if your file resides on a FTP location give FTP and also give the FTP log on parameters.
    Additional Parameters
    File_MT.fieldFixedLengths 10,10,5
    File_MT.fieldNames VendorNumber,VendorName,City
    File_MT.fieldSeparator
    File_MT..processFieldNames fromConfiguration 
           2.If this structure does not match with the input file structure the file adapter wont pick up the file. So check for the help document provided by SAP in the following path.
    help.sap.com  --> Documentation  --> SAPNetWeaver --> SAPNetWeaver '04 --> English --> process integration --> SAP Exchange Infrastructure --> connectivity --> Adapters --> File Adapter
           Your file contains three records
    V123456789 A123456789 Bosto
    V234567890 B123456789 Atlan
    V334587900 C123456789 Austi
    You have mentioned the fieldSeperator as space but there is no File_MT.endSeparator '/n'  which differentiates between each and every row (record).
            Parameters for Record set Structures mentioned in the sender adapter configuration does not match with the actual file structure .
            Try giving exact structures in the configuration of sender file adapter.
    regards,
    Aravindh.

  • 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

  • Sender file adapter is not picking the file from windows server

    Hi Experts,
    We have a sender file adapter running on Unix server. Now we have changed the source directory path from Unix to Windows in file access parameters.  It is not picking the files from windows directory and not showing any error.
    In this scenario, input file for sender adapter is *.xml and no content conversion.
    Could any one please let me know is there anything needs to changed in file adapter.
    Thanks in advance,
    Sridhar. M

    Sridhar,
    What do you have in the directory path?
    If it is a shared drive in unix then the directory in windows should also be a shared drive from XI system. Else if it is FTP check the address.
    Regards,
    ---Satish

  • Using sender file adapter to read the most current file

    Hi,
    in my sender file adapter , i have to read the latest file- all files in  the source directory are named as <filename><timestamp>.txt . I need to read the file with the latest timestamp (i.e. the most current file )
    How do i configure this using file adapter.
    thanks

    Hi Sreeram,
    thanks for the answer- but i found that the option can only be used with NFS transport protocol. what if i am using FTP ?
    alos, by date option means- files are processed according to their time stamp in the file system, starting with the oldest file.
    However in my case i only want to read the latest file and ignore the older files.
    Thanks

  • 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

  • How to get the filename in mapping when using sender File adapter?

    hi Experts,
       I have scenario where XI reads the input file using Sender file adapter.
       The file name is configured in the communication channel.
       In my message mapping it is possible to read this file name?
    Thanks
    gopal

    Hi Gpoal,
    Use Dynamic Configuration - /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
    Regards,
    Geetha

  • 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

  • Vaildating File name with the data in the file using sender file adapter

    Hi,
    Below is the scenario
    1)       Pick up files from a FTP server, the file name is dynamic, how do I put dynamic name in sender file adapter?
    2)       Determine if the user correctly named the file based on data in the file.
    a.       File naming structure that we will be concerned with is <company_code><accounting_time_period>.<extension>
    b.      The company code and the time period in the file name have to match the data in the file.
    i.      For example.  If the file name is 1001_200712.csv and the data in the file is for company code 1005, time period 200712, the file is incorrectly named.  Both values must be correct.
    How do we do this?

    Hi Sachin,
                    As Rightly said by Krishna, You can not put Dynamic name in sender File Adapter .You have to provide the name of the file like "*.txt" in Sender Adapter and at runtime you can access this file name by using following UDF:
    DynamicConfiguration conf  = (DynamicConfiguration) container
      .getTransformationParameters()
      .get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    String valueOld = conf.get(key);
    return (valueOld);
    As now you have picked up the file name at runtime.
    Now concatenate source file fields Company_code and Accounting_timeperiod using "_" as delimiter in properties.Also concat the extension .Now you have required file name.
    So using EQUALS standard function ,compare it with File Name fetched at runtime using above given UDF, and pass result as you desire to process further or not or to raise Alert to resend the file.
    Thanks & Regards,
    Anurag Garg
    You can validate this file name in Mapping itself.

  • Sender File Adapter- Incrementing the counter in file name

    Hello,
    We have a requirement to read a different file name with every read. Every subsequent file would have a numeric counter updated when we receive it, we need to read that file as the directory would hold the previous files as well.
    File structure :- EP<counter>.txt ; so first file would be EP001.txt, next one would be EP002.txt.
    How could i do this in Sender file adapter, as there is no variable substitution available like receiver file adapter.
    I cannot use wild card characters as the directory would contain previous files as well and we ned to pick the latest file.
    Regards

    Hi,
    >>How could i do this in Sender file adapter, as there is no variable substitution available like receiver file adapter.
    Yes true this is not available in sender channel
    >>I cannot use wild card characters as the directory would contain previous files as well and we ned to pick the latest file.
    You can use EP* as the filename and use processing mode as Set to Read-Only
    Regards
    Suraj

  • Sender File adapter not picking the file ABCD.PRN extension file

    Hi
    Am doing File to Abap Proxy scenario. My source will be in text format of fixed length of fileds 7.
    My souce file will be generated by a third party machine with the extension EEE150809.PRN. In my scenario my file adapter should pick the file and update the same in ECC via a Proxy.
    I have configured the Sender File adapter with Message Protocol -  Content Conversion but file adapter is not picking the file. I have checked the Communication channel and status is fine. But the same Communication Channel works for .XML file.
    What are the parameters that I have to consider with the file extension .PRN using File adapter?
    Thanks.
    S.

    Hi Swarna,
    You dont need to worry about the extension when picking the file. You can try using EEE* so that is picks all the files starting with EEE. If you have the fixed name then you can try giving EEE150809.*. Also EEE150809.PRN should not have any issue. Try to see in sender commu ication cahnnel for anyerrors. Probably there might be some network issues or authorisation issues. If you are reading with NFS then ask them to give necessary permissions. If you are reading through FTP check the user id and pwd you are using.
    Regards,
    ---Satish

Maybe you are looking for