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

Former Member
0 Likes
881

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
Read only

Former Member
0 Likes
788

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
Read only

Former Member
0 Likes
789

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

Read only

0 Likes
788

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

Read only

Former Member
0 Likes
788

hi,

try these

HR_99S_MONTHS_BETWEEN_DATES

MONTHS_BETWEEN_TWO_DATES_NEW

MONTHS_BETWEEN_TWO_DATES

HR_MONTHS_BETWEEN_TWO_DATES

regards,

PJ