Change in time stamp format in receiver file name

Hi,
We have a scenario as AS2 - PI - FTP Server (AS/400). We want target file name as BMMDDHHSS where B is constant and
MM (month e.g., 01), DD (day e.g., 12), HH (hour e.g.,11), SS (seconds e.g., 12). Is there standard way of doing this, just by changing some configuration in receiver file adpter?
Please let me know, how could we do this using PI. If script is optional, keeping as back-up only.
How come, naming dynamic receiver file names are so difficult in PI. I have been trying to get the answers for our another requirement like to name receiver file as C1.YYMMDD.C2 in a file pass through scenario for more than a month.
It is just file through scenarios, so we can't use variable substitution as we are not going to read content/payload of file
Thanks in advance,
- Riya Patil

Hi Shabarish 
Thanks for your reply. I have trying to make this UDF work since almost a month with no luck. Can you please check where am I doing wrong?
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
String SourceFileName = "C1." + a + ".C2";
conf.put(key, SourceFileName);
return " ";
In the above code, I am passing date as "a". And mapping CurrentDate (formatted) --> UDF --> Target root node.
I am getting the following error in SXMB_MONI:
<SAP:Code area="MAPPING">EXCEPTION_DURING_EXECUTE</SAP:Code>
  <SAP:P1>com/sap/xi/tf/_MM_Lockbox_Filename_</SAP:P1>
  <SAP:P2>com.sap.aii.utilxi.misc.api.BaseRuntimeException</SAP:P2>
  <SAP:P3>Fatal Error: com.sap.engine.lib.xml.parser.Parser~</SAP:P3>
<SAP:Stack>com.sap.aii.utilxi.misc.api.BaseRuntimeException thrown during application mapping com/sap/xi/tf/_MM_Lockbox_Filename_: Fatal Error: com.sap.engine.lib.xml.parser.Parser~</SAP:Stack>
Your help would be much appreciated.
Thanks,
Riya Patil

