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 FROM DATE & TIME

Former Member
0 Likes
12,544

Hi.

I need FM which will SUBTRACT TIME from DATE & TIME.

Example:

Date = 05.05.2007

Time = 05:00:00

Time_subtract = 48:00:00

Return of FM:

Date = 03.05.2007

Time = 05:00:00

Do you know any FM?

Thanks!

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
5,310

Hi,

Check the function module CATT_ADD_TO_TIME

Thanks

Naren

Hi.

I need FM which will SUBTRACT TIME from DATE & TIME.

Example:

Date = 05.05.2007

Time = 05:00:00

Time_subtract = 48:00:00

Return of FM:

Date = 03.05.2007

Time = 05:00:00

Do you know any FM?

Thanks!

9 REPLIES 9
Read only

Former Member
0 Likes
5,310

hi

good

i dont think there is anysuch function module which ll subtract time from date&time,you have to use the stringlength and separate the date and time value from a single value,.

thanks

mrutyun^

Read only

Former Member
0 Likes
5,311

Hi,

Check the function module CATT_ADD_TO_TIME

Thanks

Naren

Read only

Former Member
0 Likes
5,310

Hi Amit,

Check the FM SUBTRACT_TIME_FROM_DATE

it might be useful..

reward points if helpful.

regards,

ravi G

Read only

Former Member
0 Likes
5,310

Hi,

Please check this FM END_TIME_DETERMINE and use '-' (negative) to subtract with unit(HR).

(or)

SUBTRACT_TIME_FROM_DATE

<b>Reward points</b>

Regarsd

Read only

Former Member
0 Likes
5,310

Thanx for reply,

but I would like to receive explanation regarding use of these FMs, like how do u give inputs to these FMs, cause I've tested these FMs, but didnt get expected result

Thanx!

Read only

0 Likes
5,310

Hi, Check these function mod's

SD_DATETIME_DIFFERENCE

HRCM_TIME_PERIOD_CALCULATE

HR_ECM_GET_PERIOD_BETW_DATES

After you execute them in SE37 give the required input and you will get a correct output.

<b>REWARD IF USEFUL</b>

thanks n regards

Dinesh

Read only

Former Member
0 Likes
5,310

<b> START_TIME_DETERMINE</b>, FM gives correct result. Thanx fo reply.......

Read only

0 Likes
5,310

This message was moderated.

Read only

0 Likes
5,310

Best FM for subtracting time from timestamp /SCWM/RSRC_TIMESTAMP_SUBTRACT

This will give you output in timestamp