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 needed

Former Member
0 Likes
785

Hi all,,

Please advise me the function module that we help me to find the difference between two dates and would give the result or output as a date.

am working on a HR program.

Thanks in adv.

1 ACCEPTED SOLUTION
Read only

former_member156446
Active Contributor
0 Likes
761

CALL FUNCTION 'HR_SGPBS_YRS_MTHS_DAYS' " find the difference between review date and current date.

EXPORTING

beg_da = sy-datum

end_da = v_review_date

IMPORTING

no_day = v_diff_days

no_month = v_diff_months

no_year = v_diff_year

6 REPLIES 6
Read only

former_member156446
Active Contributor
0 Likes
762

CALL FUNCTION 'HR_SGPBS_YRS_MTHS_DAYS' " find the difference between review date and current date.

EXPORTING

beg_da = sy-datum

end_da = v_review_date

IMPORTING

no_day = v_diff_days

no_month = v_diff_months

no_year = v_diff_year

Read only

Former Member
0 Likes
761

use SD_DATETIME_DIFFERENCE

Read only

Former Member
0 Likes
761

Hi Naveena,

Once you get the difference between two dates it will become no. of days. How can it will again be a date?

Regards,

Atish

Read only

Nawanandana
Active Contributor
0 Likes
761

hi

data : w_date TYPE I .

CALL FUNCTION 'HR_SGPBS_YRS_MTHS_DAYS'

EXPORTING

beg_da = cl_date " input begeing date

end_da = s_indate " input end date

IMPORTING

  • NO_DAY = NO_DAY

  • NO_MONTH = NO_MONTH

  • NO_YEAR = NO_YEAR

NO_CAL_DAY = w_date.

u can get the date difereant using w_date. u hv to get interget value for that u cant get the diferant as a date.. its imposible..

regard

nawa

Read only

Former Member
0 Likes
761

Hi

The difference between 2 dates can only be days and not a date.

Thanks

Vijay

Read only

Former Member
0 Likes
761

hi,

try:

HR_HK_DIFF_BT_2_DATES : Find the difference between two dates in years, months and days.

reward points if helpful..