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

simple query plz help

hi experts

i have a variable in which i have stores a date

from that date i want to store only the month value in a seperate variable .

plz give me the code for this

thanks in advance .

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 09, 2007 at 04:00 AM

    Here is the code:

    data: l_datum like sy-datum.

    data: l_month(2) type c.

    • Assign value to L_DATUM

    l_month = l_datum+4(2).

    Hope this helps.

    ashish

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 09, 2007 at 03:59 AM

    The example below gives you the month of the current date. You can use with any date variable to get the month.

    DATA lc_month(2) TYPE c.

    lc_month = sy-datum+4(2).

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 09, 2007 at 04:05 AM

    DATA : date TYPE sy-datum VALUE '20071201'.

    • Format 'YYYYMMDD'

    DATA: month TYPE char2.

    month = date+4(2).

    WRITE: month.

    Rewards if useful.....................

    Minal

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 09, 2007 at 03:59 AM

    Hi Anit,

    l_date = '2006.05.24'. "YYYY.MM.DD
    
    l_month = l_date+5(2).

    Best regards,

    Prashant

    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.