To diplay write  date format in an  input field

I have written this code to get the curent date.
Date  date=new  Date(System.currentTimeMillis());
*     //String dateString=date.toString();*
    String dateString =date.getMonth()+"/";
    String dateString1=date.getDay()+"/";
    String dateString2=date.getYear()+"/";
  wdComponentAPI.getMessageManager().reportSuccess("Date "+ date);
  wdComponentAPI.getMessageManager().reportSuccess("DateSting:"+dateString);
  wdComponentAPI.getMessageManager().reportSuccess("DateSting1:"+dateString1);
  wdComponentAPI.getMessageManager().reportSuccess("DateSting2:"+dateString2);
I am getting this output:
date:2008-01-08
i want  in mmddyyyy format
01-08-2008
plz help its giving default values
When we try to print separately

After writning the following code:
Date  date=new  Date(System.currentTimeMillis());
Format formatter = new SimpleDateFormat("mm/dd/yyyy");
*     String s = formatter.format(date)*
String dateString =date.getMonth()"/"date.getDay()"/"date.getYear();
wdComponentAPI.getMessageManager().reportSuccess("Date "+ date);
  *wdComponentAPI.getMessageManager().reportSuccess("DateSting: "+dateString);
it is giving the foloowing o/p
0/2/1008
thats is its not converinting it properly plzz help urgent.

