Examples of Date operations

Hi all,
I got a new development, which deals with Date operations only.
So, can anybody please send me the Commands used to do the date and time operations with Examples.
\[removed by moderator\]
Thanks in advance..
Jagan mohan.
Edited by: Jan Stallkamp on Jul 29, 2008 5:25 PM

Hi
Check this Report
REPORT demo_data_date_time .
date calculation
DATA: ultimo TYPE d.
ultimo      = sy-datum.
ultimo+6(2) = '01'.
ultimo      = ultimo - 1.
WRITE ultimo.
ULINE.
time calculation
DATA: diff TYPE i,
      seconds TYPE i,
      hours TYPE i.
DATA: t1 TYPE t VALUE '200000',
      t2 TYPE t VALUE '020000'.
diff = t2 - t1.
seconds = diff MOD 86400.
hours = seconds / 3600.
WRITE: / text-001, hours.
ULINE.
convert date
DATA: odate TYPE d VALUE '19955011',
      idate LIKE odate.
DATA  field(8) TYPE c.
field = odate.   WRITE / field.
CONVERT DATE odate INTO INVERTED-DATE idate.
field = idate.   WRITE / field.
CONVERT INVERTED-DATE idate INTO DATE odate.
field = odate.   WRITE / field.
Hope this Helps .
Praveen

