Date field should be different

Hi
Iam creating an application in web dynpro.In that labels "From Date" and "To Date" labels are present.
In that i created Context of type "Date".
I written code like this.
Date date=new Date();
        java.sql.Date today=new java.sql.Date(date.getTime());
        wdContext.currentTimelogElement().setFromDate(today);
        wdContext.currentTimelogElement().setToDate(today);
While writing like this,its showing todayDate as "From Date " and "To Date ".
I want both the Dates should be different.
Suppose "From Date-06/02/2009"  "To Date---10/02/2009" or
               From Date-01/02/2009"  "To Date---06/02/2009"
For that what are the modifications i have to do in the Code.
Regards
Sushma

Hi Sushma,
Create 2 Date instances for 'FromDate' & 'ToDate' with required values & set them.
Example:
java.sql.Date fromDate = new java.sql.Date(109, 1, 1); // This is 1st Feb, 2009
wdContext.currentTimelogElement().setFromDate(fromDate);
Similarly, java.sql.Date toDate = new java.sql.Date(109, 1, 6); // This is 6th Feb, 2009
wdContext.currentTimelogElement().setToDate(toDate);
For details, refer http://java.sun.com/j2se/1.4.2/docs/api/java/sql/Date.html
Hope this answers your query.
Kind Regards,
Nitin
Edited by: Nitin Jain on Feb 6, 2009 6:41 AM

