Calendar and Date objects

I've got an application that has many Date objects. We frequently have to do comparisons to see if two Date objects represent the same day. I know that I can use a SiimpleDateFormatter to make a String from a Date. I can compare two of these Strings and determine if they are on the same day.
I also know that I can make two new Date objects from the milliseconds in a pair of Date objects, and set the hour, minute, seconds and milliseconds to zeros. Then, the compareTo method to see if the two days match. But, both of these seem like a huge overhead when I have to do it a lot. (Although the objects are called Date, the compareTo matches the milliseconds version, and so two Date objects from the same day do not match unless they match to the millisecond. Not what I want.)
Have I overlooked something that returns a nice int or long "Julian day number" field that is quick?
If I can assure myself that all of the dates were built with a common TimeZone, could I divide by the milliseconds in a day to get a nice day number?

Maybe an example would clear things up.
This is a large scheduling application, with a very complex GUI.
We find out from a database that an activity runs from December 28, 2008 at 10:31AM to January 2, 2009 at 11:45AM.
The first question after we have converted each date/time pair to a Date object is: "On how many days does this activity take place?" In this case it is 6 days Dec 28, Dec 29, Dec 30, Dec 31, Jan 1, and Jan2. This will be displayed in a JTable with 6 columns. The ideal (at least to me) solution would be to get a day number as described above for the start and end, and know that (end_day - start_day + 1) columns are required, and we can write a for loop to go from the start day to the end day. If we use a semi-day value of the (year*1000 +DAY_OF_YEAR) we have a unique number, but it is useless for determining how many columns are needed in a table. The comparison between 2008363 and 2009002 does not produce a usable result.
But, there are related operations as part of a more significant activity. We usually have to decide how many days (columns) does it take to display a group of activities. At this level, we don't care what time of days are involved.
This application is on the desktop of multiple schedulers who will move activities around all day long. We need to be as efficient as possible, since some of the other things are very compute intensive.
In parts of the application we are very much concerned about time of day, (for example, the custom table cell renderer paints a stripe across the cell of each table cell with a length proportional to the time of day start and end) but in other parts, the day is the main concern.
I was bothered by the number of Date to Calendar to String conversions being done, and knowing that Date-to-Calendar is not simple due to time zone issues. I also know that Calendar-to-String conversions are not simple since the SimpleDateFormatter has to dynamically interpret a formatting string.
It looks like I'm just stuck with the way it is, unless the alternative date/time implementation is used. That looks a bit promising.

