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

hai all

i have the dunnig date field. .1.e mhnk-grdat.

my question is i want to add the 15 days for that field.and print that date

in coreect formate in the script layout.

i need code for that one.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

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

    Hi

    Please find the code below

    data: lv_gradat type mhnk-grdat,

    lv_date(10) type c.

    lv_gradat = sy-datum.

    lv_gradat = sy-datum + 15.

    • if you need date format in indian format

    concatenate lv_gradat6(2) '.' lv_gradat4(2) '.' lv_gradat+0(4) into lv_date.

    write:/ lv_date.

    Add a comment
    10|10000 characters needed characters exceeded

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

    Hi Venky,

    Just assign MHNK-GRDAT to a variable of type "date" and add 15 to that variable it will work.

    See the example program below:-

    DATA: ldate TYPE sy-datum,

    ldate1 TYPE sy-datum.

    ldate = sy-datum

    l ldate1 = ldate + 15.

    WRITE: ldate.

    WRITE: ldate1.

    Reward Points if helpful

    Regards

    Avi....

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 03, 2007 at 04:11 PM

    Hi,

    In the perform statement pass the date and get the added 15 days to it.

    /: PERFORM get_date IN PROGRAM zprogram

    /: USING &date&

    /: CHANGING &OUTVAR1&

    /: ENDPERFORM

    FORM GET_BARCODE TABLES IN_PAR STUCTURE ITCSY

    OUT_PAR STRUCTURE ITCSY.

    data: lc_15 type char2 value '15'.

    READ TABLE IN_PAR WITH KEY 'date'.

    if sy-subrc eq 0.

    OUT_PAR-value = in_par-value + lc_15.

    modify OUT_PAR.

    ENDFORM.

    Br,

    Laxmi

    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.