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

Add to system date

Hi All,

I have a scenario where i am declaring a Global variable Numeric.

I will call this variable in a program which will add to the system date.

How do i do this...

Reg

Suren

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Sep 19, 2008 at 06:09 AM

    try FM RP_CALC_DATE_IN_INTERVAL.

    data: wa_date like sy-datum.
    
    call function 'RP_CALC_DATE_IN_INTERVAL'
    exporting
    date = sy-datum
    days = variable
    months = 0
    signum = '+'
    years = 0
    importing
    calc_date = wa_date.
    
    
    write: / wa_date.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 19, 2008 at 06:39 AM

    hi Sureen,

    if the global variable represents number of days, you can add directly:

    DATA : gv_days TYPE i,
               gv_date TYPE sy-datum.
    
    gv_date = sy-datum + gv_gays.

    Also, do not change system variables directly, use a separately defined variable!

    hope this helps

    ec

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 19, 2008 at 06:42 AM

    Hi Suren,

    You can try this way-

    Data:w_numc type n,
            w_result type sy-datum.
    
    
    w_result = sy-datum + w_numc.

    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.