Skip to Content
0
Former Member
Jun 21, 2012 at 12:58 PM

SQL Abap brain teaser

52 Views

Hi all

I have to make a query on following Ztables:

ZTRAVEL - travel data (holding route identifier)

ZROUTE - route data (holding from_resort identifier and to_resort identifier)

ZRESORT - resort data (holding resort name)

What I would like to do is a generic query where constraints are travel data and resort name(in ZRESORT).

The problem is that a TRAVEL can exist without a ROUTE (start resort + arrive resort) ... for example, a user can create a travel saving only arrive and departure date.

If I make a big query binding ZTRAVEL to ZROUTE and ZROUTE twice to ZRESORT (one for start resort and the other for arrive resort name) eventual travel without route assigned will be cut out. If I use an OUTER options in join I cannot set constraints on joined fields table.

I tried also to create a maintainance view mixing all I need ( I read that for this kind of view are closer to what I need) but the problem is that I cannot put tables in join more times (as I need for resort).

Any idea or hint to get out of this trap ?

regards

Gabriele