Similar Messages

  • BDC date field should be blank

    I am creating a bdc - the date field should be blank.
    My logic is if input-field ne '0'.
      if w_ausbs ne '00000000'.
          PERFORM bdc_field    USING 'VIQMEL-AUSBS'  w_ausbs.
       else.
          PERFORM bdc_field    USING 'VIQMEL-AUSBS'  ' '.
       endif.
    Initially i just tried
      if w_ausbs ne '00000000'.
          PERFORM bdc_field    USING 'VIQMEL-AUSBS'  w_ausbs.
      endif.
    However, the field still gets populated with '00000000' which casues an error since it should be blank.  Able to create manually without entering a value in this field so it is not mandatory.
    Any ideas on how to get this field to be left blank.
    Thanks,
    Jill

    Hi Jill,
    1. U want the date field to be  blank.
    a) make sure it is not compulsory
    b) secondly, make sure, default value
       does not come up when entering
       data in the tcode
    2. If this is so , then
       how is ur w_ausbs defined ?
       a) it should be c(8)
    (so that 0000000 does not come,
      spaces come !)
      and specificlally passit
      using
    PERFORM bdc_field USING 'VIQMEL-AUSBS' w_ausbs. <---
    regards,
    amit m.

  • SPl G/L posting Due on Date field should mandatory field .

    Hi ,
    while posting special G/l code 'G', (Advances from vendor with posting Key-29 ) I need  Due on Field as Mondatory field, (Baseline date for due date calculation
    Date to which the periods for the cash discount deadline and the due date for net payment refer. This is the case for line items in open item accounts.) it is giving other Spl G/l code except this code, it is in suppress mode. anybody can help me how get this field as reqd.( I have given same field status group and same reconciliation account also, for which I am getting it is a mondatory field eventhough it is not showing)
    Regards,
    SYReddy.

    1) use validation :  OB28
    2) tcode OB41
    A.

  • Date Profile -- custom date field should be populated.

    Hi All,
    I am creating a sales order from CRM Web UI. I am having Configurable Product. to create a sales order.
    If i click on configure product button, I can maintain the parameter values (Months) while creating a sales order.
    Now my question is i need the "Sales Order End date" automatically populated with "Sales order start date" + above menctioned Parameter value by months.
    Please let me know if you need any more details.
    What i have done is i created a date rule to configure this and added the parameter in the generated ABAP code for date rule.
    But i am not having any luck to populated the value.
    Please show some light to move further.
    Thanks in Advance.
    Regards,
    Siva

    Hi Sushma,
    Create 2 Date instances for 'FromDate' & 'ToDate' with required values & set them.
    Example:
    java.sql.Date fromDate = new java.sql.Date(109, 1, 1); // This is 1st Feb, 2009
    wdContext.currentTimelogElement().setFromDate(fromDate);
    Similarly, java.sql.Date toDate = new java.sql.Date(109, 1, 6); // This is 6th Feb, 2009
    wdContext.currentTimelogElement().setToDate(toDate);
    For details, refer http://java.sun.com/j2se/1.4.2/docs/api/java/sql/Date.html
    Hope this answers your query.
    Kind Regards,
    Nitin
    Edited by: Nitin Jain on Feb 6, 2009 6:41 AM

  • How to process reports with two different date fields

    Morning all,
    This question is somewhat similar to what I asked few days back. I created two different reports for two different departments (Credit Control and Free of Charge Control).
    These two reports pull data from two different date fields and has different status check ups.
    Few days back my director requested me if he can have both reports in one report. That is when I asked question from all of you regarding two reports.
    Anyhow, that was created by implementing two sub reports however, the director asked me to combine the two different reports into one in such a way that the output records should be added up with each other hence one single report with all combined data of Credit Control and Free of Charges (not two sub reports in one report).
    The problem here which I am getting is that, both reports uses two different date fields. I can live with two different statuses as that can be easily done within formula/RT however how to create a report with Report Selection Formula condition which looks in both date fields and produces results accordingly?
    I have tried this by not putting any condition in report selection formula and ran the report, it produced total results from past 6 years.
    Any ideas how to produce combined report which has two different date fields?
    Many thanks in advance
    Regards
    Jehanzeb
    What I

    Charliy,
    No the both dates are from two different databases, tables and fields. The Credit date field is from KLAB database under max table where as the FOC date field is from SAE database under maxmast table. Klab date is under credit2 table where as foc date is under order header table.
    So its more like this:
    Klab->Max-Credit2--->Credit_date
    Sae->Maxmast->Order_header---Date entered.
    two dates totally different tables, dbs
    however, I will try your idea too and see if that works.
    Regards
    Jehanzeb

  • Add 90 days to a date field.

    Hi All,
    I have a form page in which i have a field called date. The requirment is like this whenever i come to this form page the date field should 1st check the sysdate and add 13 weeks or 90 days to it and display it there. It should be like this whenever user comes to this page the date field gets loaded like this and display there. Need help to do this.
    Thanks in advance.
    Regards

    But i want this field to be dynamic. This date field is date picker. If i select 15th May from date picker it should populate 14th august. Any suggestions on thisIs this concept of selecting one date and having a completely different one appear going to be clearly understood by users? From a usability/accessibility perspective it may be a better idea to use 2 items, with the initial selection being made in a date picker and the computed value appearing in a separate display/read-only item.

  • Click event to add (or subtract) a day to a date field

    I have a form that is giving me a little trouble. I want to be able to input a start date in one field, then input a number of days in another field, and then have it calculate a date that is that number of days away from the start date. The form is actually working ok for the most part, but there are a couple of issues I'm having.
    1. The end date is not calculating immediately upon exiting the number of days field. You have to tab all the way back to the start date and only when you exit that field does it calculate the end date. I need it to calculate when you exit the number of days field.
    2. I have added a little (+) and (-) button to be able to increase or decrease the date by one day. This works, but the problem is, I want to do this in the background. Meaning, I want the calculated date to change, but the # of days field to not change.
    So say I enter 12/1/2010 in the start date. Then I enter 1 in the # of days field. When I tab to the Calculated date field, it should immediately change to 12/2/2010. Then, if I click (+), the Calculated date field should go up to 12/3/2010, but the # of days field should stay at 1.
    I've uploaded a sample of what I have figured out so far here:
    https://acrobat.com/#d=v4c4KKdj0hesicxO8yO1pw
    Thanks so much for any help I can get on this!
    Jo

    I think this is what you are after. I moved the logic to the calculate event of the target date and added a numeric field to hold the result of adding/subtracting (called 'delta').
    // form1.#subform[0].date2::calculate - (FormCalc, client)
    var date1 = Date2Num(date1.formattedValue,"MM/DD/YYYY")
    $.rawValue = Num2Date(date1+days+delta,"MM/DD/YYYY")
    You could make 'delta' hidden.
    Steve

  • In BDC programming how can we maintain date field

    hello all
    In BDC programming how we will deal with date field?
    In my flat file my date field format is different from the sap date field format. how can we deal this?

    hi,
    just define a variable with length 10 in ur internal table.
    now pass the date format in flat file as dd.mm.yyyy.

  • Numeric, date field data to be in English format

    My Characterset on 10g AS & 10gdb, NLS_LANG=ARABIC_KUWAIT.AR8MSWIN1256
    In my all arabic screen numerical number & date fields are in arabic. Instead all numeric & date fields should be in English. I have tried settting NLS_LANG=AMERICAN_AMERICA.AR8MSWIN1256 on Application Server. But no use & also by doing this just runtime application is doing flip,,ie from left to right.
    i know I can query using below
    TO_CHAR(hiredate, 'DD/MON/YYYY', 'nls_date_language = ENGLISH')
    Is there any way of doing that at database level, so that all fields of applicaton of type numeric & date are in english.
    thanks

    In reports I am getting Numeric & date format in English. But only forms all these are in arabic.

  • "Start Date" field available

    Hi
    experts....
    I need your help on this ....how can we configure the "start date"field should be available for an opportunity In GUI.i am able to see all the closing dates for an opportunity.But i need start date Please provide me the configuration steps what i need to do in this.
    Thanks
    Mohammad

    Hello Mohammad,
    Did you check transaction BSP_WD_CMPWB (BSP Component Workbench) for this component (click on F2 in the WebUI to find out the right component for your view, it is something like "...111...". The go to your view, go to configuration and add the field if it is not available.
    Best regards,
    Thomas

  • Unicode and Date fields crash the kernel

    Hi,
    we ran into a bug in the query parser while testing our system with japanese dates, that crashes the kernel when a date/time/timestamp field is compared to a literal that contains a unicode character.
    For instance,
    select * from dual where now() = '2011年10月12日'
    will crash the kernel (7.7 or 7.8)
    Normally the date field should be compared only with strings in ISO format, but we fear some wrongly written query will crash our production database.
    Is that a known bug and is there a workaround ?
    Guillaume

    Hi Guillaume,
    this is a bug whereas not a known one up to now. We will solve this ASAP and have created an entry in our error database: [1239879|http://maxdb.sap.com/webpts?wptsdetail=yes&ErrorType=0&ErrorID=1239879].
    Unfortunately there is no other workaround for this error than not to use UNICODE characters in those queries.
    Thank you for reporting.
    Best regards,
    Steffen

  • Very basic, explanation about data fields

    Hi everyone,
    I am new here and I need to undertand the difference between static and nonstatic data fields. In my tutorial it says:
    "To help you determine wether a data field should be static or not, you can ask your self how many many times it occurs. If it occurs once per class, it is static. but if it occurs once per object, it is not static".
    can anyone explain what that means?

    [http://xahlee.org/java-a-day/instance_vs_class_members.html]

  • What key fields should i set in DSO extracting data from 2LIS_02_ITM

    hi experts
    i extract data from 2LIS_02_ITM into a DSO, i know the DSO isn't a must, becoz the 2LIS_02_ITM delta type is ABR, but i want to keep the info in change log.
    so, what the key fields should i set in the dso? just ebeln and ebelp is enough?
    hunger for ur advice and thanks a lot!

    If you extract ITM toa DSO you cannot maintain a log of every change....the data will come ....but when the data must be activated the reference of the ebelp ebeln will remain only a single record....if you want to maintain all the data you must create another field in extractor with you can difference all the changes for one single ebelp ebeln...
    Regards

  • How to creat a Data provider  based on different fields in SAP BW ?

    Hi,
    Experts,
    There are  20 fields  of  Plant Maintainace  like : 
    SWERK
    BEBER
    STORT
    TPLNR
    EQUNR
    INGRP
    QMDAT   ---peroid
    STTXT
    QMDAT  - Date of Notification
    QMNUM
    QMTXT
    QMART
    AUSVN
    AUZTV
    AUSBS
    AUZTB
    AUSZT
    ERNAM
    QMDAB
    AUFNR
    I  want to creat a  Report based upon these fields  ?
    For that I h'v  checked the relevant Fields to the   existing standard  Datasource  in Bw side   &
    Checked  cubes   created  based upon these Datasource  in Bw side !
    i h'v found  some fields are  existing different cubes & some are  missing .
    How to creat a Data provider  based on different fields in SAP BW ?
    plz suggest      !!!!!!!
    Thanx,
    Asit
    Edited by: ASIT_SAP on Jul 15, 2011 6:25 AM
    Edited by: ASIT_SAP on Jul 15, 2011 6:27 AM
    Edited by: ASIT_SAP on Jul 15, 2011 12:37 PM

    Hi Lee, Please see below..
    DECLARE @Machine2 TABLE
    DispatchDate DATE
    INSERT INTO @Machine2 VALUES ('2014/02/01'), ('2014/02/02'), ('2014/02/03')
    DECLARE @DateFrom DATE
    SELECT @DateFrom = DATEADD(D,1,MAX(DispatchDate)) FROM @Machine2
    SELECT @DateFrom AS DateFrom
    Please mark as answer, if this has helped you solve the issue.
    Good Luck :) .. visit www.sqlsaga.com for more t-sql code snippets and BI related how to articles.

  • How to calculate AGE from two different date fields

    hi
    I need to calculate AGE from two different date fields.
    Can some help me how to do, when i try to do substraction formula it is showing error.
    Thank You
    Manu

    Manu wrote:
    Hi
    Both fields are in date format only, i need to calculate no . of days between two different dates
    Thanks
    ManuThe reason for the question about the format of the column is because the simplest solution only works on DATE columns. Others have mentioned this here, but if you want the difference between two date fields, you can use this formula:
    TIMESTAMPDIFF(SQL_TSI_DAY, date_column1, date_column2)
    The above being said, you still didn't tell me what you did, or what error message you received. So again, if the above formula didn't work, what did you do? Where did you put the formula? What was the exact syntax you used? What was the error message you got?
    Please don't make us work more than we need to. Answer all the questions in your next post. Thanks.

Maybe you are looking for

  • How do I download a digital copy to my MacBook Pro

    how do I download and then be able to watch a digital copy on DVD?

  • Can't Sync My iPod ! Help Please

    well ... i just got my new iPod 2nd gen of 4gb .. and i cant sync .. windows recognize the nano .. but when im gonna start sync the nano goes to the menu screen and an error appears on the sync screen .. cant sync .. please help me

  • Lookup dynamic values

    Hello Experts, I have seen different post's and syntax for lookup expression, but all against a static value. e.g. <Type>LookupValue("TODO_TYPE", "To Do") <Type>=LookupValue("TODO_TYPE", "To Do") I am trying to lookup a dynamic value. Unfortunately t

  • Pacman -S usb_modeswitch URL returned error: 404

    Hi, I have a raspberrypi board with archlinux I'm trying to install usb_modeswitch with no success [root@alarmpi ~]# pacman -Ss usb_modeswitch community/usb_modeswitch 1.2.3-1     Activating switchable USB devices on Linux. First search for package o

  • HT1752 Is service outside of California possible?

    Is there ANY WAY to get a screen for my 17" Intel iMac?