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

Function module for date

Former Member
0 Likes
907

Dear all,

Could any one help me for below requirement..

I need a FM in which input is Current date, Number of months.

Output should be the date before the Number of months.

eg.

Input: Sy-datum 08.12.2006

No.of months 13

output: 01.11.2006

Thanks in advance.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
859

Hi,

Use the FM MONTH_PLUS_DETERMINE . Please supplu negative values of months your requirement will be fullfilled.

Regards

Bhupal Reddy

7 REPLIES 7
Read only

Former Member
0 Likes
860

Hi,

Use the FM MONTH_PLUS_DETERMINE . Please supplu negative values of months your requirement will be fullfilled.

Regards

Bhupal Reddy

Read only

0 Likes
859

I solved it my self..

CCM_GO_BACK_MONTHS

Thanks for ur answers..

Read only

0 Likes
859

Hi,

You can use :

RE_ADD_MONTH_TO_DATE

Enable to ADD / Substract month to date.

Erwan

Read only

Former Member
0 Likes
859

Hi,

try any of these

SG_PS_GET_LAST_DAY_OF_MONTH

RE_LAST_DAY_OF_MONTH

HR_HCP_GET_LAST_DAY_OF_MONTH

HRVE_LAST_DAY_OF_MONTH

RP_LAST_DAY_OF_MONTHS

SLS_MISC_GET_LAST_DAY_OF_MONTH

LAST_DAY_OF_MONTHS

WSAF_GET_LAST_DAY_OF_MONTH

regards,

pankaj singh

Read only

0 Likes
859
call function 'RP_CALC_DATE_IN_INTERVAL'
  exporting
    date      = sy-datum
    days      = 0
    months    = 11
    signum    = '-'
    years     = 0
  importing
    calc_date = wa_date.
Read only

Former Member
0 Likes
859

Hi,

Use the FM MONTH_PLUS_DETERMINE . Please supplu negative values of months your requirement will be fullfilled.

After this FM

Input: Sy-datum 08.12.2006

No.of months 13

output: 08.11.2006

Please add the following statement.

lv_output+6(2) = '01'.

Your requirement will be fullfilled.

Regards

Bhupal Reddy

Read only

Former Member
0 Likes
859

Hi Matt,

check this

REPORT YCHATEST LINE-SIZE 350.

DATA : V_DATE LIKE SY-DATUM.

CALL FUNCTION 'MONTH_PLUS_DETERMINE'
  EXPORTING
    MONTHS  = '-13'
    OLDDATE = SY-DATUM
  IMPORTING
    NEWDATE = V_DATE.

WRITE : / V_DATE.