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

Conversion of date of 8 (dd/mm/yyyy) to type 6 (yyyy/mm)

how to convert date in select-options field which is of 8 (dd/mm/yyyy) to type 6 (yyyy/mm).

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on May 01, 2008 at 02:29 PM

    Rocky,

    This what you need?

    DATA: datein(10)   TYPE c.
    DATA: dateout(7)   TYPE c.
    
    WRITE sy-datum TO datein MM/DD/YYYY.
    
    CONCATENATE datein+6(4) '/' datein+0(2) INTO dateout.
    
    WRITE:/ datein, dateout.
    

    Output

    05/01/2008 2008/05         
    

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 01, 2008 at 02:41 PM

    select-options: s_date for .. " type date.

    data: begin of it_date,

    date type dats,

    end of it_date.

    data: wa_date like line of it_date.

    loop into s_date.

    CONCATENATE s_date-low6(4) '/' s_date-low0(2) INTO wa_date.

    append wa_date to it_date.

    endloop.

    the table it_date will have the date of all selected date in the select options field in the required format.

    Hope it helps.

    Thanks,

    Imran.

    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.