Google Search - Blog...........

ABAP - How To Add / Substract Dates, Months, Years To A Given Date.

report zdates.



parameters:p_date type sy-datum ,

p_days type T5A4A-DLYDY,

p_month type T5A4A-DLYMO,

p_year type T5A4A-DLYYR .

skip.



parameters:add type T5A4A-SPLIT radiobutton group g1 ,

sub type T5A4A-SPLIT radiobutton group g1.





data: calc_date type sy-datum,

days type T5A4A-DLYDY,

months type T5A4A-DLYMO,

years type T5A4A-DLYYR ,

sign type T5A4A-SPLIT .



if add = 'X'.

sign = '+'.

else.

sign = '-'.

endif .



CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'

EXPORTING

date = p_date

days = p_days

months = p_month

SIGNUM = sign

years = p_year

IMPORTING

CALC_DATE = CALC_DATE

.

write:/ calc_date .

No comments:

Post a Comment