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

Function module to get time taking into account breaks

Former Member
0 Likes
638

Hello,

Does anybody know any function module to retrieve a finish date and finish time according to the initial date, the initial time and the shift time?

I know:

  • Initial date DD/MM/YYYY
  • Initial time HH:MM:SS
  • Time: minutes
  • Shift time: the job can only be scheduled from 8:00 -13:00 and 14:45-18:00

I would like to get:

  • Finish date DD/MM/YYYY
  • Finish time: HH:MM:SS

So, if the job begins at:

  • Initial date: 31/01/2013
  • Initial time: 17:55
  • Time to finish: 30 minutes
  • Shift time: 8:00 -13:00 and 14:45-18:00

The function module should give the following result:

  • Finish date: 01/02/2013
  • Finish time: 8:25

Is it possible?

Thanks in advance,

Oscar

Hello,

Does anybody know any function module to retrieve a finish date and finish time according to the initial date, the initial time and the shift time?

I know:

  • Initial date DD/MM/YYYY
  • Initial time HH:MM:SS
  • Time: minutes
  • Shift time: the job can only be scheduled from 8:00 -13:00 and 14:45-18:00

I would like to get:

  • Finish date DD/MM/YYYY
  • Finish time: HH:MM:SS

So, if the job begins at:

  • Initial date: 31/01/2013
  • Initial time: 17:55
  • Time to finish: 30 minutes
  • Shift time: 8:00 -13:00 and 14:45-18:00

The function module should give the following result:

  • Finish date: 01/02/2013
  • Finish time: 8:25

Is it possible?

Thanks in advance,

Oscar

3 REPLIES 3
Read only

Former Member
0 Likes
566

No answers?

Read only

0 Likes
566

Hi Oscar,

There is no standard function module that suits your requirement

But refer to Standard function module CATT_ADD_TO_TIME and you can copy this function module to a custom function module.

The function module has the code as follows

DATA: LOW-DATE TYPE D VALUE '19000101'.
DATA: S(16) TYPE P.
S = ( IDATE - LOW-DATE ) * 86400 + ITIME.
S = S + STDAZ * 3600.
EDATE = LOW-DATE + ( S DIV 86400 ).
ETIME = S MOD 86400.

You will just need to replace the seconds 86400 to the seconds of the shift hours 5 hrs ( 18000 seconds). 

Hope this helps. Let me know if additional info is required.

Thanks,

Tooshar Bendale

Read only

0 Likes
566

Thank you Tooshar.