Similar Messages

  • Changing time stamp format in the file receiver adapter file name

    Hi all,
    How can we change the standard date time stamp from
    filename_yyyymmdd-hhmmss-mil
    to
    filename_yymmdd_hhmmss
    i.e.,  I want "underscores" instead of "hyphens" and also I do not want the MilliSeconds.
    I read in the forums that I have to use the combination of variable substitution and mapping functions to do this, but not sure how exactly.
    Can the experts help me with this please?
    Many thanks.

    Hello Ramesh,
         You can make this possible using runtime filename creation using UDF.
    Please go though the below steps.
    Message mapping:  
    Create an UDF and include the piece of code that captures the Filename and Timestamp from source side via ASMA.
    Modify them according to our requirement by adding the <Timestamp> at the end of <filename> with _.
    Map the UDF to any of the top level node so that the modified filename will be available for the target communication channel
    UDF Code is:
    try {
    String filename    = "";
    String timestamp = "";
    DynamicConfiguration conf1 = (DynamicConfiguration) container
        .getTransformationParameters()
        .get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key1 = DynamicConfigurationKey.create( "http:/"+"/sap.com/xi/XI/System/File","FileName");
    DynamicConfigurationKey key2 = DynamicConfigurationKey.create( "http:/"+"/sap.com/xi/XI/System/File","SourceFileTimestamp");
    filename = conf1.get(key1);
    timestamp = conf1.get(key2);
    filename = filenametimestamp".xml";
    filename = filename.replaceAll( "-" ,"_" );
    conf1.put(key1,filename);
    return filename;
    catch(Exception e)
         String exception = e.toString();
          return exception;
    Click on Advanced tab and check the Option u201CSetAdapterSpecificMessageAttributesu201D in addition to that check the attribute that are required to be captured during run time. In our case File Name and Source File Time Stamp are required to be checked
    In the receiver communication channel Mention u2018 * u2018as File Name Scheme.
    Click on Advanced tab and check the Option u201CSetAdapterSpecificMessageAttributesu201D in addition to that check the attribute u201CFile Nameu201D which will carry the modified value in the UDF .
    i hope this will help you.
    Monica

  • Add time Stamp format in File Adapter

    Is it possible to change Add Time Stamp format ??
    If so please let me know the procedure to chnage it..
    It is scenario with no mapping so i cant go either Dynamic configuration or Variable substitotion.
    Thanks & Regards,
    Polas

    Hi,
    I think you need to assign it dynamically as you cannot change the format for Add TimeStamp
      See the below links:
    File Adapter: Dynamic file name
    /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
    http://help.sap.com/saphelp_nw04/helpdata/en/43/03612cdecc6e76e10000000a422035/frameset.htm
    http://help.sap.com/saphelp_nw70/helpdata/EN/e3/94007075cae04f930cc4c034e411e1/content.htm
    Thanks,
    Tiny

  • How do you vary the Date/Time stamp format in File Adapters

    In the receiver channel of the File Adapter where you specify the 'File Name Scheme', you do have the option of specifying a 'File Construction Mode' of 'Add Time Stamp'.  How can you specify a different Date/Time stamp format ( eg MM/DD/YY vs YYYYMMDD vs MMDDYY, etc. ) without changing the Date/Time stamp for the entire SAP system?  Also, can you control where the Date/Time stamp appears in the filename?

    Hi,
    There are many threads discussing the same issue. Go thro the following:
    Dynamic file name (Date) in Receiver File Adapter
    Receiver File Adapter - TimeStamp
    Bhavesh's reply in above thread:
    You can use Adapter Specific Identifiers and then change the file name in the mapping. Append the tiem stamp in the format that you want and so on.
    Just use this code in an UDF,
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    String SourceFileName = conf.get(key);
    java.text.SimpleDateFormat dateformat = new java.text.SimpleDateFormat( "yyyyMMdd" );
    dateformat.format( new java.util.Date() );
    String newfilename=SourceFileName+dateformat;
    // change to new file name
    conf.put(key, newfilename);
    return "";
    Regards,
    P.Venkat

  • Time stamp data write to file problem

    Hello!
    I'm just learning LabView, and have arrived at the stage of writing time-stamped data to text files.
    This seems clear enough, however when I examine the file written to disk, I find 4 unexpected characters: 3 spaces and one seemingly random number or punctuation mark, preceding every line!
    An example is:
       .2005-07-15 10:55:40.0 the value is 0.0000 cm
       .2005-07-15 10:55:40.5 the value is 1.0000 cm
    The four characters "   ." are those whose origin I can't understand. I can't seem to get rid of them.
    They seem to change with the input string, but not in a manner I can predict or understand.
    Any hints or explanations would be greatly appreciated, as I'm at wit's end after 1/2 day of puzzling over this little problem!
    Alex
    Attachments:
    time stamp data write VIs.zip ‏24 KB

    Alex,
    You found one of the subtle little things that can be frustrating to old-timers and newcomers alike. I did not recognize it until I read the help file (and I have been using LV since version 1.2).
    First, the three characters before the commas are nulls (\00).
    The reason they are there is in the help file for the Write File.vi. By wiring an array to the data input, you caused the VI to write a header telling what data format was used.
    I modified your VI to simply concatenate the strings and then write a simple string to the file. I think this may be what you were after.
    Lynn
    Attachments:
    write timestamp text line to file v3.vi ‏47 KB

  • Excel time stamp format mismatch

    Hello all, 
                                          I am writing time stamp into an excel file. Time stamp for time 2013 & 2012 appears different although format & method of writing is same in both the cases.
    In the attached file below. When time stamp is 2012 then format of time stamp in excel file & in input is same but when time stamp is 2013 then format of time stamp what i am writing actually & what appears in excel file is different.
    Dont know where exactly it is going wrong ?
    Kudos are always welcome if you got solution to some extent.
    I need my difficulties because they are necessary to enjoy my success.
    --Ranjeet
    Attachments:
    Time stamp format difference.jpg ‏102 KB

    Ranjeet_Singh wrote:
                                Cell formatting is same in both the files, I tried entering directly & results are same.
    Thats what my question is ?
    Just to be absolutely certain I understand you: when you type a date in 2013 into an Excel sheet, it displays differently than when you type a date in 2012 into the same cell in the same Excel sheet. Is that correct? If you did this with two different files, try it with a single file.
    If you see this behavior when you enter the text directly from the keyboard, why are you posting it in a LabVIEW forum? It doesn't seem to have anything to do with LabVIEW.
    Why can't you upload your Excel files that demonstrate this behavior?

  • Adding time stamp while archiving the file in b2b

    Hi
    I want to add the time stamp when archiving the file when I am using file/ftp channel. can anybody tell me how can I do that. otherwise it is overwriting the exising file in archive directory.
    Thanks
    Sri

    Hi Sri,
    otherwise it is overwriting the exising file in archive directory.It might be happening because inbound files are not having unique name. You have two options -
    1. Make sure that inbound files have unique name (you may add timestamp in inbound filename format)
    2. Do not use the archive feature of Oracle B2B. Instead use a transport callout to write a copy of incoming document into desired directory with desired filename. To know more about callout offering of Oracle B2B, please refer -
    http://docs.oracle.com/cd/E28280_01/user.1111/e10229/callouts.htm#CHDEFBDG
    Regards,
    Anuj

  • Change of time stamp on RAW thumbnails

    I have PSE 9.0. I shoot in RAW on a Canon 550D and a Canon G10.
    When I open a RAW file in editor, whether or not I edit that file, it changes the time stamp on the thumbnail by 1 hour. If I open it twice it changes the time by two hours, eg from 1.10pm to 2.10pm to 3.10pm. Of course, when I then re-open the Organiser, these thumbnails are out of order as shot.
    I have no idea why this is happening. Is there some setting I need to change?

    I think unlike jpeg files where the EXIF data will be embedded in the file Adobe will read the XMP data for Raw Files.
    You can open an image in Full Edit and click File >>File Info to bring up the XMP dialog. The raw tab offers a wealth of information.
    However the behavior you are experiencing seems odd and there looks to be a bug in the most recent update.
    As you say it alters the order of photos from their original sequence. I think Adobe could introduce File Name Order as they do in Bridge. This would be a useful alternative for sorting files in the organizer.
    I remember this old blog posting from 2008 which you may find interesting:
    http://jmoliver.wordpress.com/2008/02/29/time-zones-in-digital-photography/

  • Geotagging / GPS Metadata Time Stamp Format

    I have a photo/image taken on an iPhone. The GPS information in the Preview application (inspector menu) shows a Time Stamp of 11:10:56.63. Can anyone explain to me what the ".63" at the end of the time stamp format represents? Thank You.

    An obvious decimal point after a number has been the standard format to display tenths, hundredths and thousandths for hundreds of years. It's ridiculous that it has to be 'proven' in a court of law and can't be taken at face value for what it obviously is to any educated person. Ask 1000 high school educated people what a decimal point looks like and what it means and I'm sure you'll get 1000 correct answers. One more reason for my extreme dislike of what lawyers have done, and are doing, to our society.

  • Error when add seconds to Time Stamp format

    Hi,
    I've created a subVI that transform an string data/time to Time stamp format.
    The subVI seems that it works fine, but when I use the data 26/10/2014 and I add 1 day, it crashes! The result is 26/10/2014 23:00:00 instead of 27/10/2014 00:00:00.
    Cordially
    Vicen
    Solved!
    Go to Solution.
    Attachments:
    Convert Date-Time strings to Seconds.PNG ‏405 KB
    Sha Convert Date-Time strings to Seconds v2.vi ‏24 KB

    Thank you both!
    I think I've solved the problem.
    Vicen
    LV 2010/2011 on WinXP/Win7
    Attachments:
    Sha Convert Date-Time strings to Seconds v2b.vi ‏26 KB

  • Function module to convert to time stamp format

    Hi friends,
    can you tell me any function module to convert date and time to time stamp format?
    kind regards.

    Just use 
    CONVERT DATE d
    TIME t [DAYLIGHT SAVING TIME dst]
    INTO TIME STAMP tst
    TIME ZONE tz.
    look at this example
    DATA:
    tstamp type timestamp,
    d TYPE D VALUE '19971224',
    t TYPE T VALUE '235500'.
    SET COUNTRY 'US'.
    CONVERT DATE d TIME t INTO
    TIME STAMP tstamp TIME ZONE 'UTC+12'.
    " tstamp : 19971224115500
    " (12/24/1997 11:55:00)
    CONVERT TIME STAMP tstamp TIME ZONE 'UTC+12' INTO
    DATE d TIME t.
    Also look at the blog..
    /people/himanshu.gupta/blog/2006/11/14/abap4-date-time-and-timestamps
    Raja T
    Message was edited by:
            Raja Thangamani

  • Time Stamp Format

    I'm trying to insert a record into a field that has a time stamp format. Can anyone help me?
    Here's the SQL:
    insert into database.table (field1, field 2, etc., LOADDATE)
    values(field1, field 2, etc., 2002-09-13 00:00:00)
    The error message returned is literal does not match format string.
    I've tried multiple date formats without success.
    Thanks

    To clarify:
    Table layout
    FLD1 NUMBER
    FLD2 VARCHAR2(10)
    LOADDATE DATE
    Trying to insert following data
    FLD1 = 1
    FLD2 = 'ONE'
    LOADDATE = 2002-09-13 00:00:00
    insert to your_table (FLD1, FLD2, LOADDATE)
      VALUES ( 1, 'ONE', TO_DATE ('2002-09-13 00:00:00', 'YYYY-MM-DD HH24:MI:SS') )  ;

  • Changing photo time stamp

    Hi,
    I recently got back from Europe and didnt change the time on my camera as I went so when iPhoto sorted the photos it splits the days up by Australian time (the camera was set to this) not the local time of where I was.
    Isthere a way of changing the time stamp to -8 hours from the timestamp?
    also, can I do an automator action to change the time on all photos by -8 hours to make them correct to where they were taken?
    Thanks
    Dave

    I recently got back from Europe and didnt change the time on my camera as I went so when iPhoto sorted the photos it splits the days up by Australian time (the camera was set to this) not the local >time of where I was.
    Isthere a way of changing the time stamp to -8 hours from the timestamp?
    No that is in the image and could only be modified by an image editor - like photo shop elements
    also, can I do an automator action to change the time on all photos by -8 hours to make them correct to where they were taken?
    Even easier - select the photos and goto the Photo menu ==> adjust date and time
    LN

  • Receiver file name with counter

    While working on proxy to file scenario. I have to maintain receiver file name as ddmmyyyyxxx_nnn.xml,where xxx is constant and nnn is a counter which is suppose to be reset everyday.Anybody can help me on how to achive this...?

    Hello Amit,
    Yes. You can achieve this but only using File - NFS Protocol.
    A new file is created for each document. The file name is extended with a counter, which is inserted before the file name extension (for example, default002.file). This selection is only available for the File System (NFS) transport protocol.
    Make specifications for Counter Definition:
    Prefix
    Specify one or more characters that you want to add before the counter in the file name.
    Format
    Specify the first counter to be used. It must be a valid integer number. Leading zeros are permitted.
    Step
    Specify the counter increment.
    Mode
    Specify when the counter is to be added.
    After First File
    The counter is added when the file name is used unaltered for the first time.
    Thanks
    Pothana

  • Getting Receive File Name and status of application from Biztalk database.

    Hello all,
    I want to retrieve Receive file name and status of application (started, partially started) in a stored procedure
    querying Biztalk databases.
    Please share if anybody have an Idea.
    Thanks

    Hi Nilesh,
    Status of BizTalk application can be obtained using ExplorerOM API provided by product. It's Application class has a Status property that returns one of Not Applicable, Started, Stopped, Partially Started.
    using Microsoft.BizTalk.ExplorerOM;
    private string GetApplicationStatus(string applicationName)
    BtsCatalogExplorer catalog = new BtsCatalogExplorer();
    string status = "";
    try
    //connection string to BizTalk management database
    catalog.ConnectionString = "SERVER=.;DATABASE=BizTalkMgmtDb;Integrated Security=SSPI";
    Microsoft.BizTalk.ExplorerOM.Application app = catalog.Applications[applicationName];
    if (app == null)
    throw new Exception(String.Format("Application '{0}' cannot be found.", applicationName));
    status = app.Status.ToString();
    catch (Exception ex)
    //Handle exception
    System.Diagnostics.EventLog.WriteEntry("MyMonitoryingApp", "Exception call stack: " + ex.ToString());
    finally
    if (catalog != null) { catalog.Dispose(); }
    return status;
    UPDATE: Found the thread from where I got this code. Thanks to Ashwin for providing it.
    Refer:
    Reg Stored Procedures for BizTalk Application Status in BizTalk Admin Console
    Rachit
    Please mark as answer or vote as helpful if my reply does

Maybe you are looking for

  • DVI to VGA screen goes black

    I have a G5 and wish to mirror a TV screen to the existing monitor.  I have bought a DVI splitter to DVI and VGA.  One screen goes black ( the Mac Screen ) as the Mac thinks there is only one monitor connected. How do i tell the Mac to have a mirror

  • Need help fast - iPhoto slide show on Windows ?

    Hi, I am really needing your help with this. I have created a slideshow in iPhoto for a funeral service for our uncle which is being held this evening. However, I just found out that they need to view this slideshow on a Windows computer. HELP !! I t

  • No data in Production system

    Hi Experts,                      I have a very critical query. In  my 0Employee master data for some  employees their Personal area and personal Subarea are maintained for certain valid period in Quality system but for the same employees  for same va

  • Threads & Methods

    hi, i have question.... when you call a method ... then are you creating a new Process........ or in other words : is calling a method = creating a new process just curious

  • HT201364 plug in failure. how can i fix them? I have a MacBook. mac OS X version 10.6.8. how can i uptade to Mavericks?

    I have a macBook. Mac OS X version 10.6.8. How can i uptade to Mavericks?