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

subtract time

Former Member
0 Likes
671

subtract 30 sec to the existing date and time.

i need the new output in date and time format.

is there any function module.

3 REPLIES 3
Read only

athavanraja
Active Contributor
0 Likes
480

check out this FM for adding seconds to date time

C14Z_CALC_DATE_TIME

you copy it and modify to do subtraction.

Regards

Raja

Read only

0 Likes
480

i am getting the write output after modifying the FM

C14Z_CALC_DATE_TIME

Read only

0 Likes
480

Try this out

C14B_ADD_TIME

*" IMPORTING

*" VALUE(I_STARTTIME) TYPE T

*" VALUE(I_STARTDATE) TYPE D

*" VALUE(I_ADDTIME) TYPE T

*" EXPORTING

*" VALUE(E_ENDTIME) TYPE T

*" VALUE(E_ENDDATE) TYPE D

*"----


DATA : DIFFERENZ TYPE I.

E_ENDTIME = I_STARTTIME + I_ADDTIME.

DIFFERENZ = E_ENDTIME - I_STARTTIME.

IF DIFFERENZ < 0.

E_ENDDATE = I_STARTDATE + 1.

ELSE.

E_ENDDATE = I_STARTDATE.

ENDIF.

ENDFUNCTION.

U try to change for subtraction.

Also reward points and close the thread if answered.

Thanks & Regards,

Judith.