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: 

SD_DATETIME_DIFFERENCE

Former Member
0 Kudos

hi,

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

Ananda

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi herath,

1. The parameters of type

DATE and TIME only.

D = Date

T = Time

regards,

amit m.

Simha_
Employee
Employee
0 Kudos

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.

Former Member
0 Kudos

Hi,

Importing parameter are date and time only.

Exporting Parameter ARE PACKED NUMBER AND CHAR

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

0 Kudos

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.