Conversion of date field format from char to dats

Hi All,
one issue with Date field.
in my internal table i have a date field with type char(10).
But when I upload the data to database through upload program,  there I have a date field with type "DATS".
how do I convert and store it in "DATS " format in database.
please help...

HI ,
Try this use  CONVERT_DATE_TO_INTERNAl
CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'
  EXPORTING
    date_external                  = "ur date from file
  ACCEPT_INITIAL_DATE            =
IMPORTING
DATE_INTERNAL                  =  "( date in dats format )
EXCEPTIONS
  DATE_EXTERNAL_IS_INVALID       = 1
  OTHERS                         = 2
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

Similar Messages

  • Date Field Formatting

    Hi All,
    I'm back already! Learning Flash is beginning to get to me
    again so I returned for yet more help!
    I've written the following AS code to get tomorrow's date . .
    // Calculates today's date and tomorrow's date
    var dToday:Date = new Date();
    dToday.getDate()
    trace("today: " + dToday) //today's date
    myD = dToday.getDate() + 100; // plus one day
    var dTomorrow:Date = new Date();
    dTomorrow.setDate(myD)
    trace("new: " + dTomorrow) //tomorrow's date
    var strDate:String = new String();
    var strDate = String(dTomorrow);
    trace("String: " + strDate);
    The strDate string returns the following value . . . "Tue Jul
    11 16:19:57 GMT+0100 2006".
    That is all well and good but I want to convert it into the
    following format for comparison with another field . . .
    "200607111619" which is basically the same value in the following
    format . . . "yyyymmddhhmm".
    Does the only way of doing this involve using parsing logic
    to break down the original string and then reconstruct it in the
    required format using variables from the broken down original
    string?
    I have tried looking at the Date Field object notes in my
    book but it does not give me anything as regards this programming
    requirement. The only thing I can find that might suit this purpose
    is string parsing logic. Am I right or is there an easier way to
    set a date field format?
    Any help would as always be much appreciated!
    Thanks,
    Kevin.

    I'm working on an application which requires a valid Voucher
    Number to proceed. The Voucher number is based on a combination of
    'date/time/no of items' (e.g. 20060711095802 which is today at
    09:58 (on a 24 hr clock) for 2 (02) items).
    As this date this date/time Voucher Number logic is
    essentially sequential, in that each subsequent Voucher Number will
    be greater than the last good known Voucher Number entered into the
    application (which is already stored in a variable field for
    comparison). But it must also be less than tomorrow's date, for
    which the Voucher Number would always be tomorrow's date (e.g.
    20060712 at 00:00 hrs for 00 items, thus giving 20060712000000).
    This is the value that I'm trying to ascertain from the date field
    logic.
    It would thus be really handy for comparison if I could just
    format tomorrow's date and time in the format yyyymmddhhmm and just
    add '00' to the end of the string.
    I don't like the idea of using the milliseconds value as it
    will be necessary then to convert the Voucher Number entered to a
    date field for comparison.

  • Determine Date field format dynamically

    Hello friends,
    I'm writing some database access code in java. The biggest problem I face is date fields. Because I don't know the date field format (For example, in SQL Sever we can have dd/mm/yy or mm/dd/yy, etc), I can't format dates for insert/update statements.
    Is there a way to determine the date field format dynamically? Regardless of database, for ex. MS SQL, Oracle?
    Thank you.

    Hey!
    There is a way to do this! The Oracle Database understands SQL92 Syntax. So you can use
    - {d ?yyyy-mm-dd?} for date representation,
    - {t ?hh:mm:ss?} for time representation,
    - {ts ?yyyy-mm-dd hh:mm:ss.f...?} for timestamp rep.
    Here is a small example:
    // Connect to the database
    // You can put a database name after the @ sign in the connection URL.
    Connection conn = DriverManager.getConnection
    ("jdbc:oracle:oci8:@", "scott", "tiger");
    // Create a Statement
    Statement stmt = conn.createStatement ();
    // Select the ename column from the emp table where the hiredate is Jan-23-1982
    ResultSet rset = stmt.executeQuery
    ("SELECT ename FROM emp WHERE hiredate = {d ?1982-01-23?}");
    // Iterate through the result and print the employee names
    while (rset.next ())
    System.out.println (rset.getString (1));I hope this is what you wanted to know!

  • Date field not working like a date field

    We have quite a few date objects in the Universe but only some seem to function as a date field whereas some do not.
    The easiest way to tell whether a date field is functioning as a date field seems to be to add the date fields as a filter in a query. If it is a proper date field a Calendar option appears. If it is not, no Calendar option appears.
    In the screenshot below, the Latest Approved Date functions like a proper date object and shows a calendar option. The other field does not even though it is a date field too.
    I'm checking with this forum as the Universe designer didn't have any answer for this.

    HI Vivek,
    Go to Universe Designer
    click on object (Latest Approved Date)
    click on definition
    go to TYPE scroll down and select type as DATE
    and export now check the filter it will work
    try once
    Regards,
    Ranjeet

  • How to make Birth date field (GBDAT) under IT0002 Personal data editable

    Hello Consultants,
    We had initially  Birth date field (GBDAT) under IT0002 Personal data editable ...But after upgrade is made non editable...
    We want to make it editable again..
    Kindly suggest how we can proceed abt this....

    Hi Anju,
    1. Go to PA30 >> Infotype 0002 >> On Date of Birth Field >> Enter F1 and find the Technical Parameter and idenfity which Screen is being Used... say for Eg: MP000200 / 2010
    2. Go to Feature P0002 in PE03 and then identify the Return code for the Molga and Co. Code.
    This Return feature is nothing but the Variable Key. Say for Example: 10
    3. Now Go to SM30 >> T588M.....
    3. Idenfity the Screen that you found in the  step 1 and Variable Key you found in Step 2.
    i.e. MP000200 / 2010 / 10
    5. Double Click on that record and Find the Screen Field P0002-GBDAT... this has been set to Output Field... change it to Standard and it will work.
    Hope this helps !!!
    Kumarpal Jain.

  • Restrict date field in vf01 to system date .

    hi gurus,
    my requirement is to restrict date field in vf01 to system date .
    i have changed the 011 routine in vtfa .
    do I need any extra effort
    debajyoti

    Hi debajyothi
    First of all which date field you want to restrict to systems date can you be more specific debajyothi
    But In VOV8 , there is a pricing  date field  , if you customize it as per your requirement , like if you keep it blank then it will be systems date , or billing date , delivery date etc this can be one input if it is related to pricing
    Even as you said in copy controls if you change the sub- routine then it will work
    Regards
    Srinath

  • Warranty Date field in the equipment master data

    Hi everyone!
    I wanted to display the warranty date field in the equipment master data (IE01). I have already made the configuration and added the additional tab and screen thru this path:
    Plant Maintenance and Customer Service > Master Data in Plant Maintenance and Customer Service > Technical Objects > General Data > Set View Profile for Technical Objects
    But still, the tab is not added and the warranty date field is not found in the "Define Field Selection for the Equipment Master Record". please help me with this. We need this data because we are not using serial numbering and warranty master data that's why a way to track the warranty date is thru this adjustment in the equipment master data screen.
    Thank you very much.

    Marlon,
      Make sure that you have assigned this specific profile to the Equipment category of the associated equipment that you are creating under SPRO > PM> Master data> tech object > Equipment > Equip category.
    Regards
    Narasimhan

  • Conversion from char to date

    I have a filename as final_20120928_142334.txt
    I have to get only date value from this as 20120928_142334
    then I have to convert this into date time format as yyyymmdd hh24:mi:ss

    To extract the actual filename into a table, use the code for the 'Retrieve File List' example in this document - on page 8.
    http://s3.amazonaws.com/Ora/ODI_Waiting_for_a_file_and_processing_it.pdf
    Then use the expression posted by 955950 above to format the string.
    Edited by: _Phil on Sep 28, 2012 11:48 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Browser date field format in header

    I am using Browser 2.0 for some ad hoc queries on an Oracle
    7.2.3 database.
    My client is running Windows NT 4.0 with Service Pack 4.
    Regional settings are set to English (Australia).
    The page setup in Browser allows you in the header or footer to
    insert the a date field via "&d". Documentation states this is
    system generated.
    However, in the print preview and print out the date is
    formatted as MM/DD/YY. I need to have it formatted as DD-MON-
    YYYY.
    Can anyone suggest to me from which system the format is being
    generated or any
    suggestions on how to change it in.
    Thanks
    null

    can you paste the timestamp being displayed?
    You can use, format-date function or other, but its all based on the data you have for DATE.

  • Need to change Date field Zone from IST to UST

    Guys,
    I have to develop a application in which there is a Date field. This date is coming from Application Server i.e. R3 and is in India, terefore it's IST. Now when this application is run from US, it should give the UST.
    Means Actually I want to change the Date from IST to UST.
    Can somebody please reply with the coding that needs to be done.
    Thanks,
    Nikesh Shah

    Hi,
    Refer the following link
    Date format
    Java Webdynpro Date Format
    I hope it helps.
    Regards,
    Rohit

  • Need you help !!! -- Convertion from Char to Date

    Dear experts:
    I am new to abap and here is one thing need your help:
    Currently I have a char type field defined in the source table, after I retrive this field into my work area, I need to convert it to Date type and then calculate the last day of this date.
    for example: WA_TEST-CHAR = '20100801'. This value in orignal ECC table is char type.
    Then How can I convert this value to a date type, and calculate its last day?
    My expected result is "20100731".
    BTW, does anybody know how to convert a date type field to a number type field like To_number() or something?. If I need to get the period between 2 different date, how can I get this?
    Any post will be appreciate and thank you all in advance!
    Best Regards
    Tim
    Moderator message: sorry, date conversion and date calculation are very basic and FAQs, please search for available answers, also read ABAP online documentation.
    locked by: Thomas Zloch on Aug 23, 2010 9:56 AM

    Hi,
    For your question:
    BTW, does anybody know how to convert a date type field to a number type field like To_number() or something?. If I need to get the period between 2 different date, how can I get this?
    use this FM FIMA_DAYS_AND_MONTHS_AND_YEARS.
    regards,

  • How to handle empty Dats field received from SAP RFC response

    Hi All,
    I am invoking a SAP RFC which gives me a Dats field in response.
    A valid dats fields is successfully received by my pipelines.
    But when an empty Dats field is received, My pipeline fails and i get error.
    How to handle the empty Dats field from SAP

    Hi Anant,
    This is because the legacy SAP adapter accepted RFC messages with date field empty. In the new version, the same call results in an error. WCF-SAP adapter doesn't allow blank XML nodes.
    You need to use the below custom pipeline component as a workaround.
    Refer:
    Pipeline component for enabling legacy behavior in WCF-SAP adapter.
    Rachit
    Please mark as answer or vote as helpful if my reply does

  • DTW Date Field Format

    Hi,
    I'm trying to import some UDF information into Business Partners, but one of my UDFs is set up as a Date field. What format of date shoul be in the import file becasue DD/MM/YYYY doesnt import so I tried YYYY/MM/DD and this doesnt work either.
    Thank you x

    Hi,
    Check this thread.
    Re: defining date possible while doing DTW import to Goods Receipt
    regards,
    Fidel

  • Convert field value from Double to Date Time.

    Hi Every one.  Its been a long time since i have last posted on this site but i need some help again please.
    I want to convert a field value (saved as format double) to a date time value. I dont seem to find a function
    that can do this can anyone give me some help please?
    A sample would be to convert 40249.6588697106 to the format of Date Time being 12/03/2010 15:48:46
    Any suggestion?
    Thanks

    You can define a date time variable and use CDateTime.
    dim d as DateTime
    d = CDateTime(40179.55833333)
    formula = d

  • The data field format for the sql* loader

    the data field in my data file was surrounded by ",", such as "1","2","3",...
    so in my control file, I coded
    fields terminated by ',' enclosed by '"'
    no error after I execute sqlldr command.
    however, on data has been inserted into table either.
    if I remove "" and ,
    the data field changed to 1 2 3 ...
    and the data has been inserted into my table
    However the first format is what I want. can anyone experienced silmilar situation? please give me a hint.
    your help is highly appreciated
    null

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Renali ():
    say:
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' TRAILING NULLCOLS (
    colname1,
    colname2,
    colname3)
    the data field in my data file was surrounded by ",", such as "1","2","3",...
    so in my control file, I coded
    fields terminated by ',' enclosed by '"'
    no error after I execute sqlldr command.
    however, on data has been inserted into table either.
    if I remove "" and ,
    the data field changed to 1 2 3 ...
    and the data has been inserted into my table
    However the first format is what I want. can anyone experienced silmilar situation? please give me a hint.
    your help is highly appreciated
    <HR></BLOCKQUOTE>
    null

Maybe you are looking for