Time part of date data type

Please can anybody tell me how to display the time portion of a
date data type. The version of Oracle is 7.
Ade

is this?
TO_CHAR( date, [ fmt VARCHAR2[, nlsparms]])
return VARCHAR2
fmt format model:
YYYY year
MM month 01 =JAN
DD Day of the month (1-31)
D Day of the week (1-7)
HH24 hour fo day (0-24)
HH, HH12 hour of day (0-12)
MI minute (0-59)
AM, PM
SS second (0-59)
SSSSS seconds past midnight (0-863999)
etc....
nlsparams specifies he language
is has the following form:
'NLS_DATE_LANGUAGE = <language>'

Similar Messages

  • Viewing and Removing the Time part of the Date field

    Hi,
    I have Date field in a table.
    but in SQL plus when I do
    select date from table
    this gives me only the Date values and not the timestamps in the date.
    I believe Oracle stores 'Date' and 'Time' in fields with Data Type 'Date'.
    How do I print the timestamps also in the SQL query?
    Moreover, if I have to extract the date field, reset the timestamp to 00:00:00, and store back the date field (with 00 time), how do I do that?
    Thanks in advance
    - Manu

    Hi,
    If you want to retry date and time you can:
    SELECT TO_CHAR(DATE,'YYYY/MM/DD HH24:MI:SS') FROM TABLE;
    If you want truncate time when inserting in a table simply use TRUNC function
    INSERT INTO TABLE (DATE) VALUES (TRUNC(YOUR_DATE));
    To extract and insert with time 00:00:00
    INSERT INTO TABLE1 (SELECT TRUNC(DATE) FROM TABLE2);
    I hope this help you.

  • Toplink resets the time part of the date

    Hi,
    Using Toplink (DirectToFieldMapping with java.util.Date), while retrieving date information from the DB, the time values are zeroed out (Eg: Fri May 16 00:00:00 IST 2008).
    This is happening only when using JDBC thin drivers whereas OCI drivers retrieve the time values properly (Fri May 16 12:30:08 IST 2008).
    I tried various versions of ojdbc14.jar and found no difference.
    Any help would be appreciated.
    Thanks for your time..

    Timestamp insert problem
    V8CompatibleFlag did the trick

  • This can't be right - can't display time part of a DATE field.

    Hi all,
    I have a table with one DATE field. It wasn't displaying times with the date,
    so I searched and found a post telling how to change my NLS settings
    in the Preferences.
    I did this and it didn't change, so I thought, OK, I'll shut it down and restart.
    Still no. So, I shut it down again, deleted all the records form my table, reinserted
    them and then restarted SQLDeveloper.
    Despite the fact that it has retained the change in NLS settings, it STILL*
    doesn't display the time.
    There is no problem in SQL*Plus. Quite frankly, this is poor.
    Paul...

    >
    Would there by anything else - I'm planning on rebooting the machine this afternoon - maybe
    that'll do the trick? Will report back.Now, this is still wierd! Have rebooted machine.
    I have two tables Sysstat_ext and Sysstat - both have fields M_Time (Measurement time),
    which is VARCHAR2(15) in Sysstat_ext and DATE in Sysstat.
    Sysstat_ext is an external table pointing at a .csv file where the dates are strings (obviously) in
    the format DD-MM HH24:MM:SI (i.e. 01-09 13:55:02).
    I then insert the data from Sysstat_ext into Sysstat - the conversion being performed thus:
    INSERT INTO Sysstat
    SELECT ROUND(TO_DATE  (Sysstat_ext.M_Time, 'DD-MM HH24:MI:SS'), 'MI') AS "Measurement Time",
    <.. other fields deleted>If from SQL*Plus, I select M_Time from Sysstat
    SQL> select M_Time from Sysstat;
    M_TIME
    2011 09 01 00:00:00
    2011 09 01 03:20:00perfect
    same for Sysstat_ext
    SQL> select M_Time from Sysstat_ext;
    M_TIME
    01-09 13:55:02
    01-09 14:00:01No year - the conversion during the insert obviously implicitly gives this year (good job that's what I actually want!).
    I look at the dates in SQLDeveloper
    Systat_ext: 01-09 13:55:02 <====== exactly what I'd expect
    Systat: 01-SEP-11 <====== where has my time gone?
    Anyone care to shed some light on this?
    So, I redid the whole procedure removing the ROUND and also the AS "Measurement Time" (in case of artefacts)
    INSERT INTO Sysstat
    SELECT TO_DATE (Sysstat_ext.M_Time, 'DD-MM HH24:MI:SS'),
    <... deleted...>
    Still the same result - Sysstat_ext shows the time and Sysstat doesn't. I would have expected the
    opposite. SQL*Plus still shows a time with Sysstat.
    This is definitely a bug IMHO. Can I report it anywhere? As an aside, I originally thought that 3rd party tool
    manufacturers such as Quest and Allroundautomations would be quaking in their boots with a
    tool like SQLDeveloper (for free*) coming from the manufacturer of Oracle itself - I see now that
    at the moment, they have little to worry about.
    Paul...

  • LIKE Operator to ignore the time part of DATE type?

    Hi,
    is it allowed to use the LIKE operator on DATE Type to ignore the time-part in the DATE?
    Nothing found in the manual, but seems to me that it works.
    1. SELECT * FROM test_date WHERE tst_date LIKE to_date('01.01.2003 13:33:33','DD.MM.YYYY HH24:MI:SS') ;
    2. SELECT * FROM test_date WHERE tst_date LIKE to_date('01.01.2003','DD.MM.YYYY') ;
    3. SELECT * FROM test_date WHERE tst_date LIKE trunc(to_date('01.01.2003 00:00:00','DD.MM.YYYY HH24:MI:SS'));
    4. SELECT * FROM test_date WHERE to_date('01.01.2003 13:33:33','DD.MM.YYYY HH24:MI:SS') LIKE tst_date;
    5. SELECT * FROM test_date WHERE tst_date BETWEEN to_date('01.01.2003 00:00:00','DD.MM.YYYY HH24:MI:SS') AND to_date('01.01.2003 23:23:59','DD.MM.YYYY HH24:MI:SS');
    6. SELECT * FROM test_date WHERE tst_date >= TO_DATE('01.01.2003 00:00:00','DD.MM.YYYY HH24:MI:SS') AND tst_date < TO_DATE('01.01.2003')+1;
    7. SELECT * FROM test_date WHERE TRUNC(tst_date) = TRUNC(TO_DATE('01.01.2003 00:00:00','DD.MM.YYYY HH24:MI:SS'));
    Result for 1-7 is the same.
    What is the preferred Solution?
    Solution 5 is bad, because index on TST_DATE column could not be used.
    Solution 1 - 3 is the same using the LIKE operator.
    Any comments?
    Thanks, Markus
    GEMS IT

    Oh, sorry, LIKE-Operator solutions do also not use an Index :-(. Only 5. and 6.
    Sample-Script:
    CREATE TABLE TEST_DATE
    TST_DATE DATE
    CREATE INDEX MEDVIEW.TEST_DATE_IDX
    ON MEDVIEW.TEST_DATE(TST_DATE);
    INSERT INTO TEST_DATE ( TST_DATE ) VALUES (
    TO_Date( '01/01/2003 12:00:00 AM', 'MM/DD/YYYY HH:MI:SS AM'));
    INSERT INTO TEST_DATE ( TST_DATE ) VALUES (
    TO_Date( '01/01/2003 12:45:13 PM', 'MM/DD/YYYY HH:MI:SS AM'));
    INSERT INTO TEST_DATE ( TST_DATE ) VALUES (
    TO_Date( '01/01/2003 08:11:55 AM', 'MM/DD/YYYY HH:MI:SS AM'));
    INSERT INTO TEST_DATE ( TST_DATE ) VALUES (
    TO_Date( '01/01/2003 12:00:00 AM', 'MM/DD/YYYY HH:MI:SS AM'));
    INSERT INTO TEST_DATE ( TST_DATE ) VALUES (
    TO_Date( '01/01/2003 09:33:16 AM', 'MM/DD/YYYY HH:MI:SS AM'));
    INSERT INTO TEST_DATE ( TST_DATE ) VALUES (
    TO_Date( '01/02/2003 07:45:00 AM', 'MM/DD/YYYY HH:MI:SS AM'));
    INSERT INTO TEST_DATE ( TST_DATE ) VALUES (
    TO_Date( '01/02/2003 07:33:00 PM', 'MM/DD/YYYY HH:MI:SS AM'));
    COMMIT;

  • JSTL sql:query date field has zero time part

    I have a little JSP where I am using JSTL to do a query against a table "ph_application" that has a date field "rundate". This field has many different dates and times in it.
    Here is the code snippet:
    <sql:setDataSource url="jdbc:oracle:thin:@oraprd02:1521:ipp4" user="site" password="pmc_site"/>
    <sql:query var="application" sql="select * from ph_application"/>
    <c:forEach items="${application.rows}" var="row">
    <tr>
    <td><c:out value="${row.name}" default=" " escapeXml="false"/></td>
    <td><fmt:formatDate value="${row.rundate}" type="both"/></td>
    </tr>
    </c:forEach>
    The resulting date/time output always has a 12:00:00 AM time regardless of what is actually in the table. I have changed the fmt:formatDate to a c:out of the row.rundate.time value and it appears that the time part of the date is actually zero at this point.
    Is there an inconsistancy between the oracle date type and what JSTL is expecting (somewhere)?
    Any help and/or verification is appreciated.
    Richard

    I'm running this from within JDeveloper 10g.

  • Adding one day to a oracle.jbo.domain.Date and truncating the time part

    JDev 11.1.1.4.0
    Hello
    I need to add a day to oracle.jbo.domain.Date and get back a oracle.jbo.domain.Date without the time part.
    So far I've got
    Date valueDate = (Date)rowCpt.getAttribute("ValueDate");                                       
    Calendar cal = Calendar.getInstance();
    cal.setTime(new java.util.Date(valueDate.timestampValue().getTime()));
    cal.add(Calendar.DATE, 1);
    Date newDate = new oracle.jbo.domain.Date(new Timestamp(cal.getTime().getTime()));This adds 1 day to the date but keeps the time part of the date.
    How do I get rid of the time part of the date ?
    Thanks
    Paul

    The Calendar class allows you to set or clear each field.
    Date valueDate = (Date)rowCpt.getAttribute("ValueDate");                                       
    Calendar cal = Calendar.getInstance();
    cal.setTime(new java.util.Date(valueDate.timestampValue().getTime()));
    cal.add(Calendar.DATE, 1);
    cal.clear(Calendar.HOUR);
    cal.clear(Calendar.MINUTE);
    cal.clear(Calendar.SECOND);
    cal.clear(Calendar.MILLISECOND);
    Date newDate = new oracle.jbo.domain.Date(cal.getTimeInMillis());should work.
    Timo

  • SQL Developer is not exporting the time part of date data types.

    I need to export data from a table using sql developer. The column is a date data type but when I export the data to a csv, xls or an sql file with insert statements, sql developer only includes the date part without the time.
    Please kindly advise.
    Thanks,
    Erika

    What is your 4 digits Oracle version ?
    What is your SQL Developer version ?
    With Oracle XE and a schema named TEST I have:
    select * from t
    X                        
    04-FÉVR.-2010 21:24:40  If I use Tools/Database Export with all default settings with SQL Developer 2.1.0.63 I get following SQL file:
    --  Fichier créé - jeudi-février-04-2010  
    --  DDL for Table T
      CREATE TABLE "T"
       (     "X" DATE
    --   DATA FOR TABLE T
    --   FILTER = none used
    REM INSERTING into T
    Insert into T (X) values (to_timestamp('04/02/10 21:24:40,000000000','DD/MM/RR HH24:MI:SS,FF'));
    --   END DATA FOR TABLE T
    ---------------------------------------------------Edited by: P. Forstmann on 4 févr. 2010 21:26

  • How to get a time part from Date datatype

    Hi,
    I would like to know how to extract the timestamp alone from DATE datatype? If my input is '27-SEP-2011 23:59:00' I need the output as 23:59:00. I am surprised to see that there are no in-built functions for this or may be I am wrong. Basically I need to remove the date part from DATE data type and get the time.Please assist.
    -Thanks
    Edited by: user9546145 on Sep 27, 2011 2:24 PM
    Edited by: user9546145 on Sep 27, 2011 2:25 PM

    Hi,
    user9546145 wrote:
    Hi,
    I would like to know how to extract the timestamp alone from DATE datatype? Be careful! In Oracle, TIMESTAMP means a datatype, similar to but distinct from DATE. You'll avoid confusion if you don't use the word "timestamp" to mean anything else.
    There is a built-in function, TO_CHAR:
    TO_CHAR (dt_col, 'HH24:MI:SS')Depending on how you plan to use the time, TRUNC is another handy built-in function:
    dt_col - TRUNC (dt_col)is a NUMBER (not less than 0, but less than 1) which is suitable for many tasks, such as finding the average time.
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables, and also post the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Always say which version of Oracle you're using.

  • Why there is no datatype which only stores date (without time part)

    Hi All,
    Is there any specific reason for not having a data type which only stores date (without time part) in ORACLE - I am asking this because DATE (without time) is a very frequently used data type in any application.
    Thanks.

    884476 wrote:
    Then why ORACLE is allowing to have scale and precision in a NUMBER data type. If I want to store an integer there is no harm in storin it just as NUMBER. But I habe option to give something like NUMBER(10). But in DATE, the time part is mandatory.a) because there's no need for seperate DATE and DATETIME datatatypes, and b) the time part is not 'mandatory'.
    SQL> create table mytable (x date);
    Table created.
    SQL> insert into mytable (x) values (to_date('01/01/1980','DD/MM/YYYY'));
    1 row created.
    SQL>The DATE datatype contains the Time as well, to make it flexible... a single datatype that can do both things without the need for any conversion between datatypes (either explicitly or implicitly).
    Yes, many application need to have fields on the screen that just show a date, such as a date of birth as you say, but that's simply a display issue, and any application interface will allow for a date format to be specified for displaying the data from the database, so in terms of such "Date only" dates, you would simply use a format mask that ignores the time portion.
    There's absolutely no issue with the fact that it's just a single datatype... it causes no problems... it's perfectly flexible at being used for just dates or for dates and times... so why such a concern?

  • "Date / Date Time" type parameters in crystal reports 2008

    i am using parameters in crystal report to select records. one of the parameters is "From Date" of type Date Time.
    i mapped this parameter to a field "DateIn" of type smalldatetime in my sql table.
    Now, when i open the report it asks for "From Date" but b y default it sets the time to current time so i have to change it to 00:00:00 manually. i want it to show 00:00:00 by default. which means i don't want time here.
    For this if i select the datatype of parameter "From Date" as Date only then i am not able to map it to the "DateIn" field of the sql table.
    Please help me out of this.
    Edited by: rohit0825 on Jun 2, 2010 2:25 PM

    >
    Deepravs wrote:
    > Hi Rohit,
    >
    > Change the Parameter to Date Datatype and use this formula in the "Record Selection Formula " (Report Tab -> Selection Formulas -> Record)
    >
    > = CDateTime ({?From Date})
    >
    > Though the parameter is date datatype it converts to datetime datatype amd maps to the desired column.
    >
    >
    > Thanks,
    Great !!!
    this is working.
    i found another way, i changed the datatype of parameter to Date and click ok and everything was good, it doesn't require any conversion to date time.
    Thank You so much. All Points You.
    Edited by: rohit0825 on Jun 3, 2010 10:47 AM

  • Date/Time Field but not a date field type..

    I am dealing with a table that was already created and filled/filling with data.. so don't have an option to have someone go back and fix.
    The field i am dealing with is a varchar2 not a date field.
    it has values like
    12/31/1899
    2/17/2010 10:00:00 AM
    2/24/2010 9:00:00 AM
    2/17/2010 8:30:00 AM
    2/24/2010 9:00:00 AM
    12/31/1899
    Basically the 12/31/1899 dates are supplied the data source as an indicator that the real date/time is unknown until it gets updated later in the day or next day. (why its like this i don't know)
    anyways.. I need to drop records that are 7 days old.
    So for say the 2/17/2010 ones, when its 2/24/2010 when the process is ran, those records will get deleted but with the '12/31/1899' ones staying as they are awaiting to be given a date/time '12/31/1899' date is always used for the 'unknowns' so that is constant. The other 'valid ones' always have a date and a time given.
    I've tried a few things today, but kept blowing up.
    Edited by: CPSteven on Feb 11, 2010 6:04 PM

    >
    ORA-01830: date format picture ends before converting entire input string
    With that command
    The time in their messing with it?
    >
    You'd have that problem if the date format picture ends before any of your your strings end....
    Eg.. your date field has "time component" and you just use... "DD-MON-YYYY" as the format picture.
    However, If your format picture includes the maximum possible detail (of any of your strings) , you'll not see that error. Check this code below.
    sql> select * from temp;
            ID DATE_STRING
             1 02/11/2010 03:10:26
             2 02/10/2010 03:10:26
             3 02/09/2010 03:10:26
             4 02/08/2010 03:10:26
             5 02/07/2010 03:10:26
             6 02/06/2010 03:10:26
             7 02/05/2010 03:10:26
             8 02/04/2010 03:10:26
             9 02/03/2010 03:10:26
            10 02/02/2010 03:10:26
            11 12/31/1899
            ID DATE_STRING
            12 12/31/1899
    12 rows selected.
    sql> delete from temp
      2  where date_string != '12/31/1899'
      3    and to_date(date_string,'MM/DD/YYYY') < (sysdate-7);
      and to_date(date_string,'MM/DD/YYYY') < (sysdate-7)
    ERROR at line 3:
    ORA-01830: date format picture ends before converting entire input string
    sql> delete from temp
      2    where date_string != '12/31/1899'
      3      and to_date(date_string,'MM/DD/YYYY HH24:MI:SS') < (sysdate-7);
    4 rows deleted.
    ----In your case.. your format mask would be to_date(date_string,'MM/DD/YYYY HH:MI:SS AM')

  • Can we print the data from types or return it to java ?

    Hello,
    The requirement is very clear that, their is a huge amount of data (80 lacs Rows Approx.) these rows are need to be showed in the front-end which is java. First the java team had written a simple select statement in the java codeing which was taking a quite a large time (10 - 20 min approx.), then i shifted this part to back-end i,e ORACLE 11g & wrote the plsql block below which consist of types.
    Now i have managed to bring the data in types but how to print that data ??? is their any member function ???  How should i return this data to java code ???
    ORACLE DATABASE 11g
    Eclips Java
    Linux Enterprice Edition 5
    create or replace procedure date_time(v_fromtime in timestamp,v_totime in timestamp) is
    type v_date_time is table of varchar2(4000);--T_MES_DSS_BLOCK_DATA_13.Date_Time%type;
    datetime_tab v_date_time:=v_date_time();
    type v_counter is table of T_MES_DSS_BLOCK_DATA_13.Counter%type;
    counter_tab v_counter:=v_counter();
    type v_column_1 is table of number;
    column1_tab v_column_1:=v_column_1();
    type v_column_2 is table of number;
    column2_tab v_column_2:=v_column_2();
    cursor dt is
    select DATE_TIME, COUNTER,COLUMN_1, COLUMN_2
    from (
    select
    /*+  INDEX(T_MES_DSS_BLOCK_DATA_13 IDX_MES_BLK_DATA_3_DATE_TIME) INDEX(T_MES_DSS_BLOCK_DATA_13 IDX_MES_BLK_DATA_3_COUNTER)*/
    DATE_TIME, COUNTER,
    dbms_xdbutil_int.rawtonum(SUBSTR(BLOCK_COLUMN_23, 121, 8))COLUMN_1,
    dbms_xdbutil_int.rawtonum(LAG( (SUBSTR(BLOCK_COLUMN_23, 121, 8)),1,0 ) OVER (ORDER BY DATE_TIME ))COLUMN_2 
    from T_MES_DSS_BLOCK_DATA_13 PARTITION(PART11JUN2010) 
    where DATE_TIME BETWEEN v_fromtime and v_totime);
    end_time number;
    start_time number;
    begin
    start_time:=dbms_utility.get_time();
    open dt;
    loop
    fetch dt bulk collect into datetime_tab,counter_tab,column1_tab,column2_tab;
    exit when dt%notfound;
    end loop;
    close dt;
    dbms_output.put_line('Number of Rows in Date_time:- ('||datetime_tab.count||'):');
    dbms_output.put_line('Number of Rows in Counter:- ('||counter_tab.count||'):');
    dbms_output.put_line('Number of Rows in column1:- ('||column1_tab.count||'):');
    dbms_output.put_line('Number of Rows in column2:- ('||column2_tab.count||'):');
    end_time:=dbms_utility.get_time();
    dbms_output.put_line('Total Time:-'||to_char(end_time-start_time)/60);
    end date_time;

    Well anyhow i have managed to run this code using bulk collect feature & getting good performance but can i print this data ???
    how to return this data which has bulk collect feature to java code ??? any idea ?
    CREATE OR REPLACE PROCEDURE "MES01"."DATE_TIME"(v_fromtime in timestamp,v_totime in timestamp,
    datetime_tab out t_mes_dss_block_data_13.date_time%type,
    counter_tab out t_mes_dss_block_data_13.counter%type,
    column1_tab out number,
    column2_tab out number) is
    cursor dt is
    select DATE_TIME, COUNTER,COLUMN_1, COLUMN_2,rownum
    from (
    select  /*+  INDEX(T_MES_DSS_BLOCK_DATA_1 IDX_MES_BLK_DATA_1_DATE_TIME) INDEX(T_MES_DSS_BLOCK_DATA_1 IDX_MES_BLK_DATA_1_COUNTER)*/
    DATE_TIME, COUNTER,
    dbms_xdbutil_int.rawtonum(SUBSTR(BLOCK_COLUMN_1, 1, 4))COLUMN_1,
    dbms_xdbutil_int.rawtonum(LAG( (SUBSTR(BLOCK_COLUMN_1, 1, 4)),1,0 )   OVER (ORDER BY DATE_TIME ))COLUMN_2 
    from T_MES_DSS_BLOCK_DATA_1 PARTITION(PART03AUG2010) 
    where DATE_TIME BETWEEN '02-AUG-2010 09:00:00.0' and '02-AUG-2010 09:10:00.0')  
    where COLUMN_1 =0 and COLUMN_2 != 0 or (rownum=1 and COLUMN_1 = 0 and COLUMN_2 = 0);
    --end_time number;
    --start_time number;
    begin --1st block
    Declare --2nd declare
    type v_date_time is table of T_MES_DSS_BLOCK_DATA_3.DATE_TIME%type;
    datetime_tab v_date_time:=v_date_time();
    type v_counter is table of T_MES_DSS_BLOCK_DATA_3.Counter%type;
    counter_tab v_counter:=v_counter();
    type v_column_1 is table of number;
    column1_tab v_column_1:=v_column_1();
    type v_column_2 is table of number;
    column2_tab v_column_2:=v_column_2();
    type v_rownum is table of number;
    rownum_tab v_rownum:=v_rownum();
    Begin --2nd block
    --start_time:=dbms_utility.get_time();
    open dt;
    loop
    fetch dt bulk collect into datetime_tab,counter_tab,column1_tab,column2_tab,rownum_tab;
    exit when dt%notfound;
    end loop;
    close dt;
    --dbms_output.put_line('Number of Rows in Date_time:- ('||datetime_tab.count||'):');
    --dbms_output.put_line('Number of Rows in Counter:- ('||counter_tab.count||'):');
    --dbms_output.put_line('Number of Rows in column1:- ('||column1_tab.count||'):');
    --dbms_output.put_line('Number of Rows in column2:- ('||column2_tab.count||'):');
    --end_time:=dbms_utility.get_time();
    --dbms_output.put_line('Total Time:-'||to_char(end_time-start_time)/60);
    end; -- 2nd block
    end date_time; -- 1st block

  • Data: stru_tab type ref to data? what data refers to?

    Dear friends,
                         Relatively iam new to WDA. can u please explain me below statement.
    data: stru_tab type ref to data.

    Actually there are not really any Web Dynpro sepecific data types.  The ones mentioned are simply data dictionary data types that are defined for use with WD, but can be used in any ABAP applications.  You should start your research with just ABAP data types.  Look in the ABAPDOCU transaction or search the keyword documentation for DATA. There is lots of documentation on the ABAP native data types.
    Here is a little bit of it:
    Predefined ABAP Types
    The table below shows the predefined ABAP types. Additional attributes can be found under value ranges and initial values.
    Type Length Standard length Description
    b 1 Byte   1 byte integer (internal)
    c 1 to 65,535 characters 1 character Text field
    cursor as i as i Database cursor
    d 8 characters   Date field
    f 8 bytes   Floating point number
    i 4 bytes   4 byte integer
    n 1 to 65,535 characters 1 character Numeric text
    p 1 to 16 bytes 8 bytes Packed number
    string variable   Text string
    s 2 bytes   2 byte integer (internal)
    t 6 characters   Time field
    x 1 to 65,535 bytes 1 byte Byte field
    xstring variable   Byte string
    These types are predefined in every ABAP program.
    All predefined ABAP types in this table are elementary.
    Apart from the types b and s, the predefined ABAP types can also be used to define your own data types and data objects and for typing. The types b and s cannot be specified directly in ABAP statements. Self-defined data types and data objects in ABAP programs are of the data type b and s if they are defined with reference to data elements to the ABAP Dictionary which are of the external data types INT1 or INT2.
    The predefined data types string and xstring describe data objects of variable length (dynamic data objects). While the length of data objects in all other elementary data types is determined for its whole lifetime, the length of text and byte strings varies according to their content (the maximum size of a string is determined by profile parameter ztta/max_memreq_MB, see Maximum size of dynamic data objects).
    The program-globally predefined data type cursor is currently synonymous with the predefined ABAP type i. This is required for the declaration of a cursor variable for database cursor handling.
    All predefined ABAP types for which a length interval is specified in second column in the table are generic, which means that the length is not part of the type description. For the type p, the fractional portion is indefinite as well as the length.
    The entries in the standard length column specify the length that is used for the corresponding generic data type when declaring data objects, if no explicit length is specified in the relevant statement.
    In Unicode systems, the length must either be specified in characters and bytes. In non-Unicode systems, the length of a character is one byte, but in Unicode systems the length of a character depends on which Unicode character representation is used.
    Generic ABAP Types
    The following table shows the predefined generic ABAP types. A generic data type is an incomplete type specification that includes several complete type specifications. The generic types can be used for the typing of field symbols and formal parameters. The only generic type that can be used for typing of data references is the predefined type data. The predefined generic type for object references is object. When a data object is assigned to generically typed field symbols using the statement ASSIGN, or to a formal parameter in procedure calls, the system checks whether its concrete data type is a of the generic type, or is compatible with it.
    Type Description
    any Any data type (suitable for any type)
    any table Internal table of any table type
    c Text field of generic length
    clike Character-type (c, d, n, t, string and character-type flat structures); in non- Unicode programs also x, xstring and any flat structures
    csequence Text-type (c, string)
    data Any data type
    hashed table Hashed table
    index table Index table
    n numeric text of generic length
    numeric Numeric (b, i, p, f, s)
    object Any object type (root class of the inheritance hierarchy)
    p Packed number of generic length and generic number of decimal places
    simple Elementary data type including structured types with exclusively character-type flat components
    sorted table Sorted table
    Standard table Standard table
    table Standard table
    x Byte field of generic length
    xsequence byte-type (x, xstring)
    The genric types clike, csequence, numeric,simple, and xsequence are available as of release 6.10.
    Notes
    The generic type any currently has the same effect in typing as the generic type data. When declaring references, any cannot yest be specified after REF TO. Generic data references (REF TO data) or generic object references (REF TO object) are possible. The generic type object can currently only be specified after REF TO.
    Except for the built-in generic types illustrated in the table above, there are at the moment no self-defined generic types in ABAP with only one exception: A table type defined with TYPES - TABLE OF or defined in the ABAP Dictionary without completely specifying the table key, is also generic.
    Predefined Types in the ABAP Dictionary
    The following table lists the predefined types in the ABAP Dictionary. These types cannot be used directly in ABAP programs, and are therefore known as external data types. Instead, they are used in the ABAP Dictionary for the definition of data types to which ABAP programs can refer. The predefined data types of the ABAP Dictionary must also be taken into account in Open SQL statements and when working with screens: Open SQL statements work with database tables defined in the ABAP Dictionary whose colums have external data types. Screen fields are also declared in the Screen Painter with reference to external data types.
    Type Permitted Places m Meaning ABAP Type
    ACCP 6 Accounting period n(6)
    CHAR 1-255 Character string c(m)
    CLNT 3 Client c(3)
    CUKY 5 Currency key c(5)
    CURR 1-31 Currency field p((m+1)/2)
    DATS 8 Date d
    DEC 1-31 Calculation/amount field p((m+1)/2)
    FLTP 16 Floating point number f(8)
    INT1 3 1 byte integer b
    INT2 5 2 byte integer s
    INT4 10 4 byte integer i
    LANG 1 Language c(1)
    LCHR 256-... Long character string c(m)
    LRAW 256-... Long byte string x(m)
    NUMC 1-255 numerischer Text n(m)
    PREC 2 Accuracy of a quantity field s
    QUAN 1-31 Quantity field p((m+1)/2)
    RAW 1-255 Byte sequence x(m)
    RAWSTRING 256-... Byte sequence xstring
    SSTRING 1-255 Character string string
    STRING 256-... Character string string
    TIMS 6 Time t
    UNIT 2-3 Unit key c(m)
    For types LCHR and LRAW, the maximum number of places in a transparent database table is the value of the preceding INT2 field.
    The types RAWSTRING and STRING have a variable length. A maximum length for these types can be specified, but has no upper limit.
    The type SSTRING is available as of release 6.10 and it has a variable length. Its maximum length must be specified and is limited to 255. The advantage of this type compared with CHAR, is that it is assigned to the ABAP type string.
    The table below shows the data types of the ABAP Dictionary that are based on the predefined types in the above table, and that can be addressed in an ABAP program. The elementary components of these data types are converted to predefined ABAP data types according to the final column in the above table, whereby the number of places m of each type is converted to lengths.
    Data types in the ABAP Dictionary Data types in ABAP
    Data element Elementary data type, Reference type
    Structure, Database table, View Structured data type
    Table type Table type
    Note
    As of release 6.20, a component of structures or database tables that has the type LANG can be identified as a text language. The text language is used for the conversion of character-type components of the structure when importing data from data clusters and for RFC between MDMP systems and Unicode systems.

  • How to add a mm-dd-yyyy date field type in a Planning Data Form

    Hi John,
    pls, I have one question regarding the possibility of adding a date field type for example 03-03-2009 in a cell of Planning Data Form application.
    for example, I created:
    - 2 members in Period dimension: StartProject and EndProject and I need to enter and track date for these fields;
    - one Account member called Project;
    - and a simple form with these collumns and row;
    Trying different settings for my members - seems that I cannot input date in the cell and rcvd errror: "you have entered invalid value".
    Pls, can you confirm me if it's possible to enter date type in a form?
    If yes, what is the specific setup for the Account and Period properties: Data storage, Time Balance, Data type, Account type etc
    many thanks,
    Robert

    Many thanks John!!! that's it!!!
    I had to change it in Data Type evaluation Order because I'm using EPMA and it's working now!!
    Thanks again!!!
    Rgds,
    Robert

Maybe you are looking for