Similar Messages

  • Date Operations

    Hi all,
    Knows Anybody a tutorial tha teach how to work with Date Operations. Add, Subtract etc...
    Example:
    date format MM/DD/AAAA
    02/10/2002 + 1
    Results
    02/11/2002
    Thanks.

    Take a look at the javadocs for Date, Calendar, DateFormat, SimpleDateFormatter, etc. That should get you started.

  • Simple Examples of data connectivity and transfer of data from an .asp.vb to javascript in an .aspx file

    What forum might be useful in solving this issue:
    Simple Examples of data connectivity and transfer of data from an .asp.vb to javascript in an .aspx file

    They'll help you here in the Microsoft ASP.net forums.
    http://forums.asp.net/
    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows]
    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.

  • Change IE02 field (Customer/Vendor Data - Operator)

    Hello experts,
    Does anyone know if there is any BAPI or FM for changing the Operator Field (IE02-> Customer/Vendor Data -> Operator) ???
    Any advice/suggestion about how to do this without using a BDC program?
    Thanks in advance,
    -C

    Hi robert,
    it will solve your problem.
    CUSTOMER_ADD_DATA_CS open for input in display mode
    We can use SET_DATA method and parameter  i_Activity.
    Reddy

  • Please let me know a good example of Data Modeling Xml files...

    Business process, ERD and so on...
    Anything is OK. I want to get a good example of Data Modeling XML files.
    I want to see what you did and how to use it more efficiently.
    Thanks in advance.
    Edited by: allbory on May 17, 2009 11:05 PM

    Hello,
    there are several samples at data modeler page http://www.oracle.com/technology/products/database/sql_developer/files/Modeling.html
    Philip

  • Oracle example tables data ??

    Hi,
    I have created the thread in SQL and PL/SQL ...below is the link
    Oracle example tables data ??
    Any direction is greatly appreciated. Thank you!!

    Recommended procedure
    1) Get the "Oracle Database 11g Release 2 Examples" (win32_11gR2_examples.zip (565,154,740 bytes)) from http://www.oracle.com/technology/software/products/database/oracle11g/112010_win32soft.html
    2) Get and read the "Oracle® Database Examples Installation Guide" http://download.oracle.com/docs/cd/E11882_01/install.112/e10846/toc.htm
    3) Get and read the "Oracle® Database Sample Schemas 11g Release 2 (11.2)" manual at http://download.oracle.com/docs/cd/E11882_01/server.112/e10831/toc.htm

  • There is no message to return to tell user when clear data operation in HFM ?

    We have a HFM of Hyperion 11.1.2.2 running Windows 2008 R3 server with Oracle 11g on IBM AIX server. When user ran "clear data operation" on HFM server. The clear data operation is good just there
    is no message to show is completed. Is a setting missing on HFM server or shared services server ? Any thoughts ?  thanks

    This is clear data operation steps: see below
    Log into Workspace
    Navigate -> Applications -> Consolidation ->a servername
    Application Tasks -> Data -> Manage
    Under Clear Data:
    Uncheck Enable Detailed Logging
    Uncheck Rates and System Data
    Scenario = Actual
    Year = 2012
    Period = May
    Account = [Hierarchy]
    Entity = filter on Base Entities-> Select base Entities

  • BC4J Query by example for dates uses wrong date format

    When querying by example on date fields, I get the following nested exceptions:
    oracle.jbo.SQLStmtException: JBO-27121: SQL error during statement execution.
    JBO-26044: Error while getting estimated row count for view object
    and
    java.sql.SQLException: ORA-01830: date format picture ends before converting entire input string.
    It would seem to be caused by the following clause added to the end of the entity object's query:
    "QRSLT WHERE ( ( (DATE_FIELD = TO_DATE('23/12/2003', 'yyyy-mm-dd')) ) )"
    which causes problems as our entity objects use a 'dd/MM/yyyy' date format.
    Is there a way we can make the query by example use the same date format as the rest of our app?

    I‘m not an expert on this but I see nobody is replying so this might help you. I've been having problems with dates as well and I‘m pretty sure that the attached formatter isn't used in find mode. That is because the java date class (can't remember which one) used by the BC4J has the format yyyy-mm-dd. I don't now if it is possible to change it but I got around the problem by writing my own domain. You can take a look at Toystore demo, by Steve Muench, that uses a custom date domain, ExpirationDate (see the code below). It is mapped to a VARCHAR column in the database but it is possible to map it to a DATE column.
    I have been watching the postings with questions about dates and I have noticed that a lot of people have problems with this but I haven’t seen an answer yet.
    package toystore.model.datatypes.common;
    import java.io.Serializable;
    import java.text.SimpleDateFormat;
    import java.util.Calendar;
    import java.util.Date;
    import oracle.jbo.Transaction;
    import oracle.jbo.domain.DataCreationException;
    import oracle.jbo.domain.DomainInterface;
    import oracle.jbo.domain.DomainOwnerInterface;
    // --- File generated by Oracle Business Components for Java.
    * This custom datatype implements an immutable domain class that
    * maps to a VARCHAR column containing values like '10/2004' representing
    * expiration dates of credit cards. We could have chosen to implement
    * this as a domain that stores itself in a DATE column instead of a
    * VARCHAR column, but since the Java Pet Store demo schema stored the
    * information in a VARCHAR column, we decided to illustrate how to
    * accommodate that case using domains.
    public class ExpirationDate implements DomainInterface, Serializable {
    private Date mDate;
    private String mDateAsString;
    protected ExpirationDate() {
    mDate = new Date();
    convertDateToStringFormat();
    * Return the value of the expiration date as a java.util.Date
    public Date getDateValue() {
    return mDate;
    * Allow expiration date to be constructed from two
    * strings representing month and year
    public ExpirationDate(String monthVal, String yearVal) {
    this(monthVal+'/'+yearVal);
    public ExpirationDate(String val) {
    validate(val);
    convertDateToStringFormat();
    * The getData() method must return the type of object that JDBC will
    * see for storage in the database. Since we want this ExpirationDate
    * datatype to map to a VARCHAR column in the database, we return the
    * string format of the date
    public Object getData() {
    return mDateAsString;
    * <b>Internal:</b> <em>Applications should not use this method.</em>
    public void setContext(DomainOwnerInterface owner, Transaction trans, Object obj) {
    * Performs basic validation on strings that represent expiration dates
    * in the format of MM/YYYY. Note that in the process of testing whether
    * the string represents a valid month and year, we end up setting
    * the private member variable mDate with the date value, so if the
    * validate() method does not throw an exception, the mDate will be setup.
    protected void validate(String val) {
    if (val != null) {
    if (val.length() != 7 ||
    val.charAt(2) != '/' ||
    !isAllDigitsExceptSlashAtPositionTwo(val) ||
    !isValidMonthAndYear(val)) {
    throw new DataCreationException(ErrorMessages.class,
    ErrorMessages.INVALID_EXPRDATE,
    null,null);
    * Returns true if all digits except position 2 (zero-based) are digits
    private boolean isAllDigitsExceptSlashAtPositionTwo(String val) {
    for (int z=0, max = val.length(); z < max; z++) {
    if (z != 2 && !Character.isDigit(val.charAt(z))) {
    return false;
    return true;
    * Returns true if the val string, assumed to be in "MM/YYYY" format
    * is a valid month and year value, setting the mDate member variable
    * if they are valid.
    private boolean isValidMonthAndYear(String val) {
    try {
    int month = Integer.parseInt(val.substring(0,2));
    int year = Integer.parseInt(val.substring(3));
    Calendar c = Calendar.getInstance();
    c.setLenient(false);
    c.set(year,month-1,1); // Month is zero-based !
    mDate = c.getTime();
    catch (IllegalArgumentException i) {
    return false;
    return true;
    public String toString() {
    return mDateAsString;
    * Convert mDate to String format
    private void convertDateToStringFormat() {
    if (mDate != null) {
    SimpleDateFormat sdf = new SimpleDateFormat("MM/yyyy");
    mDateAsString = sdf.format(mDate);
    * Return true if the expiration date is in the future
    public boolean isFutureDate() {
    return mDate.compareTo(new Date())> 0;
    * Compare the Expiration Dates by comparing their respective
    * getData() values
    public boolean equals(Object obj) {
    if (obj instanceof DomainInterface) {
    Object thisData = getData();
    if (thisData != null) {
    return thisData.equals(((DomainInterface)obj).getData());
    return ((DomainInterface)obj).getData() == null;
    return false;

  • HT4623 what if the software up date operation is not on your phone because your running 4.2.6(8e200)

    how do I update if the software up date operation is not on your phone because your running 4.2.6(8e200)

    All you need is up to date computer iTunes.
    Plug your iPhone to iTunes, in Summary page click Check for Update button.

  • SharePoint 2013 REST API with C# - Mapping HTTP verbs to data operations - Requesting FormDigest

    SharePoint REST interface maps HTTP verbs to data operations. Endpoints that represent
    Read operations map to HTTP
    GET commands. Endpoints that represent update operations map to HTTP
    POST commands, and endpoints that represent update or insert operations map to HTTP
    PUT commands (Ref:
    How to: Complete basic operations using SharePoint 2013 REST endpoints).
    Is this mapping of HTTP verbs to CRUD operations a design paradigm or whether there are other technical reasons to this mapping
    Is is possible to use a GET command for say an update operation or a POST for say a read operation.If so, what consideration make the choice of either usage
    In the code snippet below FormDigest is requested as POST, why not use GET here?
    private static string GetFormDigest(string webUrl)
    //Validate input
    if (String.IsNullOrEmpty(webUrl) || String.IsNullOrWhiteSpace(webUrl))
    return String.Empty;
    //Create REST Request
    Uri uri = new Uri(webUrl + "/_api/contextinfo");
    HttpWebRequest restRequest = (HttpWebRequest)WebRequest.Create(uri);
    restRequest.Credentials = CredentialCache.DefaultCredentials;
    restRequest.Method = "POST";
    restRequest.ContentLength = 0;
    //Retrieve Response
    HttpWebResponse restResponse = (HttpWebResponse)restRequest.GetResponse();
    XDocument atomDoc = XDocument.Load(restResponse.GetResponseStream());
    XNamespace d = "http://schemas.microsoft.com/ado/2007/08/dataservices";
    //Extract Form Digest
    return atomDoc.Descendants(d + "FormDigestValue").First().Value;
    Thanks - Abhishek

    Many SharePoint REST api methods use parameters. It is much more efficient to post parameters than use query string variables.  Many times complex types are sent and these require json notation objects posted in the body. In the case of "_api/contextinfo,
    it is recommended to use POST rather than a GET when using sensitive data. GET responses can be cached. Since you are getting a security token back in that call it is recommended to use a POST.
    http://blog.teamtreehouse.com/the-definitive-guide-to-get-vs-post
    Blog | SharePoint Field Notes Dev Tools |
    SPFastDeploy | SPRemoteAPIExplorer

  • How do i create two Examples in Parallel operation

    Cont Acq&Graph Voltage-Ext Clk.vi
    Measure Angular Position.vi
    How do i make these two example program in a Parallel execution mode?
    Joe
    Using Ver. 8.0

    I done this in the following way.
    Encoder output is connected to PFI0 and CTR0_SOURCE.
    AI is getting triggered by PFI0 and  Counter Input is configured for Counter Edge.
    Once this over this datas are logging into a file.
    Problem is... as per the flow once i finished the loop i.e pulse count *0.144( which is the angle for each pulse, because i am using 2500PPR Encoder) reaches 70, pulse count will be 486 and the same time if you check the file , we wont have 486 datas in it, we will missing some 50-100 data on that.
    this encoder movement is manual and speed varies always.
    this missing data in file will happen only if the speed of encoder movement increased.
    can we make this independent  of speed ???
    pls refer the attached file for program flow.
    Joe
    Using Ver. 8.0
    Attachments:
    vi.JPG ‏223 KB

  • TS3297 I have an iPhone 4S - software up to date, operating under IOS7 -- all is well except suddenly I am not able to connect to the iTunes store. Tap the icon and immediately it returns to the home screen

    I have an iPhone 4S - software up to date on all counts, operating under IOS7.  I cannot open iTunes store.  Tap on the icon and it immediately flashes
    back to its home screen.   I have  no problem on my iMac or my iPad 4 -- just the iPhone 4S.

    Sounds like the device was dropped at some point and damaged as a result.
    Take it to Apple for evaluation and a replacement.

  • Example in Data Modeler Tutorial does not work as described

    Using Oracle Data Developer 4, I cannot get the example on https://docs.oracle.com/cd/E57998_01/doc.41/e57984/tut_data_modeling.htm#DMDUG36173 to work as described. The Foreign Key fields in the logical model are not generated. They are only generated in the relational model when I develop the logical model. However, the names follow the template {table}_{table}_ID, which will cause problems for long table names. Now I have two questions:
    1. How can get the foreign key fields to be generated in the logical model, as descibed in the tutorial?
    2. Where can I see the default naming rules for generated fields used by the program and where can I change them? - I found a description how this works in Version 3, but these options do not exist anymore in Version 4.

    2. Where can I see the default naming rules for generated fields used by the program and where can I change them? - I found a description how this works in Version 3, but these options do not exist anymore in Version 4.
    In version 4 the template definitions are defined in the properties for the Design.
    Right-click on the Browser entry for your Design and select Properties.
    In the tree in the left panel of the Design Properties dialog, expand Settings, then expand Naming Standard and select Templates to display the Template definitions.
    David

  • Date operations with internal table

    Dear friends
               would you like to tell me. how i determine the most recent date and time from internal table i am not supposed to sort the table by date and time... I must check date and time with other records date and time to determine which record is most recently changed...
    here the scenario is.
    id       idnumber  chdate      chtime
    1        123456    20060606    135312
    2        123456    20060606    135900
    3        123456    20060606    132300
    4        123457    20060606    140000
    5        123457    20060606    142500
    in the above scenario i must keep in my mind that the most recently changed record is identical to its idnumber i can say that:
    the record should be fetched this way
    id       idnumber  chdate      chtime
    3        123456    20060606    132300
    5        123457    20060606    142500
    because here the id 3 is the most recently changed in the idnumber 123456
    where id 5 is the most recently changed in the idnumber 123457
    please help me to determin how i am supposed to carry out this task  any suggestion, code will be great help of mine.
    regards
    Naim

    Hi Naim,
      For example if ur select statement is like this..
       select id idnumber chdate chtime from xtable into table itab  where ...<condn>..
        sort itab by  idnumber chdate chtime  descending.
         delete adjacent duplicates from itab comparing idnumber .
         Code like above statement..
       You can get result...
    id idnumber chdate chtime
    3 123456 20060606 132300
    5 123457 20060606 142500
      Reward the points if it helps.

  • Example storing data in the default schema with a Web Dynpro application

    Hi,
    is there any example or tutorial for storing data in the default schema with a Web Dynpro application via SQLJ or Hibernate by using the default DataSource?
    Thanks for Help,
    Dirk

    Hi,
    When you create the TAB-Strip object you should be able to set the default displayed TAB against the properties of the TAB-Strip.
    Gareth.

Maybe you are looking for

  • Can I change the font size in iCal 5.0?

    I find the font size to be too small in iCal, specially for the "Reminder" section, how can we change the size? Thanks.

  • Hard drive full even though it's not.

    Don't have much on my mac but in the HD info it says i have 616 kb left which is obviously nothing. Even when i delete files and empty trash it returns to 616kb even though I've deleted stuff. Seems something is returning the remaining space to 616kb

  • How to move an object in LDAP

    I apologize for asking a really simple question that has likely already been answered here, however I find the forum search lacking in usability. So, here's the simple question... I am using JDNI to connect to and modify objects in LDAP. When I am do

  • How can the process of pir creation be stopped while creating PO

    hi all,          We  have a requirement of stopping PIR crreation during PO creation.Any pointers for the same is highly appreciated.It's quite urgent. Regards, Rajashree

  • Theme in Webdynpro from Mobile

    Hi all,   We have created a WebDynpro component and we try accessing from a Mobile device (Pocket PC), the elements in screen don´t have the same portal theme.   We can´t solved the problem using sap-css-url parameter in url, we have tried too modify