Similar Messages

  • 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

  • Reg Differrences between SynBo and Data Object

    Hi,
            I want to know the architectural diffrences between a SyncBo of MI 2.5 and Data Object of NWM 7.1.  As it is given in help.sap.com documentation I think A data object support multiple levels of parent- child hirearchy where as a SyncBo is limited to one level of Header and Items.Similarly do any other differences exist?
    2) In what way A data Object concept is better than that of a Synco.?
    3) For manipulating the data of a data Object on Front end, Can we Use the existing SmartSync API of MI 2.5, or a seperate API for client side is going to be released?
    Thanks in Advance,
    Rajesh

    Hello Rajesh,
    1. The differences are small. You pretty much highlighted the biggest one (multi child node). Other differences exist in the fact that a SyncBO is linked to a backend BAPI as the DO is not (you would usually create the DO with the fields you need and then have backend adapters to fill it). Lifecycle of the DO is also different. Even release, non destructive change can happen and old application as well as new application will work at the same time. I can list a couple more, but I think you get that a SyncBO is different than a DO (even if in our development we still get mix both wording:))
    2. Yes DO is a better concept than SyncBO.
    3. There are 3 ways of accessing API on the client side. The first is the old SmartSync API which is only used in backward compatibility application (MAM for example). It should not be used for new development, but only to leverage existing one. After that you have two new frameworks for laptop and for PDA that you can find in NWDS 7.1. They reviewed the naming so I am not sure of the current ones, but I think it is something like Mobile Application for Handheld and Mobile Application for Laptop. Those two new framework uses WebDynPro flavored UI and provide access to the sync/data layer.
    Thank you,
    Julien.

  • Prepare templates of the existing reports and data objects.

    Hi,
    I'm trying to create templates of the reports and dataobjects created in oracle BAM. I've created some reports on a server and i need the same reports with same dataobjects on other servers. Is there any method to create the template of existing reports and data objects.
    Thanks,
    Rajdeep

    Hi
    You will have to export the Data Objects and Repots and import in the other environments using icommand.
    TO preserve the report id's you can use option preserveid
    and also supposeyou have 1 report which internally calls three other reports you can export the main report using dependencies option with icommand export use dependencies 1 and this will export all ur sub reports with main report..
    If u need more help on icommand check this doc
    http://www.oracle.com/technology/products/integration/bam/10.1.3/TechNotes/TechNote_BAM_Migration.pdf

  • Data types and Data object

    Can Any one give me Clear definition of Data type and Data objects.
    Concept i know clearly.. but unable to explain it..
    Regards,
    Prasanna

    Data consists of strings of bytes in the memory area of the program. A string of related bytes is called a field. Each field has an identity (a name) and 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 an instance of an abstract data type. Data types in ABAP are not just attributes of fields, but can be defined in their own right. There are separate name spaces for data objects and data types. This means that a name can at the same time be the name of a data   object as well as the name of a data type.
    <b>Data Types:</b>
                     As well as occurring as attributes of a data object, data types can also be defined independently. 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 TYPES statement) 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.
             Data types can be divided into elementary, reference, and complex types
    <b>Data objects:</b>
                      Data objects are the physical units with which ABAP statements work at runtime. Each ABAP data object has a set of technical attributes, which are fully defined at all times when an ABAP program is running. The technical attributes of a data object are its length, number of decimal places, and data type. ABAP statements work with the contents of data objects and interpret them according to their 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.
    ABAP contains the following kinds of data objects
      Literals
       Named Data Objects
      Predefined Data Objects
      Dynamic Data Objects

  • Data type and Data object

    Hi Friends,
            What is the difference between Data type and Data object?
    Best Regards,
    VRV Singh

    hi
    good
    Each ABAP program define its own data types using the statement.
    TYPES dtype TYPE type ...
    and declare its own variables or instance attributes of classes using the statement
    DATA var {TYPE type} ...
    Within the program or a class, you can also define local data types and variables within procedures. Local variables in procedures obscure identically-named variables in the main program or class.
    When creating data types and data objects, there are a number of naming convention that also apply for other local program definitions, such as procedures. These are described in detail in the keyword documentation.
    The Additions TYPE and LIKE
    The additions TYPE type and LIKE dobj are used in various ABAP statements. The additions can have various meanings, depending on the syntax and context.
    ·        Definition of local types in a program
    ·        Declaration of data objects
    ·        Dynamic creation of data objects
    ·        Specification of the type of formal parameters in subroutines
    ·        Specification of the type of formal parameters in methods
    ·        Specification of the type of field symbols
    Constructing New Data Types
    The TYPE addition allows you to construct new data types in the TYPES, DATA; CONSTANTS; and STATICSstatements. In the TYPES statement, these are local data types in the program. In the other statements, they are attributes of new data objects, meaning that the newly defined data types are not free-standing. Rather, they are linked to database objects.This means that you can refer to them using the LIKEaddition, but not using TYPE.
    To construct new data types, the addition TYPE can be used with the following type constructors:
    ·        Construction of reference types
    REF TO type|dobj
    ·        Construction of structured data types
    BEGIN OF struc_type.
    END OF struc_type.
    ·        Construction of table types
    tabkind OF linetype
    These data types only exist during the runtime of the ABAP program.
    Referring to Known Data Types or Data Objects
    Using the additions TYPE or LIKE in the TYPESstatement, local data types in a program can be referred to known data types or data objects. This is mainly the case with user-defined elementary data types. If you declare variables using the additions TYPE type or LIKE dobj with statement DATA, the data type of var is already fully defined before the declaration is made.
    The known types or data that are referred to must be visible at the point where the data type or variable is declared.
    A known data type can be any of the following:
    ·        A predefined ABAP type to which you refer using the TYPE addition
    ·        An existing local data type in the program to which you refer using the TYPE addition
    ·        The data type of a local data object in the program to which you refer using the LIKE addition
    ·        A data type in the ABAP Dictionary to which you refer using the TYPE addition. To ensure compatibility with earlier releases, it is still possible to use the LIKE addition to refer to database tables and flat structures in the ABAP Dictionary. However, you should use the TYPE addition in new programs.
    The LIKE addition takes its technical attributes from a visible data object. As a rule, you can use LIKE to refer to any object that has been declared using DATA or a similar statement, and is visible in the current context.  The data object only has to have been declared. It is irrelevant whether the data object already exists in memory when you make the LIKE reference.
    ·        In principle, the local data objects in the same program are visible. As with local data types, there is a difference between local data objects in procedures and global data objects. Data objects defined in a procedure obscure other objects with the same name that are declared in the global declarations of the program.
    ·        You can also refer to the data objects of other visible ABAP programs. These might be, for example, the visible attributes of global classes in class pools. If a global class cl_lobal has a public instance attribute or static attribute attr, you can refer to it as follows in any ABAP program:
    DATA dref TYPE REF TO cl_global.
    DATA:  f1 LIKE cl_global=>attr,
           f2 LIKE dref->attr.
    You can access the technical properties of an instance attribute using the class name and a reference variable without first having to create an object. The properties of the attributes of a class are not instance-specific and belong to the static properties of the class.
    http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb2ff3358411d1829f0000e829fbfe/content.htm
    thanks
    mrutyun^

  • Data types and data objects

    diff b/w data types and data objects

    hi prasanth,
    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
    Data types are templates for creating data objects. Data types can be defined independently in the ABAP program or in the ABAP Dictionary. As attributes of a data object, data types can also exist in a non-independent state. Data types do not use any memory space for work data, but may require memory for administration information.
    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
    A data object is an instance of a data type and occupies as much memory space as its type specifies. An ABAP program only works with data that is available as content of data objects. Data objects are either created implicitly as named data objects, or exanonymous data objects using CREATEDATA.
    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.
    regards,
    sravanthi

  • Deployment question for EMS and Data Objects

    I have configured tens of EMS and data objects. It's deployment time to a new environment, say Dev to Test. Do i have to manually create all this data objects and EMS in each environment, or is it possible to write a script or deployment script to do it automatically for each environment. If not, it will be a headache configuring all these DO and EMS again for eah environment. Please suggest.
    Thanks

    See this guide: http://download.oracle.com/docs/cd/E15523_01/core.1111/e10105/testprod.htm#CHDDIEBI
    Specifically on the usage of icommand in section 20.4.2

  • My Question On Calendar and Date

    Hi, I am making a query to a table: T_HR_CONTRACT,
    which stores the labor contract of a company.
    END_DATE is a field of table T_HR_CONTRACT. Its type is date.
    Now, I need to search the contract end in each month.
    select * from T_HR_CONTRACT where fEND_DATE >= theStartDayOfCurrenctMonth and fEND_DATE < theStartDayOfNextMonth;
    or
    select * from T_HR_CONTRACT where fEND_DATE >= theStartDayOfCurrenctMonth and fEND_DATE <= theLastDayOfCurrenctMonth;
    How can I utilize the java class Calendar or Date to get
    the first day of current month,
    the last day of current month,
    the first day of next month?
    I am new to Calendar and Date class. Please give me some help!

    Ok, I have solve the problem as following:
    //get the first day of this month, by using StringBuffer, we can enhance
    //the effiency
    StringBuffer today = new StringBuffer();
    Calendar rightNow = Calendar.getInstance();
    today.append(rightNow.get(rightNow.YEAR));
    today.append("-");
    today.append((rightNow.get(rightNow.MONTH) + 1));
    today.append("-01");
    String todayDate = today.toString();
    //get the first day of next month
    StringBuffer next = new StringBuffer();
    //if the month is December, then get the first day of next year!
    if(rightNow.get(rightNow.MONTH) == 11)
    next.append(rightNow.get(rightNow.YEAR) + 1);
    next.append("-01-01");
    else
    next.append(rightNow.get(rightNow.YEAR));
    next.append("-");
    next.append(rightNow.get(rightNow.MONTH) + 2);
    next.append("-01");
    String nextDate = next.toString();

  • Differences between DATA TYPE and DATA OBJECTS

    I am new to ABAP,I want to know the differences between DATA TYPE and DATA OBJECTS with some examples.
    please help me regarding this.

    Hi Ashish,
    Data Types:       Are pure descriptions.
                   No memory is associated with data types.
                   Describes the technical properties of data objects.
    EX.
    1.     C-CHARACTER
    2.     D-DATE
    3.     F-FLOAT
    4.     I-INTEGER
    5.     N-NUMERIC TEXT
    6.     T-TIME
    7.     P-PACKED NUMBER
    8.     X-HEXADECIMAL
    9.     STRING-Variable length string.
    10.     XSTRING-Variable length byte string.
    Data Objects: Are created during runtime.
                    They cannot exist without the data Types.
                    Occupies memory space.
    EX:
    1.     INTERNAL DATA OBJECT- Internal Data objects
         LITEERAL- A literal has a fixed value.Ex: WRITE:u201DWORK HARDu201D.
         VARIABLES: Data statement is used to create variables.
    EX.DATA: NUM TYPE I.
    NUM: VARIABLE defined by data statement.
    EX: DATA: PRICE LIKE NUM.
         CONSTANT-It is a data object, which contains a constant value throughout the program.
    Can be declared in program by using CONSTANT statement.
    EX:CONSTANT: INT TYPE I VALUE 15.
    2.     EXTERNAL DATA OBJECT: Are defined in tables i.e In ABAP/4 dictionary you can access this data from table.
             EX: TABLES: SFLIGHT
              DATA: SEATS LIKE SFLIGHT-SEATSMAX.
    3.     SYSTEM DEFINED DATA OBJECTS:Space & system variables like SY-UNAME,SY-DATUM, SY-REPID.
    4.     SPECIAL DATA  OBJECTS:
         PARAMETERS: Are Variables ,which can accept value from user.
          SELECTION SCREEN : Are special internal tables to accept value ranges from user.
    3 APPROACHES TO DEFINE DATA OBJECTS.
    1.     ELEMENTARY TYPES
    DATA: Customer _Name (25) TYPE C,
                   Vendor_Name (25) TYPE C.
    2.     REFRENCE TO AN EXISTING FIELD:
    DATA: Customer _Name2 (25) TYPE C,
                  Vendor_Name2 (25) LIKE Customer_Name2
    3.     REFRENCE TO NON-ELEMENTARY TYPE:
    TYPES: T_NAME (25) TYPE C
    DATA: CUSTOMER_NAME TYPE T_NAME
                   VENDOR_NAME  TYPE T_NAME
    4.     RECORD-Information in rows & columns.
    DATA: BEGIN OF BOOKING,
                                    ID (4) TYPE C,
                                    FLIGHT_DATE TYPE D,
                                    NAME LIKE CUSTOMER_NAME,
                                    END OF BOOKING.
    You can also look into SAP help for more information.
    Regards,
    Indu.

  • Difference Between Data Type and Data Object

    Difference Between Data Type and Data Object

    hi magesh
    <u><b>Data types</b></u> can be divided into
    elementary,
    reference, and
    complex types.
    <u><b>Elementary Types</b></u>
    Elementary types are the smallest indivisible unit of types. They can be grouped as those with fixed length and those with variable length.
    <u><b>Fixed-Length Elementary Types</b></u>
    There are eight predefined types in ABAP with fixed length:
    <u><b>Four character types:</b></u>
    Character (C),
    Numeric character (N),
    Date (D),
    and Time (T).
    <b>One hexadecimal type:</b>
    Byte field (X).
    <b>Three numeric types:</b>
    Integer (I),
    Floating-point number (F)
    and Packed number (P).
    <u><b>Variable-Length Elementary Types</b></u>
    There are two predefined types in ABAP with variable length:
    STRING for character strings
    XSTRING for byte strings
    Reference Types
    <b>Reference types</b>
    describe data objects that contain references (pointers) to other objects (data objects and objects in ABAP Objects).
    <u><b>Data Types</b></u>
    1) As well as occurring as attributes of a data object, data types can also be defined independently.
    2)You can then use them later on in conjunction with a data object.
    3) The definition of a user-defined data type is based on a <b>set of predefined elementary data types.</b>
    4) You can define data types <b>either locally in the declaration part of a program</b> using the TYPESstatement) or <b>globally in the ABAP</b> Dictionary.
    5) You can use your own data types to declare data objects or to check the types of parameters in generic operations.
    <u><b>Data Objects</b></u>
    1)<b>Data objects</b> are the physical units with which ABAP statements work at runtime.
    2) The contents of a data object occupy memory space in the program.
    3) <b>ABAP statements access these contents by addressing the name of the data object</b> and interpret them according to the data type..
    4) 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.
    5) Each <b>ABAP data object has a set of technical attributes</b>, which are fully defined at all times when an ABAP program is running (field length, number of decimal places, and data type).
    6) You <b>declare data objects</b> either <b>statically in the declaration part</b> of an ABAP program (the most important statement for this is DATA), or <b>dynamically at runtime</b> (for example, when you call procedures).
    7) As well as fields in the memory area of the program, the program also treats literals like data objects.
    hope this helps u,
    reward points if useful
    Ginni

  • Popup Calendar and date fields

    I have two date fields on a form with one field having a "MM/DD/YYYY HH:MI" date format and the other having a "MM/DD/YYYY" date format. The calendar that pops up for the field with a timestamp requires the user to choose the time, a date, then click on the OK button. The other calendar will automatically choose the date and close the calendar when the user clicks on a date. Is there any way I can get the calendar with the timestamp to have the same functionality as the "regular date" calendar? In other words, can the popup calendar automatically close when the user chooses a date when the time is shown on the calendar?
    Thanks in advance,
    Dan

    DTP,
    I don't know if you'd be interested in trying something completely new but with jQuery you could use a completely serverside solution by combining jQuery with uidatepicker and clockpick...
    Check these out:
    http://marcgrabanski.com/code/ui-datepicker/
    http://www.oakcitygraphics.com/jquery/clockpick/trunk/ClockPick.cfm
    Getting started with jQuery can be a little confusing at first. But if you stick with it there are many benefits!
    Regards
    Dan

  • My question On Calendar or Data

    Hi, I am making a query to a table: T_HR_CONTRACT,
    which stores the labor contract of a company.
    END_DATE is a field of table T_HR_CONTRACT.
    Now, I need to search the contract end in each month.
    select * from T_HR_CONTRACT where fEND_DATE >= theStartDayOfCurrenctMonth and fEND_DATE < theStartDayOfNextMonth;
    or
    select * from T_HR_CONTRACT where fEND_DATE >= theStartDayOfCurrenctMonth and fEND_DATE <= theLastDayOfCurrenctMonth;
    How can I utilize the java class Calendar or Date to get
    the first day of current month,
    the last day of current month,
    the first day of next month?
    I am new to Calendar and Date class. Please give me some help!
    Thank you!

    GregorianCalendar c = new GregorianCalendar();
    // That gets a Calendar object containing the current date and time.
    c.set(Calendar.DAY_OF_MONTH, 1);
    // As you might guess that sets the Calendar's day to be the first of the month.
    c.set(Calendar.DAY_OF_MONTH, c.getActualMaximum(Calendar.DAY_OF_MONTH));
    // That sets the Calendar's day to be the first of the month.
    c.add(Calendar.DAY_OF_MONTH, 1);
    // That adds 1 to the day... what does that give you?You could have learned a lot of this by reading the examples given in the API documentation for Calendar and GregorianCalendar. Try it next time, you may find it faster than waiting for some random person to answer your question.

  • DAO and Domain Object

    hi,
    Normally when i want to persist a domain object like Customer object to a database, my statements will be below,
    // code from my facade
    Customer cust = new Customer();
    cust.setFirstName("myname");
    cust.setLastName("mylastname");
    // set another attributes
    cust.create();
    with this code i have a CustomerPersistence object to handler for create this customer record to a database. Now j2ee have a DAO pattern. So my question is,
    1.where is a domain object within DAO pattern? --> because of we can reused domain object.
    2.DTO is Domain Object, isn't it?
    3.when i look at some articles about DAO, many of it will present in this way
    facade -->create DTO --> call DAO (plus something about factory pattern)
    i never see something like this
    facade --> domain object --> dao
    any suggestion?
    anurakth
    sorry for my english!!

    Hi,
    I am a bit confused about implementation of the domain model and I wondered if you could help. My main concern is that I am introducing too many layers and data holders into the mix. Here is what I am thinking.
    DTO - used to carry data between the presentation and the services layer
    Service Class - coordinates the calling of domain objects
    Domain Object - models a domain entity, service layer logic specific to this object is to be implemented here.
    Data Object - an exact representation of a database table. many to many relationship between domain object and data object.
    Hibernate DAO Class - has no properties, just methods used for read and writing the object to the database. It is passed in the Data Object for persistence. Is it wrong that the DAO contains no properties?
    Perhaps the domain object will contain each data object it is comprised of. I was originally going to keep calls to DAOs in the Services class (as recommended in http://jroller.com/page/egervari/20050109#how_to_change_services_logic ) but I am thinking that each domain object could expose a save method, and that method would co-ordinate persisting itself to the various tables it is derived from.
    Does this sound resonable? I have trouble finding a pattern on the net that clealy defines the Domain Model. I was tempted to map Domain Objects directly to database tables, and simply persist the Domain Object, but this 1-1 relationship may not always hold true.
    Thanks.

  • First and last day of current year as a date object

    Howdy...
    can someone please help me out... i need a fast way to get the first day of the current year as a date object and the last day of the current year as a date object...
    big thanks for any sample code...

    import java.util.Calendar;
    // snip
    Calendar firstDayOfYear = Calendar.getInstance(); // will initialize it with today
    firstDayOfYear.set(Calendar.DAY_OF_MONTH, 1);
    firstDayOfYear.set(Calendar.MONTH, Calendar.JANUARY);
    Calendar lastDayOfYear = Calendar.getInstance(); // will initialize it with today
    lastDayOfYear.set(Calendar.DAY_OF_MONTH, 31);
    lastDayOfYear.set(Calendar.MONTH, Calendar.DECEMBER);Rommie.

Maybe you are looking for

  • For the average person what really is the point of the activity monitor app when all you really want to know is whether your mac is running at its best?

    I have had my imac for nearly 18 months now, It's okay, is the best I can say about it. It cost me around £800+ So recently (and foolishly!) I downloaded OS Mavericks when I was actually looking for a freebie word processor programme (I got Bean beca

  • HDD died, need a new one - Satellite A35-S209

    I have a a35 s209 satellite (2.80GHz, 2048MB of ram) and my HD just died and took with it 4 months of my life. there is nothing like listening to the wonderous billy Holyday one sec and the next listening to the grinding suicide of an HD full of work

  • Java.lang.NumberFormatException

    2010-07-02 12:58:35     Error     Could not execute statement for table/stored proc. "sp_PalletBackflushAcknowledge" (structure "Acknowledge") due to java.lang.NumberFormatException: For input string: "393006000111122222" 2010-07-02 12:58:35     Erro

  • WiFi Doesnt Work

    Hi, I've had my iPod Touch for over a year now. It's a 1st generation and my wifi used to work but now it just stopped. Sometimes it will just gray out and say No WiFi even though I'm using it here so i dont understand that. Sometimes the wifi will s

  • Generate Purchase Order with Adobe Forms.

    Hello SAPients! Can someone give me a general idea of the steps that I have to follow to generate the Purchase Order as an Adobe Form? Thanks!