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

date format

when i m selecting date from database table in internal table it selects in the format as "20080218"

but i want to assign this date to a variable as "18.02.2008"

so how to change date format while assining from internal table field to variable ??

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

10 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Mar 25, 2008 at 10:05 AM

    Hi

    use FM CONVERSION_EXIT_PDATE_OUTPUT

    Regards

    Aditya

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 25, 2008 at 10:08 AM

    Hi ,

    use CONVERSION_EXIT_PDATE_OUTPUT

    reward points if helpful

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 25, 2008 at 10:09 AM

    you can either use a date conversion exit.

    e.G. the above described.

    but a simple write to statement should help you as well.

    Just declare youself a variable of type char length 10, and then write your dats variable to this char variable.

    the conversion exit should be processed automatically.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 25, 2008 at 10:11 AM

    Hi

    paas the value to conversiondateoutput function module it will convert the same into user set date format

    or user write to dd/mm/yyyy

    refer this

    http://www.abapcode.sapbrainsonline.com/2008/03/write-output-formatting-options-abap.html

    regards

    Shiva

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 25, 2008 at 10:13 AM

    Hi,

    Have a look on the folowing example code.You can get some idea.

    data: date1 type sy-datum value '20080325'.

    data: date2 type d value '20080326'.

    write:/ date1.

    write:/ date2.

    Reward,if it is useful.

    Thanks,

    Chandu

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 25, 2008 at 10:15 AM

    HI,

    user OFFSET Operater like this.

    Concatenate sy-datum8(2) '.'  sy-datum6(2) '.'  sy-datum0(4)  .

    Regards,

    S.Nehru.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 25, 2008 at 10:16 AM

    Hi use the code.

    Data : var like sy-datum.

    date(10).

    start-of-selection.

    concatenate var6(2) '.' var4(2) '.' var+0(4) into date.

    write : /1 date.

    Reward if useful.

    Regards,

    Sankar.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 25, 2008 at 10:22 AM

    Hi Santhosh,

    U can use the following code.

    date = 20080218

    declare new variable date1 of type ur database field type

    concatenate date6(2) '.' date4(2) '.' date(4) into date1.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 25, 2008 at 10:24 AM

    reward points for useful answers !

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 25, 2008 at 10:37 AM

    Try this way

    data v_date type sydatum.

    v_date = '20080218'.

    data v_date1 type string.

    concatenate v_date6(2) '.' v_date4(2) '.' v_date+0(4) into v_date1.

    write v_date1.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.