Application Development 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: 

Function Module to find 3 months Old Date

Former Member
0 Kudos

Is there any function module to find out 3 months old date for a todays date....Pls Help me......

1 ACCEPTED SOLUTION

former_member208856
Active Contributor
0 Kudos

Hi,

use function module : J_1H_CAL_DATE_IN_INTERVAL

use code as below :

data : date type sy-datum, out_date type sy-datum.

date = '20070702'.

CALL FUNCTION 'J_1H_CAL_DATE_IN_INTERVAL'

EXPORTING

date = date

days = '00'

months = '03'

SIGNUM = '-'

years = '00'

IMPORTING

CALC_DATE = out_date.

write 😕 out_date.

Sandeep Kaushik

Message was edited by:

Sandeep Kaushik

7 REPLIES 7

Former Member
0 Kudos

Hi

Check the fun module

<b>CCM_GOBACK_MONTHS

Reward points for useful Answers</b>

Regards

Anji

Former Member
0 Kudos

Hi,

try this CALL FUNCTION 'MONTH_PLUS_DETERMINE'

(Or)

RP_CALC_DATE_IN_INTERVAL.

<b>Reward points</b>

Regards

Former Member
0 Kudos

CCM_GO_BACK_MONTHS

regards,

Omkar.

Message was edited by:

Omkaram Yanamala

Former Member
0 Kudos

Hi Wood,

Check this Link,

https://forums.sdn.sap.com/click.jspa?searchID=3584656&messageID=2480568

Thanks,

Reward If Helpful.

Former Member
0 Kudos

data:

find_date like sy-datum.

CALL FUNCTION 'MONTH_PLUS_DETERMINE'

EXPORTING

MONTHS = -3

OLDDATE = sy-datum

IMPORTING

NEWDATE = find_date

.

write sy-datum.

write find_date.

former_member208856
Active Contributor
0 Kudos

Hi,

use function module : J_1H_CAL_DATE_IN_INTERVAL

use code as below :

data : date type sy-datum, out_date type sy-datum.

date = '20070702'.

CALL FUNCTION 'J_1H_CAL_DATE_IN_INTERVAL'

EXPORTING

date = date

days = '00'

months = '03'

SIGNUM = '-'

years = '00'

IMPORTING

CALC_DATE = out_date.

write 😕 out_date.

Sandeep Kaushik

Message was edited by:

Sandeep Kaushik

Former Member
0 Kudos

Hi,

Try using this FM:

'RP_CALC_DATE_IN_INTERVAL'

call function 'RP_CALC_DATE_IN_INTERVAL'

exporting

date = v_date "input ddmmccyy

days = '90'

months = '00'

signum = '-'

years = '00'

importing

calc_date = v_date

exceptions

others = 1.

PS:REWARD POINTS IF HELPFUL!!!

Regards,

Krithiga