Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

date.

Former Member
0 Likes
869

Hi all,

Could u tell me how to add/subtract some no of months to a particular date and get the resulting date..

Thanks

Ananda

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
835

Use the below function module...

data : wa_date type sy-datum.

call function 'RP_CALC_DATE_IN_INTERVAL'

exporting

date = sy-datum

days = 0

months = 6

years = 0

signum = '+'

importing

calc_date = wa_date.

<b>signum = '+' " add month

signum = '-' " subtract month</b>

Pl. award points if useful.

7 REPLIES 7
Read only

Former Member
0 Likes
836

Use the below function module...

data : wa_date type sy-datum.

call function 'RP_CALC_DATE_IN_INTERVAL'

exporting

date = sy-datum

days = 0

months = 6

years = 0

signum = '+'

importing

calc_date = wa_date.

<b>signum = '+' " add month

signum = '-' " subtract month</b>

Pl. award points if useful.

Read only

Former Member
0 Likes
835

Hi,

you can use these two funcion odules.

CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'

EXPORTING

DATE = IT_HEADER-INVOICE_DATE

DAYS = '00'

MONTHS = '01'

SIGNUM = '-'

YEARS = '00'

IMPORTING

CALC_DATE = BILLING_PERIOD-LOW

CALL FUNCTION 'HR_SEN_CALE_DAYS_DATE'

EXPORTING

ID_DATE = V_DATE

ID_OPERATOR = '+'

IS_DURATION = V_DURATION

IMPORTING

ED_DATE = V_PAYMENT_DUE

EXCEPTIONS

CONVERSION_NOT_SPECIFIED = 1

CONVERSION_NOT_POSSIBLE = 2

OTHERS = 3.

IF SY-SUBRC <> 0.

reward if you find this helpful.

regards,

sumit

Message was edited by: sumit kumar

Read only

Former Member
0 Likes
835

Hi,

Copy and paste this code.

REPORT ZTEST .

data : l_month type i value '2'.

data : l_date type sy-datum value '20060505',

l_date_new type sy-datum.

CALL FUNCTION 'RE_ADD_MONTH_TO_DATE'

EXPORTING

MONTHS = l_month

OLDDATE = l_date

IMPORTING

NEWDATE = l_date_new.

write : l_date_new.

Message was edited by: mukesh kumar

Read only

Laxmana_Appana_
Active Contributor
0 Likes
835

Hi,

Use the FM's:

MONTH_PLUS_DETERMINE

CCM_GO_BACK_MONTHS

Laxman

Read only

Simha_
Product and Topic Expert
Product and Topic Expert
0 Likes
835

Hi,

Use F.M <b>HR_99S_INTERVAL_BETWEEN_DATES</b>

Cheers,

Simha.

Read only

Former Member
0 Likes
835

Hi,

Use FM

MONTH_PLUS_DETERMINE.

Regards,

Shashank

Read only

Former Member
0 Likes
835

Hi Herath,

U can use this function module :

BKK_ADD_MONTH_TO_DATE

U can pass negative values to deduct and positive values to add months to the date.