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

SD_DATETIME_DIFFERENCE

Former Member
0 Likes
4,240

hi,

what are the parameters for this FM? & their data types.

Ananda

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,108

Hi

This is the interface:

FUNCTION SD_DATETIME_DIFFERENCE.

*"----


""Lokale Schnittstelle:

*" IMPORTING

*" VALUE(DATE1) TYPE D

*" VALUE(TIME1) TYPE T

*" VALUE(DATE2) TYPE D

*" VALUE(TIME2) TYPE T

*" EXPORTING

*" VALUE(DATEDIFF) TYPE P

*" VALUE(TIMEDIFF) TYPE P

*" VALUE(EARLIEST) TYPE C

*" EXCEPTIONS

*" INVALID_DATETIME

So the type D is datum (so those parameters are dates), type T is for time, type P is for number.

Max

8 REPLIES 8
Read only

Former Member
0 Likes
2,108

Hi herath,

1. The parameters of type

DATE and TIME only.

D = Date

T = Time

regards,

amit m.

Read only

Simha_
Product and Topic Expert
Product and Topic Expert
0 Likes
2,108

Hi,

data and time are the parameters for the input..

eg:

date1 = 25.06.2006

time1 = 02.21.90

date2 = 26.06.2006

time2 = 02.25.90

Cheers,

Simha.

Read only

Former Member
0 Likes
2,108

Hi,

Importing parameter are date and time only.

Exporting Parameter ARE PACKED NUMBER AND CHAR

Read only

Former Member
0 Likes
2,109

Hi

This is the interface:

FUNCTION SD_DATETIME_DIFFERENCE.

*"----


""Lokale Schnittstelle:

*" IMPORTING

*" VALUE(DATE1) TYPE D

*" VALUE(TIME1) TYPE T

*" VALUE(DATE2) TYPE D

*" VALUE(TIME2) TYPE T

*" EXPORTING

*" VALUE(DATEDIFF) TYPE P

*" VALUE(TIMEDIFF) TYPE P

*" VALUE(EARLIEST) TYPE C

*" EXCEPTIONS

*" INVALID_DATETIME

So the type D is datum (so those parameters are dates), type T is for time, type P is for number.

Max

Read only

Former Member
0 Likes
2,108

Hi,

The parameters for this FM are

DATE1 type d

TIME1 type t

DATE2 type d

TIME2 type t

Exporting param

DATEDIFF type p

TIMEDIFF type p

Rgds,

prakash

Read only

Former Member
0 Likes
2,108

Hi,

This FM takes two date and two time and returns the difference between the two.

You have to pass all the 4 values to get the result

Sameena

Read only

Former Member
0 Likes
2,108

Hai Ananda

Check the following Code

Data : tndr_expd type dats,

tndr_expt type tims.

DATA earliest.

CALL FUNCTION 'SD_DATETIME_DIFFERENCE'

EXPORTING

DATE1 = p_zvttk-tndr_expd

TIME1 = p_zvttk-tndr_expt

DATE2 = sy-datlo

TIME2 = sy-timlo

IMPORTING

EARLIEST = earliest

EXCEPTIONS

INVALID_DATETIME = 1

OTHERS = 2.

IF earliest = '1'.

p_status = overdue.

ENDIF.

Thanks & regards

Sreenivasulu P

Read only

0 Likes
2,108

Hello,

The problem with this function module is:

1. It will return only the Days and Hours. It will not give the minutes and seconds.

2. If one time is not available then it will not return anything. Therefore all 4 fields must have some values other than 0.

Can someone please tell me if i can get the Minutes and Seconds also ? This function is still lagging with the Minutes and seconds though it gets the minutes and seconds in the input field.

Thanks.