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 that converts days to months

Former Member
0 Likes
3,807

Hi Folks,

Can anybody tell me function module that converts days to months. For example 120 days to be converted into months.

Thanks,

Vijay.

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,756

If you have the start date and end date, you may be able to use one of these.

MONTHS_BETWEEN_TWO_DATES

MONTHS_BETWEEN_TWO_DATES_NEW

Regards,

Rich Heilman

Hi Folks,

Can anybody tell me function module that converts days to months. For example 120 days to be converted into months.

Thanks,

Vijay.

5 REPLIES 5
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,757

If you have the start date and end date, you may be able to use one of these.

MONTHS_BETWEEN_TWO_DATES

MONTHS_BETWEEN_TWO_DATES_NEW

Regards,

Rich Heilman

Read only

Former Member
0 Likes
1,756

Hi,

but how u will determine teh starting date?

DATE_COMPUTE_DAY – Finds day of the month

DATE_CONV_EXT_TO_INT - user formatted date is converted to system date

DATE_GET_WEEK - convert date into year + week format

DATE_TO_DAY – gives weekday from date

DATE_IN_FUTURE – takes number of days and date - gives future date in user format and system format

MONTH_PLUS_DETERMINE – add or subtract month from a date

RP_CALC_DATE_IN_INTERNAL – add/subtract year/month/days from a date

WEEK_GET_FIRST_DAY – take input as YYYYWW and it gives first day of the week.

MONTH_NAMES_GET – language is only parameter. Returns internal table with months.

MONTH_PLUS_DETERMINE – subtract months from date

Read only

Former Member
0 Likes
1,756

hi Vijay,

we have a FM to know the number of months between two dates

here are those

FIMA_DAYS_AND_MONTHS_AND_YEARS

MONTHS_BETWEEN_TWO_DATES

Regards,

Santosh

Read only

Former Member
0 Likes
1,756

without start date it is not possible to find out that as you may not know between which months these dates fall, if u want approx.., then just divide that by 30

v_months = 120 / 30.

Read only

Former Member
0 Likes
1,756
data : count(100),
         quotinent(10),
         reminder(10),
         date(10) .
 
 quotinent = date / 30.

 reminder = date mod 30. 

 concatenate 'Number of months are ' quotinent ' and ' reminder ' days' into count.
  
  write : count.

Regards,

Santosh