Skip to Content
avatar image
Former Member

Time Subtraction

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

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

4 Answers

  • Best Answer
    avatar image
    Former Member
    Sep 04, 2008 at 06:34 AM

    Hi,

    IGN_TIMESTAMP_PLUSMINUS

    Regards

    Adil

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 04, 2008 at 06:18 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 04, 2008 at 06:19 AM

    Hi,

    Use this: SUBTRACT_TIME_FROM_DATE

    Regards

    jana

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 04, 2008 at 06:39 AM

    Try using the class CL_ABAP_TSTMP.

    ~Piyush Patil

    Add comment
    10|10000 characters needed characters exceeded