Skip to Content
author's profile photo Former Member
Former Member

Time minus 30 minutes?

Hi, Guru:

I defeine one parameter as the following:

p_etime TYPE uzeit DEFAULT sy-uzeit.

I want to minus 30 minutes on p_etime field.

I can take hours, minutes and second from p_etime. then minutes=minutes-30.

Is there any short way to do that. call function module ....?

Thanks,

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Nov 29, 2007 at 02:04 PM

    what is the time format u r giving suppose if u r giving like 12:30:00

    now move the 30 into one variable and suppress 30 from this and if it is lessthan thirty find how many minutes short to thirty suppose ( 12:25:00)

    for this u have to 30-25 = 5 to one varible and decrease 5 from 60 and decrease hours by1 i.e 11.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 29, 2007 at 01:58 PM

    Yunfa,

    I dont recall any function module that does this. But I can give you the code which does this.

    REPORT  ZTEST_TEST.
    
    DATA : time type sy-uzeit.
    data : time1(2) type c.
    break akumar.
    time = sy-uzeit.
    
    time1 = time+2(2) - 30.
    
    write : time.
    
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
      EXPORTING
        INPUT         = time1
     IMPORTING
       OUTPUT        = time1
              .
    
    
    CONCATENATE time+0(2) time1 time+4(2) into time.
    
    WRITE / time.

    Regards

    Aneesh.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 29, 2007 at 02:01 PM

    try C14Z_CALC_DATE_TIME

    also TIMESTAMP_DURATION_SUB

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 29, 2007 at 02:01 PM

    Hi,

    data : time1 like sy-uzeit,

    time2 like sy-uzeit.

    time1 = '080000'.

    time2 = '003000'.

    time1 = time1 - time2.

    Regards,

    Nicolas

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 29, 2007 at 02:11 PM

    Hi Yunfa,

    try:

    subtract 1800 from p_etime.

    That is, the time minus 1800 seconds.

    Rgrs.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 29, 2007 at 08:49 PM

    data: t_uzeit type uzeit.

    t_uzeit = sy-uzeit.

    t_uzeit = t_uzeit - 1800.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.