Univer Prompt Date Object

I have a date prompt. The users can enter a date or they can leave the Date as null. If they leave the Date prompt as Null It has to go and fetch all the Data even if the date field does not have any value. The problem here is if they leave it as null then i am running into an issue of Date column comparing it against a NULL Value. Is there a way for me to handle this issue.
-Prabu

Hi,
To get all the dates then you have to create a all object andshould place it in existing lovs. Try like this.
1. In the lovs odf the date object i.e date object-> right click ->clicko n edit lovs -> then a query panel opens for you there modify the existing query to
Select distinct(dates) from ........... to
select distinct(dates)  from ................
union
select ' ALL' from dual; ---> where dual is temporary table if back end is oracle. then in date object in universe try with the below synatx as
Date  = (@Prompt('<Prompt message>','A',{'Class\Object'},mono,free)  or  "ALL '' = @Prompt('<Text>','A',{'Class\Object'},mono,free) .
In your case replace all with SIgle quotations.
Cheers,
Suresh Aluri.

Similar Messages

  • How to Sort prompt date in BO Webi report

    Hi Gurus,
    I am facing a critical issue in selecting date prompt in my webi report.
    Please find the below image as the dates are not getting sorted as per year.
    Please suggest solution for this.
    Regards
    Bikash

    Hi Bikash,
          Create a predefined filter in the Universe. The edit the date object by changing the LOV SQL, ordering it on the date field. Now click on the option 'Export with Universe" in the propereties tab and the export the universe.
      Hope it should wok.
    Thanks and Regards
    Ram
    09038887788.

  • Date Object Issue in WebI

    Hello All,
    Currently I am facing an issue with Date Object in WebI. The data type of this specific object in Oracle (11g) is TimeStamp. If I use this object as one of the query filters in my report, I get "ORA-01843: not a valid month" error. I tried writing the custom sql with converting the format of the object to MM/dd/yyyy using TO_DATE function and it works well. Just wondering if there is any other solution that can be implemented at object level. The only solution I can think of is to use TO_DATE function and convert the object at the Universe level. Appreciate if there are any suggestions to handle this.
    Thanks,
    Sowrabha

    Hi Sowrabha,
    Are you hardcoding the date or passing it as a prompt?
    After passing the date value dont run it but check the SQL. What format do you get? Is it yyyy-mm-dd?
    Also try to pass the date in the prompt or filter as dd/MM/yyyy and check if it is working fine.
    It could be the case that the day which you are passing is becoming month in SQL. You might not face the issue with dates like 01/01/YYYY , 02/02/YYYY, ..... , 12/12/YYYY as 1,2,.....12 passed as month wont give any issue.
    The date format inside SQL is dependant on the database and can be checked in PRM file.
    Please check it and let me know.
    Regards,
    Yuvraj

  • Data object is not being populated in BAM

    We are putting the data in JMS Queue. We have created an EMS in BAM. It is picking the data from JMS Queue, but the data object is not being populated. The request we are using here is given below:
    Request:
    <?xml version="1.0" encoding="UTF-8"?>
    <Test xmlns="http://education.com/OrderImport">
    <OrderLineReferenceNumber>abcad</OrderLineReferenceNumber>
    <WebOrderNumber>cccccg</WebOrderNumber>
    <OrderLineCount>gn</OrderLineCount>
    <LineNumber>4</LineNumber>
    <ISBN10>46564574</ISBN10>
    <ISBM13>6767</ISBM13>
    <ID>67</ID>
    <Status>78768</Status>
    </Test>
    Does anybody has any idea on that?
    Regards,
    Chandrachur.

    Hi Arun,
    Thanks for your prompt reply.
    We are not using any trasfomation here. We have created thje Data objects as per the message type in the request.
    Please find the dataobjects details we are using:
    Field name Field ID Field type Max length Scale Nullable Public Lookup Calculated Tip Text
    OrderLineReferenceNumber _OrderLineReferenceNumber string                                    100               -               No             Yes                   -                          -               - 
    WebOrderNumber _WebOrderNumber              string                                    100               -               Yes            Yes                   -                          -               - 
    OrderLineCount _OrderLineCount                 integer                                     -                 -               Yes            Yes                   -                          -               - 
    LineNumber _LineNumber                      integer                                     -                 -               Yes            Yes                   -                          -               - 
    ISBN10 _ISBN10                              string                                    100              -                Yes            Yes                  -                           -               - 
    ISBM13 _ISBM13                             string                                    100              -                Yes            Yes                  -                           -               -
    ID _ID                                    string                                    100              -                Yes            Yes                  -                           -               -  
    Status _Status                              string                                    100              -                Yes            Yes                  -                           -               -  
    Thanks again,
    Chandrachur.

  • Unable to get database format for date object

    Hi,
    I am using UDT to build an universe against Oracle DB, We are using a view to get date object to filter the dates in our reports. Format for the date column in the view is "dd-MMM-yy". Desired format at the WebI layer is also "dd-MMM-yy"
    However, when I pull this object in WebI in filter pane, I am still getting Timestamp with date and the format is also coming as "mm/dd/yyy hh:mm:ss a"; and, if I pull the date column in results pane I am getting the correct format "dd-MMM-yy". I tried typing the value for prompt, using calender (this also gives default timestamp) none of them worked
    I tried using with and with out the TRUNC(date) function, changed object properties at universe level but, still I am getting the same result
    Can you please guide me on, how to get the date value in "dd-MMM-yy" when used in prompt and, is there a possibility to not show timestamp in calendar selection (screenshot: Date parameters2)
    Thanks in advance
    Sri

    Hi Jacq,
    Thanks for your reply. We are on BO4.0 SP04 FP03 with Oracle 11g as back end
    Object type is defined as Date in universe. In the report and the SQL generated are showing as per the backend column format 'dd-MMM-yy'
    However, same date object is showing with timestamp, as 'dd/mm/yyyy hh:mm:ss a' format when showing LOV's &  when selected using calender GUI in prompt screen
    I already tried the below options in various combinations, none of them worked
    1) TRUNC(date)
    2) Object Properties - Advanced
    3) Object Format - custom
    Thanks,
    Sri

  • Website needs Microsoft Data Access - Active X Data Objects

    I have a number of websites for work that are seem to be built around Internet Explorer. When I try to open them on my Mac at home with Safari, I get message that I pasted below.
    I'm thinking this might be related to the fact that when I open them on a PC for the first time it shows a similar message, but Internet Explorer prompts me to download and run "Microsoft Data Access - Active X Data Objects", and then it runs fine.
    Based on this I'm assuming it's a lack of these "objects" that are causing this problem. Is there any equivalent to these components for the Mac? Anything I can try to access these websites from my Mac? I've tried using Firefox as well, which has the exact same issue.
    Right now I've got to fire up my 2006 PC laptop to use Internet Explorer every time I need access to these sites. I realize I could install windows on my Mac with bootcamp and restart in windows every time I need access, but that seems like a waste just to visit 2 websites. Any advice?
    +"Scanning Required components...+
    +The user's Internet browser requires proper configuration to access our site. Read the following instructions on how to set up the browser properly.+
    +Active Scripting Configuration:+
    +Select Tools from the Internet Explorer menu bar.+
    +Select Internet Options ...+
    +Select the Security tab.+
    +In the Web Content Zone list, select «Internet».+
    +Click Custom level....+
    +In the Settings list, scroll down to the Scripting section.+
    +Check the Enable option under the «Active scripting» item and click OK.+
    +Click Yes to confirm the change in the security settings.+
    +In the Internet Options dialog box, select the «Local intranet» and repeat steps 5 to 8.+
    +Click OK to close the dialog box."+

    Hi,
    Try this...
    From your Safari menu bar click Safari / Preferences then select the Advanced tab. Enable the develop menu.
    In the menu bar click Develop / User Agent.
    Try IE 8, 7, or 6.
    No guarantees but can't hurt to try. ActiveX requires Windows.........
    Carolyn

  • Apply a validation for a "prompt date"

    Hello friends.
    As I can include a validation to a "Prompt" date. operator is between and.
    Basically what I want is to limit the "prompt".
    example:
    Date between: 01/01/2012 and: 12/01/2012
    The date range exceeded 6 months.
    Thank you for your cooperation

    You will need to do this:
    1) You will need to build your between prompt like this:
    http://oraclebizint.wordpress.com/2008/02/26/oracle-bi-ee-101332-between-prompts-for-date-columns-using-presentation-variables/
    The reason is because we need the PV for the start date and end date. (I call the PVs pv_StartDate and pv_EndDate, respectively in my example below.)
    2) Create a small report with 3 columns: one column from your SA, it doesn't matter what; and one dummy column.
    3) In the dummy column, click on the fx button, delete the contents and enter the following:
    CASE WHEN TIMESTAMPADD(SQL_TSI_MONTH, 6, '@{pv_StartDate}' > '@{pv_EndDate}' THEN NULL END
    4) Put a filter on the second column for IS NOT NULL
    What this small report does is this: when the difference between the start and end dates is greater than 6 months, then the CASE statement will be NULL and since the filter is only looking for "not NULL" values, the report will return no rows.
    5) Now in your dashboard, add a section and put your report in it. In the Section properties, click on Properties>Guided Navigation and point it to the small report "if request returns rows."
    6) Add another Section below the one above and this time drag a Text object to the section. Put the text you have: "The date range exceeded 6 months. Please choose a date range within 6 months. Thank you."
    7) On the Section properties of this one, click on Properties>Guided Navigation and point it to the small report "if request returns nothing."
    I think you get the picture. When the date range exceeds 6 months, the top section does not appear; instead the user sees the text to change the date range.
    That should resolve your issue.

  • Problem with childs nodes and automatic key mapping in a Data Object

    Hi experts!
    I'm doing the service order tutorial from the mobile help at [this link|http://help.sap.com/saphelp_nwmobile71/helpdata/en/21/9b5b924c3b434fba4767731794b029/frameset.htm] and I have a problem...
    In the topic "Modeling the Equipment Data Object", says you have to mark the "Automatic Key Mapping" checkbox. So when I had to create a third child node ( the location node ) the system raised an exception with the message "Deselect automatic key mapping flag for more than two-level nodes". I'm trying deselecting the flag and creating the location node, but when I want mark again the automatic key mapping flag, this is disabled.
    What can I do to solve this and create the three child nodes with the flag marked? It's a configuration thing?
    Any help it's very welcome. Thanks in advance.
    Best regards,
    Simon.

    The thing is: Its not allowed to use automatic keymapping if you have more than two levels. This is why the message showed up, and this is why its been disabled.
    What automatic keymapping does: Figures out automatically which child node belongs to which parent (by guessing from the field name and type, which fields in the child correspond to which key fields of the parent).
    On three levels, this becomes more complicated => Its disabled.
    How to do keymapping yourself instead of having the DOE do it automatically: Do 'Explicit keymapping' from each child to its parent. Explicit keymapping is done by clicking on the corresponding menu button in the child node. Here you need to associate child node fields (they need not be key fields of the child, but they are allowed to be that as well) to each of its parent nodes key fields (so that each child can be associated to its parent).
    Cheers

  • Error while activating Data object in DOE workbench

    Hi all,
    I created a Data Object and when I try to activate  that DO it is showing an error as below.
    Mobile Java client attributes not maintained.
    Please give some clue to resolve this.
    Thanks and Regards,
    Rajesh.A

    Hi Rajesh,
    I believe you had created an SWCV that is enabled for Backward Compatibility 'Uses NW04/NW04s MI application' and created a Data Object in this SWCV. Ideally, when the SWCV is enabled for Backward Compatibility, the Data Objects should be created by importing the text file as Data Objects from a MI 7.0 server. Since you have not done that way, you are getting this error.
    I would suggest that you create a new SWCV and do not check the option 'Uses NW04/NW04s MI application'. Now create the Data Object again and try to activate it and you should be able to activate it.
    Best regards,
    Vinodh

  • Unable to delete master data line items - Master data object CCHIUSRAM

    Hello
    We have an issue with the Master data Object CCHIUSRAM - CC Hier User Auth Maintenance. It has only master data and no texts no hierarchy. It is not time-dependent. It has /BIC/PCCHIUSRAM, /BIC/SCCHIUSRAM as database table only. This master data is not being used in any infoproviders.
    In development client we are able to delete the line items of the Master data along with entering line items. RSRV check gives green for all checks.
    In Test / Production client we are not able to delete the line items of the Master data. We are only able to enter master data lines and if we change any item then it creates another entry in the table.
    Tried SE14 & RSDMD_DEL_MASTER_DATA - both does not help.
    Did ST05 trace, could not find something concrete.
    If any one has faced such an issue with any master data item then a response is much appreciated. It has become a bottleneck for us.
    Many Thanks in advance
    Pradip Parmar

    Thanks for the response.
    I can do this in EBD, but it is working fine in EBD. I cannot do this activity in EBP / EBT as the systems are closed and I cannot activate directly in EBT / EBP.
    Besides, I have recently transported active versions of the object in EBT / EBP all again twice to see if it changes anything.
    My guess is that, there is something stupid may be I am missing somewhere.
    Any help is much appreciated.
    Thanks

  • Message class as result data object

    hello brf+ users,
    is it possible to use as Result data object in a Case expression a message from a custom message class?
    thanks
    danilo

    thanks Carsten,
    my requirement can be simplified in
    IF FISCAL CODE
    equals to " " then "001" ENTRY MISSING is returned
    otherwise "000" check ok is returned.
    where 000,001 are domain values of an element (MESSAGE RESULT).
    can i use the message class as result? is there a way to anchor the result to the message class?
    thanks
    danilo

  • How do I reference the data object in a DataGrid to show an image correctly in Acrobat?

    I'm creating an inferface for an Acrobat application  and I'm having a issue with displaying an image in a grid.  When I hard code the source="statusNONE.png" it works as intended (with an image, not the image associated with each grid item), however, when I try to use the source="{data.@icon}" to reference the dataProvider (XMLListCollection) I get nothing.  Not a broken image or anything.  I think I may just not be referencing the XMLListCollection correctly, otherwise I don't know why it would work with hard coding vs. fetching the string from the XML.
    //Application Header (Flex 4.5)
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                                     xmlns:s="library://ns.adobe.com/flex/spark"
                                     xmlns:mx="library://ns.adobe.com/flex/mx"
                                     width="100%" height="100%" creationComplete="eaton_creationCompleteHandler(event)"
                                     currentState="Review">
    //Sample of XML that gets used as basis for XMLListCollection
    <Annots>
         <Annot name='TEST' index='14' feedback='' canConstruct='0' icon='statusNONE.png'/>
    </Annots>
    //creation of the XMLListCollection from String
    [Bindable] protected var fullXML:XML;
    [Bindable] protected var fullXMLCol:XMLListCollection;
    protected function loadXML(xmlString:String):void
          fullXML = new XML(xmlString);
         var fullXMLList:XMLList = fullXML.children();
          fullXMLCol = new XMLListCollection(fullXMLList);
    //DataGrid
    <s:DataGrid left="0" top="0" bottom="0" width="142" dataProvider="{fullXMLCol}"
                                            requestedRowCount="4" rowHeight="30"
                                            top.Confirm="87">
                        <s:columns>
                                  <s:ArrayList>
                                            <s:GridColumn dataField="@name" headerText="Annotations"></s:GridColumn>
                                            <s:GridColumn headerText="status" width="30" >
                                                      <s:itemRenderer>
                                                                <fx:Component>
                                                                          <s:GridItemRenderer>
                                                                                    <s:Image width="30" height="30" source="{data.@icon}"/> //THIS IS THE PART THAT SEEMS TO BE GIVNG ME TROUBLE!
                                                                          </s:GridItemRenderer>
                                                                </fx:Component>
                                                      </s:itemRenderer>
                                            </s:GridColumn>
                                  </s:ArrayList>
                        </s:columns>
                        <s:typicalItem>
                                  <fx:Object dataField1="Sample Data" dataField2="Sample Data" dataField3="Sample Data"></fx:Object>
                        </s:typicalItem>
              </s:DataGrid>
    Additional information.  I'm using the resources tab for the flash embedding in Acrobat for my images. This works when I am hard coding the file name string works for the source without having to add a full path, the images are not technically bundled into the swf.   I just don't understand why using the data object to get that same string would show different results.
    tl;dr: GridItemRenderer works to show images when hard coded but not when using {data}.
    UPDATE: Figured it out, needed to add a toString() to the data.@icon.   I had assumed it was a string being handed over, I assumed wrong.

    Probably because data.@icon isn't a String, it is an XMLList, and source property is an Object not a String so the runtime doesn't automatically convert it.
      Try [email protected]()

  • Adding new Data Object while migrating from MI 2.5 to NM7.1

    Dear All,
          We have a custom MI 2.5 application which we need to migrate to 7.1. While migration, we want to add a newly created data object also in migrated application. But when I try to import MBO model, it is not letting me import new data object. The import finishes successfully. But changes in merepmeta.xml are not done. It creates a file with back up of existing merepmeta.xml i.e. merepmeta.xml.bak and create new merepmeta.xml but it is blank. Am I missing something???
           When I import MBO only with existing data objects (syncbos), it is allowing me perfectly. It is changing the merepmeta.xml accordingly as well without creating backup.
    Thanks in advance,
    Saptak Kulkarni.

    Dear Arjun,
         To answer your questions, previously all the SyncBOs were downloaded independently taking username as the import parameter in getList. (Default values). Yes we can provide the same with 7.1 but we wanted to have some sorts of associations between all SyncBOs.
         So first of all, we changed all the BAPI wrappers of old SyncBOs to download all the data independent of user. Now we created new Data Object to only download user specific data. We associated all other Data Objects on this DO. Created a rule for this data object to only download the sync user instance. We were expecting that whenever a user syncs, a single instance of new user data object will get downloaded and subsequently all other data objects having relationship on user will get downloaded. I hope this is not much confusing.
          Now while we import the MBO model, if we don't import new user data object, then also other data object instance get downloaded and fortunately properly filtered. We don't receive any kind of error over here.
          The new data object is not used anywhere in the application. The associations are in new data object and not in the older one. New data object is the leading one wherein others follow.
          Not a single instance is getting dropped for other Data Objects.
          The xml is blank only when we try to import the new Data Object and correctly it gives an error as expected when I try to deploy the application.
    Thanks in advance,
    Saptak.

  • I made a new Date object

    See, here's the thing with dates in java, the way i see it. We used to have Date, but Date wasn't international so we got Calendar. But some things, like SimpleDateFormat, still expect java.util.Date. java.sql.Date is out there somewhere, too. None of them have direct support for date differences (i.e. dateA - dateB = 8 days, or whatever). Now you're probably reading this thinking "Java supports all of this" and you're right. Calendar has a getTime method that returns a Date, and i can just pass THAT to SimpleDateFormat. With a little math, getTimeInMillis can be used to find the difference in two Calendars. But i got to thinking, "There should only be one Date object i need to think about," and since i don't ever have enough to do at work i put one together. I don't know if any of you are going to care enough to use it, mostly i'm just looking for advice on features i should add to it, inefficiencies in the design, stuff that's hard to understand, or whatever.
    This is it:
    *This catastrophe brought to you by SrA Meyerin.
    *Proximo Satis pro administatio.
    package awesomedate;
    //The following are imported for the toFormattedString(), toUtilDate(), toSQLDate, and toCalendar() methods, respectively.
    import java.text.SimpleDateFormat;
    import java.util.Date;
    import java.util.GregorianCalendar;
    import java.sql.*;
    import java.util.TimeZone;
    *This class is designed to be the ultimate date object. It stores dates accurate to the millisecond, has the ability to do date
    *arithmetic (adding/subtracting days/months/whatever), date comparison, and date formatting. Also it can, at will, be used as any
    *of the other date objects in the standard java API.
    public class AwesomeDate
         *Milliseconds from the epoch. This field is where everything starts.
        private long millis;
         * The current year. This is the only aspect of the current date that is stored in addition to the milliseconds. Everything else
         * is calculated as needed.
        private int year;
        //The following six variables are fairly self explanatory. I'll explain them anyway.
         *Milliseconds in one non-leap year. This can be passed to the "adjustDate()" method
         * but mostly it is used to make my code more readable.
        public final static long MILLIS_IN_YEAR = 31536000000L;
         *Milliseconds in one leap year. This can be passed to the "adjustDate()" method
         * but mostly it is used to make my code more readable.
        public static final long MILLIS_IN_LEAP_YEAR = 31622400000L;
         *Milliseconds in one day. This can be passed to the "adjustDate()" method
         * but mostly it is used to make my code more readable.
        public static final long MILLIS_IN_DAY = 86400000;
         *Milliseconds in one hour. This can be passed to the "adjustDate()" method
         * but mostly it is used to make my code more readable.
        public static final long MILLIS_IN_HOUR = 3600000;
         *Milliseconds in one minute. This can be passed to the "adjustDate()" method
         * but mostly it is used to make my code more readable.
        public static final long MILLIS_IN_MINUTE = 60000;
         *Milliseconds in one second. This can be passed to the "adjustDate()" method
         * but mostly it is used to make my code more readable.
        public static final long MILLIS_IN_SECOND = 1000;
         *The number of days in each month.
        private int[] daysInMonth = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
         *The timezone offset. GMT is 0, and the default, however, CST (where i live), is -6.
        private int timeZoneOffset = -6;
         *As the name would indicate, this is the number of milliseconds beyond 00:00 of jan 1 of the current year.
        private long millisAfterYear;
         *Basic constructor. Defaults to the current date and time. Works on Greenwich Mean Time, so it may seem off. To avoid this, multiply
         *add your time zone offset * MILLIS_IN_HOUR to the time in milliseconds.
        public AwesomeDate()
            setTimeInMillis(System.currentTimeMillis());
         *Fairly simple constructor. Sets time to the the number of milliseconds passed past the epoch.
        public AwesomeDate(long millis)
            setTimeInMillis(millis);
         *This constructor sets the date to the year/month/day passed.
        public AwesomeDate(int year, int month, int day)
            setDate(year, month, day);
         *This constructor sets the date time to the year/month/day/minute/hour/second passed.
        public AwesomeDate(int year, int month, int day, int hour, int minute, int second)
            setDate(year, month, day, hour, minute, second);
         *When you have the number of milliseconds, the first thing you must calculate is year. Because the number of milliseconds in a
         *year may vary, this is also the most difficult to calculate. This is the method that does it, though.
        private void setYearAfter1970()
            //I don't want to alter the actual number of milliseconds, so i make this variable and perform calculations on it.
            long theseMillis = this.millis;
            //Start at 1970 (the epoch) and work from there.
            year = 1970;
            long nextYear = MILLIS_IN_YEAR;
            //In this loop i subtract the number of millis in whatever year. The condition is if i have enough millis to make it through
                //another year.
            while (theseMillis >= nextYear)
                if (isLeapYear(year))
                    theseMillis = theseMillis - MILLIS_IN_LEAP_YEAR;
                    nextYear = MILLIS_IN_YEAR;
                else
                    theseMillis = theseMillis - MILLIS_IN_YEAR;
                    if (isLeapYear(year + 1))
                        nextYear = MILLIS_IN_LEAP_YEAR;
                year++;
            millisAfterYear = theseMillis;
            this.year = year;
         *Calculating the year from before 1970 must be done differently. It's pretty much just inverted.
        private void setYearBefore1970()
            long theseMillis = this.millis;
            year = 1970;
            long nextYear = MILLIS_IN_YEAR;
            while (theseMillis <= 0)
                if (isLeapYear(year))
                    theseMillis = theseMillis + MILLIS_IN_LEAP_YEAR;
                    nextYear = MILLIS_IN_YEAR;
                else
                    theseMillis = theseMillis + MILLIS_IN_YEAR;
                    if (isLeapYear(year - 1))
                        nextYear = MILLIS_IN_LEAP_YEAR;
                year--;
            millisAfterYear = theseMillis * -1;
            this.year = year;
         *Just what it sounds like. Pass it the number of milliseconds past the epoch and it will calculate the date based on that.
        public void setTimeInMillis(long millis)
            this.millis = millis;
            if (millis >= 0)
                setYearAfter1970();
            else
                setYearBefore1970();
         *Returns the number of milliseconds from the epoch.
        public long getTimeInMillis()
            return this.millis;
         *Returns the current year.
        public int getYear()
            return this.year;
         *Sets the date to 00:00 of Jan 1 of the passed year.
        public void setYear(int year)
            this.year = year;
            long theseMillis = 0;
            if (year > 1970)
                //Kind of like setYearAfter1970 method, except it's adding instead of subtracting. So actually it's the opposite.
                for (int cntr = 1970; cntr < this.year; cntr++)
                    if (isLeapYear(cntr))
                        theseMillis = theseMillis + MILLIS_IN_LEAP_YEAR;
                    else
                        theseMillis = theseMillis + MILLIS_IN_YEAR;
            else
                for (int cntr = 1970; cntr > this.year; cntr--)
                    if (isLeapYear(cntr))
                        theseMillis = theseMillis - MILLIS_IN_LEAP_YEAR;
                    else
                        theseMillis = theseMillis - MILLIS_IN_YEAR;
            //On a leap year there are 29 days in February. If not, there's 28.
            if (isLeapYear(year))
                daysInMonth[1] = 29;
            else
                daysInMonth[1] = 28;
            //This variable helps me calculate denominations of time that are below year.
            millisAfterYear = 0;
            setTimeInMillis(theseMillis);
         *Sets the month to the one that you passed, 0 being January and 11 being December.
        public void setMonth(int month)
            if (month < 0 || month > 11)
                throw new ArrayIndexOutOfBoundsException(month);
            long theseMillis = getTimeInMillis();
            int days = 0;
            setYear(this.year);
            if (getTimeInMillis() > 0)
                theseMillis = theseMillis - getTimeInMillis();
            else
                theseMillis = theseMillis + getTimeInMillis();
            for (int cntr = 0; cntr < month; cntr++)
                days = days + daysInMonth[cntr];
            millisAfterYear = days * MILLIS_IN_DAY + 1;
            setTimeInMillis(getTimeInMillis() + millisAfterYear);
         *Returns the month stored in this object. With this object 0 represents January and 11 represents December.
        public int getMonth()
            long theseMillis = millisAfterYear;
            int cntr = 0;
            while (theseMillis > (MILLIS_IN_DAY * daysInMonth[cntr]))
                theseMillis = theseMillis - MILLIS_IN_DAY * daysInMonth[cntr];
                cntr++;
            return cntr;
         *Set the day of month to the one passed.
        public void setDayOfMonth(int day)
            if (day < 1 || day > daysInMonth[getMonth()])
                throw new ArrayIndexOutOfBoundsException(day);
            setMonth(getMonth());
            //Internally, this actually works starting at zero, however to anyone using this class it appears to start at 1. Therefore
                //i must subtract one here.
            long addMillis = MILLIS_IN_DAY * (day - 1);
            millisAfterYear = millisAfterYear + addMillis;
            setTimeInMillis(getTimeInMillis() + addMillis + 1);
         *Returns the day of month.
        public int getDayOfMonth()
            int days = (int)(millisAfterYear / MILLIS_IN_DAY);
            int cntr = 0;
            while (days >= daysInMonth[cntr])
                days = days - daysInMonth[cntr];
                cntr++;
            //Internally this class stores dates starting at zero, but i want it to look like it starts at 1.
            return days + 1;
         *Sets the time to the currently selected day at the passed hour on the hour. uses 24 hour clock.
        public void setHour(int hour)
            if (hour < 0 || hour > 23)
                throw new ArrayIndexOutOfBoundsException(hour);
            setDayOfMonth(getDayOfMonth());
            long addMillis = MILLIS_IN_HOUR * hour;
            millisAfterYear = millisAfterYear + addMillis;
            setTimeInMillis(getTimeInMillis() + addMillis);
         *Returns the hour (but not how many minutes past the hour).
        public int getHour()
            long millisAfterDay = millisAfterYear % MILLIS_IN_DAY;
            return (int)(millisAfterDay / MILLIS_IN_HOUR);
         *Set the minutes past the hour. Works 0-59.
        public void setMinute(int minute)
            if (minute < 0 || minute > 59)
                throw new ArrayIndexOutOfBoundsException(minute);
            setHour(getHour());
            long addMillis = MILLIS_IN_MINUTE * minute;
            millisAfterYear = millisAfterYear + addMillis;
            setTimeInMillis(getTimeInMillis() + addMillis);
         *Returns the minutes past the hour, 0-59.
        public int getMinute()
            long millisAfterHour = millisAfterYear % MILLIS_IN_HOUR;
            return (int)(millisAfterHour / MILLIS_IN_MINUTE);
         *Sets the seconds past the minute, 0-59.
        public void setSecond(int second)
            if (second < 0 || second > 59)
                throw new ArrayIndexOutOfBoundsException(second);
            setMinute(getMinute());
            long addMillis = MILLIS_IN_SECOND * second;
            millisAfterYear = millisAfterYear + addMillis;
            setTimeInMillis(getTimeInMillis() + addMillis);
         *Returns the seconds past the minute, 0-59.
        public int getSecond()
            long millisAfterMinute = millisAfterYear % MILLIS_IN_MINUTE;
            return (int)(millisAfterMinute / MILLIS_IN_SECOND);
         *The more commonly seen set method of other date objects. Sets the date/time to 00:00 of the year/month/day passed. Convenience method
         *for setDate(int year, int month, int day, int hour, int minute, int second).
        public void setDate(int year, int month, int day)
            setDate(year, month, day, 0 , 0 , 0);
         *Sets every date/time field.
        public void setDate(int year, int month, int day, int hour, int minute, int second)
            setYear(year);
            setMonth(month);
            setDayOfMonth(day);
            setHour(hour);
            setMinute(minute);
            setSecond(second);
         *Returns yes if the stored date is a leap year. A leap year is every year that is divisible by four unless it is divisible by 100
         *unless it is also divisible by 400.
        public boolean isLeapYear()
            return isLeapYear(this.year);
         *For internal use. Returns if the passed year meets the criteria for a leap year.
        private boolean isLeapYear(int year)
            boolean leapYear = false;
            if (year % 4 == 0)
                if (year % 100 != 0)
                    leapYear = true;
                else if (year % 400 == 0)
                    leapYear = true;
            return leapYear;
         *Returns the difference in milliseconds between the time stored in this object and the millis passed to this method.
        public long getDifferenceInMillis(long millis)
            return getTimeInMillis() - millis;
         *Returns the difference in milliseconds between this date and the date passed to this method.
        public long getDifferenceInMillis(AwesomeDate otherDate)
            return getDifferenceInMillis(otherDate.getTimeInMillis());
         *Designed to be a wrapper method for the getDifferenceInMillis method. This method changes millis into years/days/whatever. Pass
         *the number of milliseconds you have to convert in the first parameter. The second parameter should be the type of denomination you
         *want (year, day, whatever). Use the MILLIS_IN_* fields associated with this object. Also bear in mind when workin with years that
         *some years are leap years, so in extreme cases of differences of 365+ years you may gain/lose a year.
        public static int toGreaterDenom(long millis, long denom)
            return (int)(millis / denom);
         * The first argument is how many of whatever (days, months, years, etc.) to add (use negative numbers to subtract). For the second
         * argument pass one of the MILLIS_IN_* fields. Thus, to add two hours would be
         * <code>
         *      AwesomeDate.adjustDate(2, AwesomeDate.MILLIS_IN_HOUR);
         * </code>
        public void adjustDate(int amount, long typeMillis)
            setTimeInMillis(this.millis + amount * typeMillis);
         *Returns an object of type java.util.Date set to the date/time stored here.
        public java.util.Date toUtilDate()
            long offset = TimeZone.getDefault().getRawOffset();
            return new java.util.Date(getTimeInMillis() +  -1 * offset);
    //        return new java.util.Date(getTimeInMillis());
         *Returns an object of type GregorianCalendar set to the date/time stored here.
        public GregorianCalendar toGregorianCalendar()
            long offset = TimeZone.getDefault().getRawOffset();
            GregorianCalendar cal = new GregorianCalendar();
            cal.setTimeInMillis(getTimeInMillis() - offset);
            return cal;
         *Returns an object of type java.sql.Date set to the date/time stored here.
        public java.sql.Date toSQLDate()
            long offset = TimeZone.getDefault().getRawOffset();
            return new java.sql.Date(getTimeInMillis() - offset);
        /** Format the date  using the string that you pass. Works just like the SimpleDateFormat object. Infact, it uses one! Heres
         *how it works:
         *Letter  Date or Time Component  Presentation  Examples  <br>
         *G  Era designator  Text  AD  <br>
         *y  Year  Year  1996; 96  <br>
         *M  Month in year  Month  July; Jul; 07<br> 
         *w  Week in year  Number  27  <br>
         *W  Week in month  Number  2  <br>
         *D  Day in year  Number  189  <br>
         *d  Day in month  Number  10  <br>
         *F  Day of week in month  Number  2<br> 
         *E  Day in week  Text  Tuesday; Tue  <br>
         *a  Am/pm marker  Text  PM  <br>
         *H  Hour in day (0-23)  Number  0<br> 
         *k  Hour in day (1-24)  Number  24  <br>
         *K  Hour in am/pm (0-11)  Number  0  <br>
         *h  Hour in am/pm (1-12)  Number  12  <br>
         *m  Minute in hour  Number  30  <br>
         *s  Second in minute  Number  55  <br>
         *S  Millisecond  Number  978  <br>
         *z  Time zone  General time zone  Pacific Standard Time; PST; GMT-08:00<br> 
         *Z  Time zone  RFC 822 time zone  -0800  <br>
        public String toFormattedString(String format)
            SimpleDateFormat formattage = new SimpleDateFormat(format);
            return formattage.format(toUtilDate());
         *I overrode the toString method. Now it tells everyone how awesome my AwesomeDate is.
        public String toString()
            String output = "John's Awesome Date!";
            output = output + " Millis: " + getTimeInMillis();
            output = output + " Year: " + getYear();
            output = output + " Month: " + getMonth();
            output = output + " Date: " + getDayOfMonth();
            output = output + " Time: ";
            if (getHour() < 10)
                output = output + "0" + getHour();
            else
                output = output + getHour();
            if (getMinute() < 10)
                output = output + "0" + getMinute();
            else
                output = output + getMinute();
            output = output + " Seconds: " + getSecond();
            return output;
        public static void main(String[] psvm)
            AwesomeDate blah = new AwesomeDate();
            GregorianCalendar blah1 = new GregorianCalendar();
            GregorianCalendar blah2 = new GregorianCalendar();
    }

    The reason Callendar is so complicated is that it is trying to solve a very complicated problem.
    You don't appear to support leap seconds (of which there can be upto 2 in any time interval)
    http://www.timeanddate.com/time/leapseconds.html
    Some of your code will not work for large dates very well (seems to iterate over the years). Try using your date class for astronomical or geological calculations. them big numbers will make your code slow at the moment.
    You don't seem to support timezones or transitory offsets (BST vs GMT). You most definately don't handle changes to timezone offsets that have occured in the past or historical daylight savings time offsets (they have not always been the same)
    The difference between two calendars is a "duration" a duration means nothing unless it is applied to a caledar/date (although you may be able to get away with it if the duration is always stored in millis)

  • Difference b/w DATA TYPE and DATA OBJECT & differences b/w TYPE and LIKE

    hai
    can any one say the differences between Data type and Data Object.
    And also differences between TYPE and LIKE
    thanks
    Gani

    hi,
    _Data Types and Data Objects_
          Programs work with local program data – that is, with byte sequences in the working memory. Byte sequences that belong together are called fields and are characterized by a length, an identity (name), and – as a further attribute – by a data type. All programming languages have a concept that describes how the contents of a field are interpreted according to the data type.
          In the ABAP type concept, fields are called data objects. Each data object is thus an instance of an abstract data type. There are separate name spaces for data objects and data types. This means that a name can be the name of a data object as well as the name of a data type simultaneously.
    Data Types
       As well as occurring as attributes of a data object, data types can also be defined independently. You can then use them later on in conjunction with a data object. The definition of a user-defined data type is based on a set of predefined elementary data types. You can define data types either locally in the declaration part of a program using the TYPESstatement) or globally in the ABAP Dictionary. You can use your own data types to declare data objects or to check the types of parameters in generic operations.
         All programming languages distinguish between various types of data with various uses, such as ….. type data for storing or displaying values and numerical data for calculations. The attributes in question are described using data types. You can define, for example, how data is stored in the repository, and how the ABAP statements work with the data.
    Data types can be divided into elementary, reference, and complex types.
    a. Elementary Types
    These are data types of fixed or variable length that are not made up of other types.
    The difference between variable length data types and fixed length data types is that the length and the memory space required by data objects of variable length data types can change dynamically during runtime, and that these data types cannot be defined irreversibly while the data object is being declared.
    Predefined and User-Defined Elementary Data Types
    You can also define your own elementary data types in ABAP using the TYPES statement. You base these on the predefined data types. This determines all of the technical attributes of the new data type. For example, you could define a data type P_2 with two decimal places, based on the predefined data type P. You could then use this new type in your data declarations.
    b.  Reference Types
    Reference types are deep data types that describe reference variables, that is, data objects that contain references. A reference variable can be defined as a component of a complex data object such as a structure or internal table as well as a single field.
    c. Complex Data Types
    Complex data types are made up of other data types. A distinction is made here between structured types and table types.
    Data Objects
          Data objects are the physical units with which ABAP statements work at runtime. The contents of a data object occupy memory space in the program. ABAP statements access these contents by addressing the name of the data object and interpret them according to the data type.. For example, statements can write the contents of data objects in lists or in the database, they can pass them to and receive them from routines, they can change them by assigning new values, and they can compare them in logical expressions.
           Each ABAP data object has a set of technical attributes, which are fully defined at all times when an ABAP program is running (field length, number of decimal places, and data type). You declare data objects either statically in the declaration part of an ABAP program (the most important statement for this is DATA), or dynamically at runtime (for example, when you call procedures). As well as fields in the memory area of the program, the program also treats literals like data objects.
            A data object is a part of the repository whose content can be addressed and interpreted by the program. All data objects must be declared in the ABAP program and are not persistent, meaning that they only exist while the program is being executed. Before you can process persistent data (such as data from a database table or from a sequential file), you must read it into data objects first. Conversely, if you want to retain the contents of a data object beyond the end of the program, you must save it in a persistent form.
    Declaring Data Objects
          Apart from the interface parameters of procedures, you declare all of the data objects in an ABAP program or procedure in its declaration part. These declarative statements establish the data type of the object, along with any missing technical attributes. This takes place before the program is actually executed. The technical attributes can then be queried while the program is running.
         The interface parameters of procedures are generated as local data objects, but only when the procedure is actually called. You can define the technical attributes of the interface parameters in the procedure itself. If you do not, they adopt the attributes of the parameters from which they receive their values.
    ABAP contains the following kinds of data objects:
    a.  Literals
    Literals are not created by declarative statements. Instead, they exist in the program source code. Like all data objects, they have fixed technical attributes (field length, number of decimal places, data type), but no name. They are therefore referred to as unnamed data objects.
    b.  Named Data Objects
    Data objects that have a name that you can use to address the ABAP program are known as named objects. These can be objects of various types, including text symbols, variables and constants.
    Text symbols are pointers to texts in the text pool of the ABAP program. When the program starts, the corresponding data objects are generated from the texts stored in the text pool. They can be addressed using the name of the text symbol.
    Variables are data objects whose contents can be changed using ABAP statements. You declare variables using the DATA, CLASS-DATA, STATICS, PARAMETERS, SELECT-OPTIONS, and RANGESstatements.
    Constants are data objects whose contents cannot be changed. You declare constants using the CONSTANTSstatement.
    c.  Anonymous Data  Objects
    Data objects that cannot be addressed using a name are known as anonymous data objects. They are created using the CREATE DATAstatement and can be addressed using reference variables.
    d.  System-Defined Data Objects
    System-defined data objects do not have to be declared explicitly - they are always available at runtime.
    e.  Interface Work Areas
    Interface work areas are special variables that serve as interfaces between programs, screens, and logical databases. You declare interface work areas using the TABLES and NODESstatements.
    What is the difference between Type and Like?
    Answer1:
    TYPE, you assign datatype directly to the data object while declaring.
    LIKE,you assign the datatype of another object to the declaring data object. The datatype is referenced indirectly.
    Answer2:
    Type is a keyword used to refer to a data type whereas Like is a keyword used to copy the existing properties of already existing data object.
    Answer3:
    type refers the existing data type
    like refers the existing data object
    reward if useful
    thanks and regards
    suma sailaja pvn

Maybe you are looking for