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: 

Time Subtraction

Former Member
0 Kudos

Hi,

I want to subtract time

eg.

Subtracting 12 hrs from date 01.01.2008 and time 05:00:00

should give date 31.12.2007 and time 17:00:00

Please, tell me is there any FM available for the same?

Thanks,

Alok

1 ACCEPTED SOLUTION

former_member705122
Active Contributor
0 Kudos

Hi,

IGN_TIMESTAMP_PLUSMINUS

Regards

Adil

5 REPLIES 5

former_member181995
Active Contributor
0 Kudos

CALL FUNCTION 'SUBTRACT_TIME_FROM_DATE'

EXPORTING

i_idate = sy-datum

i_time = 2

i_iprkz = '3'

IMPORTING

o_idate = p_datef

EXCEPTIONS

invalid_period = 1

invalid_round_up_rule = 2

internal_error = 3

OTHERS = 99.

Edited by: Amit Gujargoud on Sep 4, 2008 8:19 AM

0 Kudos

Dear Amit,

Thanks for the help but its not working

Former Member
0 Kudos

Hi,

Use this: SUBTRACT_TIME_FROM_DATE

Regards

jana

former_member705122
Active Contributor
0 Kudos

Hi,

IGN_TIMESTAMP_PLUSMINUS

Regards

Adil

Former Member
0 Kudos

Try using the class CL_ABAP_TSTMP.

~Piyush Patil