‎2009 Apr 06 9:24 AM
Hi,
I have a requirement in which I have a database table in which we store limits as below
CustGrp From To
A1 0 1000
A2 1001 2000
And so on.
My requirement is that when a user enters these limits through SM30 then we have to make a check that "NO TWO RANGES FOR DIFFERENT CustGrp ARE OVERLAPPING". I want to use Extended Table Maintenance Generator Events. Please Let me Know can we do this and how??
Thanks In Advance
Regards
Braham
‎2009 Apr 06 9:36 AM
Hi,
For this you should go to se11->utilities->table maintaince generatot->enviroment->modification->events.
create a new form routine according to the event. And in the editor you should write logic
Between
form
...
endform.
Regards,
Nitin
‎2009 Apr 06 9:42 AM
Hi Nitin,
I have created the event, But I am not able to compare the field of two records in that. How to do that can you provide the code for that???
‎2009 Apr 06 9:43 AM
Hi,
On further explaination to above information. When we give the name of the event say check_range then in the editor we need to explicitly mention the
form check_range.
....
...
.
Endform.
Else it will not be activated.
Regards,
Nitin
‎2009 Apr 06 9:44 AM
‎2009 Apr 06 9:50 AM
See my requirement is that .....
I have 3 fields CUSTGRP, FROM, TO
Lets take RECORD 1 : A1-0-1000
RECORD 2 : A2-1001-2000
Record 3 : A3-500-3000
If you see 'record 3' which has a (range from 500 to 3000) which overlaps with Rec 1 and Rec 2.......
Now if the user enters or updates an entry then we need to make sure there is no overlaping and give an error message.
Hope you get the requirement.
‎2009 Apr 06 9:52 AM
Hi,
I can provide you the pseduo code.
1) Fetch all the entries in the database table into internal table say INT1 and take another internal table INT2 of same type.
2) loop at int1 into wa_int1.
*here we will check that if the entry with same range is already existing intable or not.
read table int1 with key int1-from = wa_int1-from
int1-to = wa_int1-to.
if sy-subrc = 0.
*if it is already existing than we wil ldisplay messeage
error message.
else.
*else we will append to another internal table.
append wa_int1 into Int2.
endif.
endloop.
Hope it will work for you.
Regards,
Nitin.
‎2009 Apr 06 9:58 AM
I understand your code but have one doubt how will we see which entry us new and which is updated.......
‎2009 Apr 06 10:08 AM