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

Help comparing periods

Former Member
0 Likes
553

Hi people! I need a little help.

I have an first task save for a PERNR in period:

begin

10.21.2008

08:00:00 AM

end

10.23.2008

05:00:00 PM

So, in this period of begin until end, the PERNR will be occupied with this planned task.

So, he try to save a second registry:

begin

10.22.2008

08:00:00 AM

end

10.22.2008

05:00:00 PM

In this case, I have to block this save, because it will be in the periodo planned for the first.

Anyone can help me how I can do this? How can I check if a new period is inside a saved period? There is a standard function for this?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
529

First you should not allow any writes for a user that has an open time and no corresponding closing time,as you don't know when it will finish.

Second you should check for new_event_ending_time < old_event_starting_time OR new_event_starting time > old_event_ending_time.

Hi people! I need a little help.

I have an first task save for a PERNR in period:

begin

10.21.2008

08:00:00 AM

end

10.23.2008

05:00:00 PM

So, in this period of begin until end, the PERNR will be occupied with this planned task.

So, he try to save a second registry:

begin

10.22.2008

08:00:00 AM

end

10.22.2008

05:00:00 PM

In this case, I have to block this save, because it will be in the periodo planned for the first.

Anyone can help me how I can do this? How can I check if a new period is inside a saved period? There is a standard function for this?

3 REPLIES 3
Read only

Former Member
0 Likes
529

Hi Jack,

Just select all records for the employee, and check if the start date of the new record is > begin date AND the end date of the new record is < end date of an existing record. If so, then the new record falls inside an already saved period.

SL

Read only

0 Likes
529

@SL - I don't think this takes care of the time.

Rob

Read only

Former Member
0 Likes
530

First you should not allow any writes for a user that has an open time and no corresponding closing time,as you don't know when it will finish.

Second you should check for new_event_ending_time < old_event_starting_time OR new_event_starting time > old_event_ending_time.