Similar Messages

  • How to write date format in bdc

    how to write date format in bdc report

    Hi,
         First you have a data decleration i.e data l_format(10) type c.
    now if a variable say l_date which is of sy-datum type, you will have to  <b>write l_date to l_format</b>, this will transfer the date in which you(user) have set the date format in user settings. Never hard code the format such as dd.mm.yyyy. or mm/dd/yyyy because the may have different formats, and the BDC will fails. After you have used write to to new l_format, pass this new value to BDC recording.
    Reward if useful.
    Kiran

  • Date Format for the input Variable

    Hi all,
    I got an issue with Date format we enter in the input variable screen for the BEx Analyzer.
    We have given a format of MM/DD/YYYY. But when the users accessed the report, it is not taking the format of the variable i.e MM/DD/YYYY but it is taking the format of the users system.
    If the user's system format is DD/MM/YYYY, it is accepting the input inthe same format only.
    Why this strange behaviour?
    My questions are
    Is the input for BEx system specific? or variable specific?
    Rgrds
    Kumar

    Hi,
    I think it is user specific... you can maintain the date format for user ....
    Go to SU01 transaction or.. Go to SYSTEM -> User Profile -> Own data
    Here in defaults tab you can see the date formet for user...
    Hope this helps...
    Thanks,
    Vikrant Mahajan

  • How to change date format of user input prompt in infoview.

    Hi All,
    Every report webi or deski having date field as prompt when viewed in view mode in infoview shows date format as M/d/yyyy h:mm:ss a.
    Where this format is stored and how can we change it to dd/mm/yyyy.
    Any ideas.
    Regards,
    Gaurav

    Not sure id this helps...
    I was up against a similar issue of placing the user input dates, Starting & Ending, into one cell for a reference on each report header. After a few hours of diligence, I came up with a working model that finally worked:
    u_StartDateAsTXT=FormatDate(ToDate(UserResponse("Enter Date/Time Shipped (Start):");"MM/dd/yyyy hh:mm:ss a");"MM/dd/yyyy")
    and
    u_EndDateAsTXT=FormatDate(ToDate(UserResponse("Enter Date/Time Shipped (END):");"MM/dd/yyyy hh:mm:ss a");"MM/dd/yyyy")
    The report header has the following function:
    =u_StartDateAsTXT + u201C u2013 u201C + u_EndDateAsTXT

  • OIM11gR2: Changing Default Date format in calendar input

    Hi Experts,
    There are certain OOB fields in OIM like "Hire Date", "Provisioning date" that accept input from calendar control.
    I could see the default input format is like MM/DD/YY (eg: 12/13/12) when i click on calendar icon and select any date range
    But i want the functionality like if i select a date from calendar it should get populated as "MMM dd, yyyy" eg (Dec 13, 2012) in text box.
    Please help me out!!
    thanks in advance.

    Apologies... when I read the question through the first time I didn't work out that you were using the query window inside the Deverloper Tools for Visual Studio .NET. The OracleGlobalization object would be used in .NET code.
    I don't know a way to override the date format in the query window other than doing a to_char() on the date in the query.
    Something like:
    select to_char(sysdate, 'DD-MON-YYYY HH24:MI:SS') from dualSorry about that,
    Mark

  • Date format in a parameter field (help)

    Post Author: binsk
    CA Forum: Formula
    Hi Guys,
    Newbie in CR world.
    I need help in changing the date format in parameter field. present setting is YYYY/MM/DD. I need it in DD/MM/YYYY. How is it to be done? My db is running in oracle. I'm using the CR XI version.
    Thanks ahead.
    Alex

    Post Author: Aman
    CA Forum: Crystal Reports
    Thank you for your response Yangster. 
    However, the below formula did not work, it gives me a message that "this field name is not known" {?end_date}.
    date_field in dateadd("d", -100, {?end_date}) to {?end_date}
    Am I not inputing this right? or do need a different formula/method?
    Please help...
    Thank you,

  • Clearing the data buffer from the input fields

    Hi,
    I am using an user exit CONFPP02 for the Tcode: co11n. I have written a program such that the confirmation numbers having the status CNF will not be allowed to be processed. The whole confirmation is terminated when the system checks the confirmation number and its status as CNF. If the status of the confirmation number is PCNF, the program allows the further processing of the Tcode Co11n.
    The problem starts when the user enters the PCNF status confirmation number and enters, the system stores the values in the various input fields. Now without exiting the initial confirmation screen, if the user replaces the Confirmation number of the PCNF status to the Confirmation number of the CNF status , the system issues a warning message:"  Confirmation no. or order/sequence/operation has been changed
    However, the input fields still contain default values from thepreceding confirmation". if the user says yes, the program written is bypassed , thus allowing the reconfirmation of the CNF confirmation number  into PCNF confirmation number .
    Can anybody suggest a suitable method to clear the data stored defultly in the input fields so that the program can be made to work.
    With regards,
    Avinash.S
    Mobile no:09996192456

    Hi Gilad,
    I never use Preview and did not use Preview at all before sending the document over to my most recent client either.
    I only opened Preview up this morning after I discovered that all of the form data had disappeared on his end! And the only reason I opened up Preview was because I already knew it looked fine in Acrobat so wanted so wanted to view the form in a different application.
    My client would not even have notified me about it had he not sent the signed form back to me and I saw there was no data there! I then called him and asked him about the missing data and he said that he thought I had simply sent over the form purposely with blank fields:(
    I have just emailed him to ask him what application he opened it up in. My understanding is that he is on Windows because ne mentioned to me his company was using Windows when we last spoke. Perhaps he has a personal Macbook where he opened it? I just don't know and can hopefully soon find out:)
    But THANK YOU for letting me know about that script! I appreciate it:) I have now downloaded and installed it and will just have to use it on ALL of my forms before sending them out:)

  • Date Formatting in a Result Field: Crystal Reports 2008

    I'm modifying a report at runtime in c# .Net using Crystal Reports 2008.
    I'm having trouble modifying a date fields format. I have accessed the DateFieldFormat object, and modified the properties, but only the SystemDefaultType property seems to have any affect.
    If the Date format is set in the Visual Report Designer I can see the details of the format in DateFieldObject, but editing these values doesn't have any affect on the report once displayed.
    Here is a sample of the code i'm using:
    public Form1()
         InitializeComponent();
         CrystalDecisions.CrystalReports.Engine.ReportDocument reportDocument = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
         ISCDReportClientDocument reportClientDocument;
         // Load Report
         reportDocument.Load(@"C:\myReport.rpt");
         reportClientDocument = reportDocument.ReportClientDocument;
         // Access Field
         FieldObject fieldObject = (FieldObject)reportClientDocument.ReportDefinition.DetailArea.Sections[0].ReportObjects["DateField1"];
         // These work, if I want to use one of the default formats
         // fieldObject.FieldFormat.DateFormat.SystemDefaultType = CrDateSystemDefaultTypeEnum.crDateSystemDefaultTypeUseLongDate;
         // fieldObject.FieldFormat.DateFormat.SystemDefaultType = CrDateSystemDefaultTypeEnum.crDateSystemDefaultTypeUseShortDate;
         // I don't want to use one of the defaults.
         fieldObject.FieldFormat.DateFormat.SystemDefaultType = CrDateSystemDefaultTypeEnum.crDateSystemDefaultTypeNotUsingDefaults;
         // I want to change the order of the values
         fieldObject.FieldFormat.DateFormat.DateOrder = CrDateOrderEnum.crDateOrderDayMonthYear;
         // Display the report in the viewer
         crystalViewer.ReportSource = rpt.rcd.ReportSource;
    I'm assuming I'm missing something about the object model here, but I can't find any good reference to it. Can someone help me out?
    Thanks!

    Hello,
    I find using the Object Browser in .NET IDE is very useful. Or look for the Developers help file
    The API you are using is not the one to use. Try this one:
    public virtual CrystalDecisions.Shared.DayFormat DayFormat { set; get; }
        Member of CrystalDecisions.CrystalReports.Engine.DateFieldFormat
    Thank you
    Don

  • JTextField - Show date format mask while inputing

    I have searched through the forums and I have not found an instance of someone try to show the format mask while a user inputs chars:
    ex: **/**/**** <-- Initialized
    1*/**/**** <-- After first integer
    10/3*/**** <-- After third integer
    I would also like the keep the caret position at the last integer and not always at the end of the input.
    Also if a user enters a "t"||"T" that it will automatically enter today's date.
    Is there a quick way? I have tried to use a DefaultStyledDocument but have not had success.
    Thanks

    here's a starter
    (needs to handle backspace, delete and probably a few other keys)
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.text.*;
    class Testing extends JFrame
      JTextField tf = new JTextField(new MyDoc(),"**/**/**",10);
      public Testing()
        setLocation(400,300);
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        JPanel jp = new JPanel();
        jp.add(tf);
        getContentPane().add(jp);
        pack();
      class MyDoc extends PlainDocument
        public void insertString(int offs, String str, AttributeSet a) throws BadLocationException
          if(str.equals("**/**/**") == false && (offs == 2 || offs == 5 ||
             str.length() > 1 || offs > 7 || "0123456789".indexOf(str) < 0))
            java.awt.Toolkit.getDefaultToolkit().beep();
            return;
          StringBuffer newText = new StringBuffer(getText(0,getLength()));
          if(newText.length() > 0)
            newText.setCharAt(offs,str.toCharArray()[0]);
            remove(0,getLength());
            super.insertString(0,newText.toString(),a);
            if(offs == 1 || offs == 4) tf.setCaretPosition(offs+2);
            else tf.setCaretPosition(offs+1);
          else super.insertString(offs,str,a);
      public static void main(String[] args){new Testing().setVisible(true);}
    }

  • Checking date format in XI mapping

    Hi all,
    I have a scenario in which the need arises for checking the date format.The source field has to be checked whether having the format YYYYMMDD.How can I handle this?
    Thanks and Regards,
    Jishi

    Hi
    Write a user defined function
    where u can use the java code
    Format formatter = new SimpleDateFormat("yyyy/MM/dd");
    here u can specify the required date format.
    so ur input will be a string with the date,
    so convert the date string into a Date object and then format the date according to ur need.
    Date dtobj = new Date(strgDate);    //convert the string into date object.
    Format formatter = new SimpleDateFormat("yyyy/MM/dd");    //specify the required format.
    formatter.format(dtobj);    //format ur date
    return dtobj;
    cheers
    jithesh

  • Date format is not working properly for Calender value help

    Hi Experts,
    We have two problems.
    1. We want to change the format of date displayed. We want format of dd-MMM-yy. For that we have created one Simple
    Type Dictionary Object with Displaying format dd-MMM-yy. It is working
    fine for the non editable UI. But once I apply the dictionary type
    object as data type for an input field, probem happens. Once the user
    choose a date from calender value help the value in the input field is
    coming like 01-011-12 not like 01-Jan-12.
    The date format is not changing from the calender. But if we set the
    display format of the dictionary object to MM-dd-yy or MM/dd/yy or
    dd/MM/yy or dd-MM-yy the format conversion from calender to input field
    is happening properly.
    The only problem once we put MMM in place of MM for the input field
    where user is selecting from a calender value help.
    2. We want to restrict users from entering the value manually for date input field. The user
    should be able only to enter value by selecting from calender value
    help.
    Please give suitable solution for these problems
    Thanks
    Shankha

    Hi Sankha,
    Please refer the links below:
    http://scn.sap.com/thread/1659463
    http://scn.sap.com/thread/1533443
    Regards,
    Manoj

  • Date format error while accessing date from SQLSERVER

    Hi all, in me webdynpro application I have taken Date type for the Input Field.
    At date select it is displaying in the format
      *2/14/2009 i.e. mm/dd/yyyy*
    And when I am saving date in the sql database then the date format changes to..
    2009-02-14 i.e..yyyy/mm/dd.
    But using the Date format method I have changed the format as per the need to push date in the SQL database table...
    In the table SQL the date attribute is in form i.e.    02/14/2009 as like from the date select from the date Input Fieldu2026But the problem is that database is not being able to display in that Input field again.
    I have use the coding both at Insertion and selection of the database i.e..
    Date Sdate, Edate;
    Sdate     =   Date.valueOf (rs.getString ("Sdate"));
    Edate     =   Date.valueOf (rs.getString ("Edate"));
    SimpleDateFormat date Formatter = new SimpleDateFormat ("MM/dd/yyyy");
    Sdate = wdContext.currentProjectElement ().getEdate ();
    Edate = wdContext.currentProjectElement ().getEdate ();
      String Sd = dateFormatter.format (Sdate);
      String Ed = dateFormatter.format (Edate);
      Date Sdd =Date.valueOf (Sd);
      Date Edd =Date.valueOf (Ed);
    But at selection of the database the error for the date format isu2026.
    java.lang.IllegalArgumentException
    If somebody knows how to resolve this ,plz let me know
    Regards:
    SK

    for displaying the value only, I think, you are converting to string.
    sol1:
    1. Create a simple type in dictionary: under Dictionary -> Local Dictionary -> Simple Types
    2. go to Definition tab: Change Built-in Type as Date
    3. go to Representation tab: specify format e.g.: MM/dd/yyyy
    4. go to Context and change the date context attribute to the created type.
    sol2:
    please try to minimize the casting between Date and String.
    I believe in database date is stored as Date type itself. My suggestion will be for displaying keep a separate attribute and set it on each db call.
    below code is converting from Date to String.
    Date Sdate, Edate;
    Sdate = rs.getDate ("Sdate");
    Edate = rs.getDate ("Edate");
    SimpleDateFormat date Formatter = new SimpleDateFormat ("MM/dd/yyyy");
    String Sd = dateFormatter.format (Sdate);
    String Ed = dateFormatter.format (Edate);

  • How to set  Date in input field by hard coding in application

    Hi all,
    1.I have to make a date(its my choice to set the date) to appear in input field which is date type.
    2.How to compare two numbers of type decimal. for example greatest of two numbers
    urgent requirement

    Hi
    Check the http://java.sun.com/j2se/1.4.2/docs/api/java/sql/Date.html
    http://java.sun.com/j2se/1.4.2/docs/api/java/util/Calendar.html
    Sample Code
    Date now = new Date();
          DateFormat df = DateFormat.getDateInstance();
          String s = df.format(now);
          System.out.println("Today is " + s);
    java.sql.Date descends from java.util.Date, but uses only the year, month and day values. There are two methods to create a Date object. The first uses a Calendar object, setting the year, month and day portions to the desired values. The hour, minute, second and millisecond values must be set to zero. At that point, Calendar.getTime().getTime() is invoked to get the java.util.Date milliseconds. That value is then passed to a java.sql.Date constructor:
        Calendar cal = Calendar.getInstance();
        // set Date portion to January 1, 1970
        cal.set( cal.YEAR, 1970 );
        cal.set( cal.MONTH, cal.JANUARY );
        cal.set( cal.DATE, 1 );
        cal.set( cal.HOUR_OF_DAY, 0 );
        cal.set( cal.MINUTE, 0 );
        cal.set( cal.SECOND, 0 );
        cal.set( cal.MILLISECOND, 0 );
        java.sql.Date jsqlD =
           new java.sql.Date( cal.getTime().getTime() );
    The second method is java.sql.Date's valueOf method. valueOf() accepts a String, which must be the date in JDBC time escape format - "yyyy-mm-dd". For example,
        java.sql.Date jsqlD = java.sql.Date.valueOf( "2010-01-31" );
    creates a Date object representing January 31, 2010. To use this method with a Calendar object, use:
        java.sql.Date jsqlD = java.sql.Date.valueOf(
                cal.get(cal.YEAR) + ":" +
                cal.get(cal.MONTH) + ":" +
                cal.get(cal.DATE) );
    which produces a Date object with the same value as the first example.
    Regards
    Ayyapparaj

  • Sqlldr date format

    Dear experts,
    I'm trying to load txt file into table via sqlldr. I'm receiving error "Rejected - Error on table TEST_TABLE, column PERIOD_START_TIME. ORA-01843: not a valid month
    The date format in flat txt file is MM:DD:YYYY; in the output table I want to have is DD.MM.YYYY
    It looks that sqlldr wrongly interprets input date format - when the input is 07-08-2012 then the output is 07.08.2012 so it assumes that the input is in format MM-DD-YYYY instead of DD-MM-YYYY. And when the day is higher than 12 (13,14 etc) then an error appears
    Do you know where/how to force SQLLDR to interpret it correcly? Is it somehow related to NLS_Lang. settings?
    Control file looks as follow:
    OPTIONS (SKIP=1)
    LOAD DATA
    INFILE test.txt
    APPEND
    INTO TABLE TEST_TABLE
    FIELDS TERMINATED BY ';'
    TRAILING NULLCOLS
    (NE_ID,
    LAC_ID,
    PERIOD_START_TIME DATE 'DD.MM.YYYY HH24:MI:SS',
    PERIOD_DURATION,
    NSCURRENT,
    NSAVERAGE
    Table definition:
    NE_ID     NUMBER     
    LAC_ID     NUMBER     
    PERIOD_START_TIME     DATE     
    PERIOD_DURATION     NUMBER     
    NSCURRENT     NUMBER
    NSAVERAGE     NUMBER
    INPUT DATA:
    NE_ID;LAC_ID;PERIOD_START_TIME;PERIOD_DURATION;NSCURRENT;NSAVERAGE;
    576527001;37000;07-16-2012 09:00:00;60;24846;24956;
    576527001;37000;07-08-2012 10:00:00;60;1;1
    Thanks in advance for any hints
    Rgds
    Lukasz

    Hi, Lukasz,
    Welcome to the forum!
    user8640349 wrote:
    Dear experts,
    I'm trying to load txt file into table via sqlldr. I'm receiving error "Rejected - Error on table TEST_TABLE, column PERIOD_START_TIME. ORA-01843: not a valid month
    The date format in flat txt file is MM:DD:YYYY; in the output table I want to have is DD.MM.YYYYIn the table, if the column is a DATE, then it won't have either format. Format, such as 'MM:DD:YYYY' versus 'DD.MM.YYYY' only applies to strings.
    It looks that sqlldr wrongly interprets input date format - when the input is 07-08-2012 then the output is 07.08.2012 so it assumes that the input is in format MM-DD-YYYY instead of DD-MM-YYYY. And when the day is higher than 12 (13,14 etc) then an error appears
    Do you know where/how to force SQLLDR to interpret it correcly? Is it somehow related to NLS_Lang. settings?
    Control file looks as follow:
    OPTIONS (SKIP=1)
    LOAD DATA
    INFILE test.txt
    APPEND
    INTO TABLE TEST_TABLE
    FIELDS TERMINATED BY ';'
    TRAILING NULLCOLS
    (NE_ID,
    LAC_ID,
    PERIOD_START_TIME DATE 'DD.MM.YYYY HH24:MI:SS',The format you give after the keyword DATE tessls what the input data looks like. If the month comes before the day in your input file, then you should be saying
    {code}
    PERIOD_START_TIME DATE 'MM.DD.YYYY HH24:MI:SS',
    {code}
    PERIOD_DURATION,
    NSCURRENT,
    NSAVERAGE
    Table definition:
    NE_ID     NUMBER     
    LAC_ID     NUMBER     
    PERIOD_START_TIME     DATE     
    PERIOD_DURATION     NUMBER     
    NSCURRENT     NUMBER
    NSAVERAGE     NUMBER
    INPUT DATA:
    NE_ID;LAC_ID;PERIOD_START_TIME;PERIOD_DURATION;NSCURRENT;NSAVERAGE;
    576527001;37000;07-16-2012 09:00:00;60;24846;24956;
    576527001;37000;07-08-2012 10:00:00;60;1;1SQL*Loader only controls how data gets into a table. It has nothing to do with what you do with that data after it is in the table.
    If you want a DATE column displayed in a particular format, then use TO_CHAR in the query that produces the display, or change NLS_DATE_FORMAT to set the default date format in your session. For example:
    {code}
    ALTER SESSION SET NLS_DATE_FORMAT = 'DD.MM.YYYY HH24:MI:SS';
    SELECT ename
    ,     hiredate
    FROM     scott.emp
    ORDER BY hiredate
    {code}
    Output:
    {code}
    ENAME HIREDATE
    SMITH 17.12.1980 00:00:00
    ALLEN 20.02.1981 00:00:00
    WARD 22.02.1981 00:00:00
    JONES 02.04.1981 00:00:00
    BLAKE 01.05.1981 00:00:00
    CLARK 09.06.1981 00:00:00
    TURNER 08.09.1981 00:00:00
    MARTIN 28.09.1981 00:00:00
    KING 17.11.1981 00:00:00
    JAMES 03.12.1981 00:00:00
    FORD 03.12.1981 00:00:00
    MILLER 23.01.1982 00:00:00
    SCOTT 19.04.1987 00:00:00
    ADAMS 23.05.1987 00:00:00
    {code}
    It doesn't matter what format the date information was in before it was entered into the table. In the table, all DATEs have the same format.

  • F:convertDateTime - how to define two valid date formats?

    I have an input field that accepts a date. There are two valid date formats allowed: yyyyMMdd & yyyyMMM
    I am currently doing this ...
    <h:inputText ...>
    <f:convertDateTime pattern="yyyyMMdd" />
    <f:convertDateTime pattern="yyyyMMM" />
    </h:inputText>
    ... but only the second date format is being accepted as valid.
    How can I specify two valid date formats for the input?
    Thanks,
    rh
    Edited by: user13328234 on Oct 27, 2010 12:47 PM

    user13328234 wrote:
    Thanks for the suggestion. I was actually using it for validation, so I implemented a custom validator so I'm good now.
    But, for some reason I expected it to work with two converters specified, and I'm a little disappointed it didn't work.
    Thanks again,
    rhExpecting = assuming. Its getting old and annoying now, but it remains a very bad idea.
    The fact of the matter is that you have a very specific need. There is only one way to tailor to specific needs in a generic API: allow to override default behavior. The other option is to create a bloated API that tries to incorporate so many bells and whistles that it becomes unusable. So in my opinion, JSF is designed exactly the way it is supposed to be in this respect.

Maybe you are looking for

  • How do I know if an erroneously purchased app has been credited?

    When I first purchased my iPad, my granddaughter downloaded MANY games of Hungry Shark Evolution and charged a huge amount to my account!  Fortunately, Apple credited these back to me.  Now I've been told I need to transfer all my purchases from my i

  • Clearing Vendor

    Hello, I still have a problem with one vendor. In FBL1N I can see an open item, but when I try to clear it in F-44, it gives me a meesage "No open items were found". on advice from forum I have checked F110, if the vendor is not in auto-payment propo

  • Customer Details in Demantra

    Hi, Can someone tell me if there is any table in which the Customer information like customer name, Account number is stored in Demantra ? or is it only the table 't_ep_ebs_demand_class' which stores the demand class details? Thanks and Regards, Brig

  • Qaaws url connection issue

    Dear All, *Description of Problem :* When i am entering the below URL link1 in the host definition at Qaas,then it is not able to accept it.Suppose if i change the URL like below link2 ,qaaws is accepting. I need the expert help on this Link1: http:/

  • Creating a forum in portal

    Hi masters! I have to create a forum in sap portal and where can i start? Have you any documentation or suggestion to start somewhere? Thanks.