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

Former Member
0 Likes
530

Hi all,

I wanted to know the function module which will return the number of months between the given years .......

Also if you can give me the parameters which are necessary to pass......

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
499

Jayant

MONTH_PLUS_DETERMINE

Add or subtract months from a date. To subtract a month, enter a negative value for the 'months' parameter.

2 REPLIES 2
Read only

Former Member
0 Likes
500

Jayant

MONTH_PLUS_DETERMINE

Add or subtract months from a date. To subtract a month, enter a negative value for the 'months' parameter.

Read only

0 Likes
499
data: duration_in_months type i.

parameters: s_date type sy-datum,
            e_date type sy-datum.

call function 'DURATION_DETERMINE'
 exporting
   unit                             = 'MON'
   factory_calendar                 = 'IN'    "  Your factory calendar
 importing
   duration                         = duration_in_months
 changing
   start_date                       = s_date
   end_date                         = e_date
 exceptions
   factory_calendar_not_found       = 1
   date_out_of_calendar_range       = 2
   date_not_valid                   = 3
   unit_conversion_error            = 4
   si_unit_missing                  = 5
   parameters_not_valid             = 6
   others                           = 7.


   write:/ duration_in_months.