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

Compare 2 date

Former Member
0 Likes
825

Hi All,

I need to get a FM that can help me to calculate the diff between 2 date by return the result in hours:

Start date = 01.12.2007

Start time = 10:00:00

End date = 02.12.2007

End time = 01:00:00

Result should be 15:00:00.

Please comment.

Thanks in advance.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
801

Hi ,

You can try this function module

'L_TO_TIME_DIFF'

In the field "i_time_uom " give the unit of measure

H -hours

d- days

s - seconds.

Regards,

Mandeep

7 REPLIES 7
Read only

Former Member
0 Likes
801

Use FM: SCOV_TIME_DIFF

Read only

Former Member
0 Likes
801

Hi,

Check the below FM's.

SD_DATETIME_DIFFERENCE,

/SDF/CMO_DATETIME_DIFFERENCE

Rgds,

Bujji

Read only

Former Member
0 Likes
801

Hi

Check this FM..

Its as per ur rqmt..

/SDF/CMO_DATETIME_DIFFERENCE

Thanks

Praveen

Read only

former_member195383
Active Contributor
0 Likes
801

Refer to the thread

It contains solution for ur problem.

<REMOVED BY MODERATOR>

Regards

Rudra

Edited by: Alvaro Tejada Galindo on Feb 20, 2008 9:29 AM

Read only

Former Member
0 Likes
802

Hi ,

You can try this function module

'L_TO_TIME_DIFF'

In the field "i_time_uom " give the unit of measure

H -hours

d- days

s - seconds.

Regards,

Mandeep

Read only

0 Likes
801

Points awarded to all of you. Thanks.

Read only

Former Member
0 Likes
801

hi

Hope it will help you.

<REMOVED BY MODERATOR>

Use this Function Module :-


CALL FUNCTION *'DAYS_BETWEEN_TWO_DATES'*
  EXPORTING
    i_datum_bis                   = wa_projcode-tasenddate
    i_datum_von                   = wa_projcode-tasstdate
*   I_KZ_EXCL_VON                 = '0'
*   I_KZ_INCL_BIS                 = '0'
*   I_KZ_ULT_BIS                  = ' '
*   I_KZ_ULT_VON                  = ' '
*   I_STGMETH                     = '0'
*   I_SZBMETH                     = '1'
 IMPORTING
   E_TAGE                        = wa_projcode-days
* EXCEPTIONS
*   DAYS_METHOD_NOT_DEFINED       = 1
*   OTHERS                        = 2
          .
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

Edited by: Alvaro Tejada Galindo on Feb 20, 2008 9:35 AM