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 count periods elapsed

Former Member
0 Kudos

Hi SAPients!

Is there an FM to get the number of periods elapsed counting from one date or period.

Example:

If I send as parameter 200207 or 20020701 the FM should return 36, because 36 (monthly) periods have elapsed since then.

I tried SE37 but I can´t find the right one.

Or... do you know other way to do this?

Thank you.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Ricardo,

Try this one:

SD_DATETIME_DIFFERENCE

Give the difference in Days and Time for 2 dates

also check out :

DAYS_BETWEEN_TWO_DATES

Regards,

Anjali

3 REPLIES 3

Former Member
0 Kudos

Hi Ricardo,

Try this one:

SD_DATETIME_DIFFERENCE

Give the difference in Days and Time for 2 dates

also check out :

DAYS_BETWEEN_TWO_DATES

Regards,

Anjali

0 Kudos

Hi,

try fm FIMA_DAYS_AND_MONTHS_AND_YEARS

-> but i think, it's not exact, so you should try this:

mthp = ( ( sy-datum - p_datum ) /   ( 365 / 12 ) ).
month = trunc( mthp ).

regards Andreas

Former Member
0 Kudos

hi,

try these

HR_99S_MONTHS_BETWEEN_DATES

MONTHS_BETWEEN_TWO_DATES_NEW

MONTHS_BETWEEN_TWO_DATES

HR_MONTHS_BETWEEN_TWO_DATES

regards,

PJ