Skip to Content

about date

i have one variable which stores date in the format yyyymmdd

but i want only day (dd) in another variable....how can i do this???

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

10 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Apr 02, 2008 at 11:59 AM

    Get the day as ....

    v_day = v_date+6(2).

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 02, 2008 at 12:00 PM

    Hi,

    Use offsets

    data : v_date(10) value '20080402',

    v_day(2).

    V_day = v_date+6(2).

    write : v_day.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 02, 2008 at 12:00 PM

    Hi,

    use code like this.

    data:day(2).
    day = dat+6(2)."or day = dat+6.
    

    rgds,

    bharat.

    Add a comment
    10|10000 characters needed characters exceeded

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

    Data : date type sy-datum.

    data : day type char02.

    **--> Now this field will contain the current date

    date = sy-datum.

    day = date+6(2).

    write day.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Apr 02, 2008 at 12:01 PM

    Hi sandeep,

    do this way..

    suppose temp stores your date in yyyymmdd formate.

    u need to do this..

    data: tempdate(2).

    tempdate = temp+6(2).

    now tempdate stores dd.

    reward if helpfull.

    Add a comment
    10|10000 characters needed characters exceeded

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

    Use syntax,

    var2 = var1+6(8).

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 02, 2008 at 12:03 PM

    Hi

    l_period+6(2)

    i_period is yyyymmdd

    6(2) means it will counr from 6 and 2menas after 6 it will take 2 digits

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 02, 2008 at 12:06 PM

    Hi,

    data: date type string.

    date = sy-datum+6(2).

    write: date.

    I think this is helpful to you.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 02, 2008 at 12:06 PM

    Hi,

    Please use the code below:

    
    data : gv_date  like sy-datum,
             gv_date1(2) TYPE C.
    
    
    gv_date = sy-datum.
    gv_date1 = gv_date+6(2).
    
    write : gv_date1.
    

    Thanks,

    Sriram Ponna.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 02, 2008 at 12:18 PM

    Hi!

    Try using this:

    
    DATA: gv_date   TYPE sy-datum,   " yyyymmdd variable
               gv_day(2) TYPE c.             " dd variable
    
    gv_date = sy-datum.
    
    *** This means you'll ignore the six first char, and store the last 2 on  the variable:
    gv_day  = gv_date+6(2)  
    
    

    Kind regards,

    Brian Gonsales

    Edited by: Brian Gonsales on Apr 2, 2008 2:19 PM

    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.