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 constraint 2 for custom tables

Former Member
0 Kudos

Hi

Generally we activate time constraints for (custom) infotypes. But in one of the requirements we need to activate time constraint 2, for one of the custom table which is having both BEGDA and ENDDA (primary keys). When I tried to use TOTAL and EXTRACT structures in Table events (new entry event) its working fine (during save). But when I go back and see the table contents, changes will not be present.

Can any one please let me know the exact procedure to activating time constraint 2 for custom tables .

Your help is much appreciated .

Many Thanks

Sunny

3 REPLIES 3

Former Member
0 Kudos

Hi, you can add a control in the event to validate whether the begin and end dates of newly entered are not overlapping with existing record.

By this way you can achieve time constraint 2 for custom table.  Check and let me know if further inputs required.

0 Kudos

Hi Surendra,

Could you please provide a reference document or link for the same

Thanks

0 Kudos

Hi,

  I hope you aware of event concept.

  You can try with '05 - creating new entry' event with the following code:

* check for overlap as follows

  LOOP AT total      "total contains the data already stored in table

       WHERE <other key fields comparision>

             AND endda GE <current record-begda>

             AND begda LE <current record-endda>.

*     If control comes here means there is overlapping, so raise error message.      

  ENDLOOP.

* if control doesn't go inside the loop means there is no overlapping and it should be saved that's it.

Hope it is clear.  Try this and let me know if any issues.