BSVW join over 2 tables giving unique key restraint

johndanter

johndanter

Legendary Poster
Hi folks,

I've made a rookie mistake in that I amended a BSVW by adding an extra table for UBE data selection and whilst this is fine for selection it started giving errors in a screen that also used the same BSVW.

I amended V30026B to not only look at F4105 but to join to F4102 so they could select on ANPL.
Then when P30026 tries to insert a record I got the duplicate key error on F4102 :( I wasn't paying enough attention to the mod sadly.

So I'd love it if it just inserted the new F4105 but left the F4102 alone.

Is there anyway around this kind of approach in E1 APPLs and BSVWs?

Thanks

John
 
John,

That is indeed a rookie type mistake. But I don't know of any non-rookies that haven't made such mistakes once in a while.

The problem here is that the link between the tables is a one (F4102) to many (F4105), thus you get duplicate occurrences of the F04102 row, which leads to the duplicate insert problem.

The first thing is to return the BSVW V30026B to it's original state, without the F4102.

The next thing is to somehow link the F4102 to the V30026B. I'm guessing that the UBE is also standard or at least existing, otherwise you would have created a custom BSVW to do what you want.

The only alternative that I have used in similar circumstances (you may have too) is to put the value(s) that you want to select on in processing option(s) and then code the link in the Do event for the section.

There are other possible/improbable solutions that are so far "out of the box" that they are on a different continent. They may involve more work than is sensible/practical and they may not actually be possible:

1) I have heard (but never done) that it is sometimes possible to change the BSVW by saving the UBE as a PAR file and expanding and editing the file(s). This comes with its risks.
2) Insert another section with a custom BSVW for both F4105 and F4102 with the appropriate data selection and call the original section and pass the BSVW key to select on for the original section. This also has risks.
 
Hi Peter,

Thanks for your reply. Yeah it's odd how you forget the basics if you don't do it often enough :)

Yeah I ended up making the BSVWs base again and leaving the screens alone and then cloning both the BSVWs (added F4102) and also the UBEs.
Then plugged in my clone BSVW to the new UBEs.

I've never fully tried the xml PAR file thing myself either. I did follow it for 5 minutes yesterday but reverted back to what I always do :)
Print the base code off, change my clone, validate the clone, then painstakingly go through data sequencing, data selection and then ER where BC/PC is referenced.
I actually had 2 FAT clients open and just matched them up that way.

All done now. I was just hoping of a smarter way in the future...other than disable add/update on grid and doing it via table I/O
 
Back
Top