Skip to Content
author's profile photo Former Member
Former Member

How to convert the date format to Character Format

Dear Experts,

Does any one has idea about converting the date format to character format.

For example the date format is 06/01/2006 (MM/DD/YYYY)

and the character format is 79939369

Please help ASAP.

Regards,

Shankar

Add comment
10|10000 characters needed characters exceeded

5 Answers

  • Posted on Aug 01, 2006 at 12:38 PM

    You can use the conversion routine function module CONVERT_DATE_TO_INTERNAL, this will convert from 08/01/2006 to 20060801 then you can move the 20060801 value to a character type field.

    Regards,

    Rich Heilman

    Add comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 01, 2006 at 12:48 PM

    HI Shankaran Jayakumaran ,

    There are mnay ways to do it

    Try the following procedures

    -


    data : v_date like sy-datum value '20060725'.

    data : v_char_date(8) type c.

    v_char_date = v_date.

    write :/ v_char_date.

    -


    FM : HR_IN_CHG_INR_WRDS

    parameters : date like sy-datum.

    data : data(8) type c.

    data = date.

    -


    Try the following FM-

    CONVERT_DATE_TO_EXTERNAL

    CONVERT_DATE_TO_INTERNAL

    here u pass the date formats and the dates u want to change , for both source and target.

    -


    Good Luck

    Thanks

    Ashok

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Use the Function module <b>CONVERT_DATE_TO_INTERNAL</b>

        CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'
             EXPORTING
                  DATE_EXTERNAL            = External date
             IMPORTING
                  DATE_INTERNAL            = Internal Date
             EXCEPTIONS
                  DATE_EXTERNAL_IS_INVALID = 1
                  OTHERS                   = 2

  • author's profile photo Former Member
    Former Member
    Posted on Aug 01, 2006 at 01:00 PM

    Hi Experts,

    Thanks for your valuable inputs. But i have found a new FM to suit my requirements. Please find the below Information.

    For example date 01/30/2006 will be 79939869.

    The FM is

    CONVERSION_EXIT_INVDT_INPUT

    Regards,

    Shankar

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 01, 2006 at 01:23 PM

    Hi Rich,

    There is one table available for storing the Transaction Currency. i.e.) TCURR.

    In this Table you will have the date field stored in character format, which is nothing but Inverted Date Format.

    Please let me know if there is any other queries. Please award me some points.

    Regards,

    Shankar

    Add comment
    10|10000 characters needed characters exceeded

    • Just wondering why the date would be stored this way when most other fields in the system at stored as DATS fields. What table are you referring to.

      About Points, I would if I could, since you are the original poster only you can award points for this thread.

      Regards,

      Rich Heilman

  • author's profile photo Former Member
    Former Member
    Posted on Aug 01, 2006 at 01:36 PM

    Rich,

    This is a system table which stores the Daily Closing Exchange Rate, but the date is stored in the Inverted Date format.

    Regards,

    Shankar

    Add comment
    10|10000 characters needed characters exceeded