cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding to logic

Former Member
0 Kudos

Hi All,

Having doubt in ranges ?

im having variable date1 which carries value sy-datlo.

for ex : 12.02.2008

My requirment is i want date that shoul be exactly less than 1000 days by the current system date(date1)

Regards,

Murthy

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

date1 = sy-datum - 1000.

Plzz reward points if it helps.

Answers (5)

Answers (5)

Former Member
0 Kudos

hi Murthy,

do this way


data: date like sy-datum,
date1 like sy-datum.

date = sy-datum. " here pass ur i/p

CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
EXPORTING
date = date
days = 1000 "days to be added
months = 00
SIGNUM = '-' "add(+) or substract(-)
years = 00
IMPORTING
CALC_DATE = date1. " new date

write:/ 'new date', date1[/code].
 

pass the i/p as a parameter

Former Member
0 Kudos

hi,

First convert your date to local format using fm 'CONVERT_DATE_TO_INTERNAL' , then subtract 1000 from that again convert date to external format using fm 'CONVERT_DATE_TO_EXTERNAL'.

Rgds,

Bujji

Former Member
0 Kudos



    CALL FUNCTION 'DAYS_BETWEEN_TWO_DATES'
      EXPORTING
        i_datum_bis             = sy-datum
        i_datum_von             = date1
      IMPORTING
        e_tage                  = lv_day
      EXCEPTIONS
        days_method_not_defined = 1
        OTHERS                  = 2.
    IF sy-subrc EQ 0.
      IF lv_day > '1000'.
* show eror message 
      ENDIF.
    ENDIF.

Former Member
0 Kudos

Hi,

You can make use of FM CALCULATE_DATE. (By using this FM you can increase or decrease no. of days from the given date).

Thanks,

Sriram Ponna.

Former Member
0 Kudos

Hi,

use this FM

HR_SEN_CALE_DAYS_DATE

 Import parameters               Value

 ID_DATE                         10.02.2008
 ID_OPERATOR                     -
 IS_DURATION                         0.0000     0.0000    1,000.0000


 Export parameters               Value

 ED_DATE                         17.05.2005

Cheers,

jose.

Edited by: jose on Feb 12, 2008 11:08 AM