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

Overlapping Entries

Former Member
0 Likes
1,652

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

8 REPLIES 8
Read only

Former Member
0 Likes
1,221

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

Read only

Former Member
0 Likes
1,221

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???

Read only

Former Member
0 Likes
1,221

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

Read only

Former Member
0 Likes
1,221

PLease elaborate me on the requirement once.

Read only

Former Member
0 Likes
1,221

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.

Read only

Former Member
0 Likes
1,221

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.

Read only

Former Member
0 Likes
1,221

I understand your code but have one doubt how will we see which entry us new and which is updated.......

Read only

Former Member
0 Likes
1,221

This message was moderated.