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

former_member532868
Participant
0 Kudos

Hi Experts

I need function module for between two dates.

Example : If i gave from date 010420008

and To date 31052008

then i need to convert days only

Result = 61 days

if any body knows based on above functionalty then send immediatly that function module name.Its urgent requirement.

Regards,

Hari

11 REPLIES 11

Former Member
0 Kudos

USe functaion module 'HR_HK_DIFF_BT_2_DATES

peter_ruiz2
Active Contributor
0 Kudos

hi,

HR_HK_DIFF_BT_2_DATES

regards,

Peter

Former Member
0 Kudos

Hi,

Use Function module RP_CALC_DATA_IN_INTERVAL

Regards.

GauthamV
Active Contributor
0 Kudos

hi,

HR_MX_INTERVAL_BETWEEN_DATES.

Former Member
0 Kudos

Hi Prasad,

Try this code :

select-options:
  s_date for sy-datum.

data :
  w_days type i.

w_days = s_date-high - s_date-low.

  write 😕 w_days.

Regards,

Swapna.

Former Member
0 Kudos

hi,

Use the FM 'HR_SGPBS_YRS_MTHS_DAYS'.

Hope this will Help.

Regards

Sumit Agarwal

Former Member
0 Kudos

Hiii!

Use this function module

HR_HK_DIFF_BT_2_DATES

Regards

Abhijeet

Former Member
0 Kudos

hi prasad,

use this FM

HR_HK_DIFF_BT_2_DATES

C14B_DIFF_BT_2_DATES

Regards,

sandeep

Former Member
0 Kudos

Hi,

refer to following

  • Type in two date and find the difference between the two dates in

  • days, months and years.

REPORT ZDATEDIFF.

DATA: EDAYS LIKE VTBBEWE-ATAGE,

EMONTHS LIKE VTBBEWE-ATAGE,

EYEARS LIKE VTBBEWE-ATAGE.

PARAMETERS: FROMDATE LIKE VTBBEWE-DBERVON,

TODATE LIKE VTBBEWE-DBERBIS DEFAULT SY-DATUM.

call function 'FIMA_DAYS_AND_MONTHS_AND_YEARS'

exporting

i_date_from = FROMDATE

i_date_to = TODATE

  • I_FLG_SEPARATE = ' '

IMPORTING

E_DAYS = EDAYS

E_MONTHS = EMONTHS

E_YEARS = EYEARS.

WRITE:/ 'Difference in Days ', EDAYS.

WRITE:/ 'Difference in Months ', EMONTHS.

WRITE:/ 'Difference in Years ', EYEARS.

INITIALIZATION.

FROMDATE = SY-DATUM - 60.

Reward pts. if usefull.

Regards,

Dhan

Former Member
0 Kudos

Hi,

Use the FM '/SDF/CMO_DATETIME_DIFFERENCE'.

Thanks.

Former Member
0 Kudos

try this FM

HR_HK_DIFF_BT_2_DATES

if helpful plz reward me