@AbapCatalog.sqlViewName: 'ZCDS_ASSOC11'
define view zcds_assoc1 as select from scarr as sca
association [0..1] to spfli as _spfli
on sca.carrid = _spfli.carrid
{ * }
@AbapCatalog.sqlViewName: 'ZCDS_ASSOC41'
@AccessControl.authorizationCheck: #NOT_REQUIRED
define view zcds_assoc4 as select from sairport as sair
association [1..*] to spfli as _spfli on
$projection.airportfrom = _spfli.airpfrom
{
sair.id as airportfrom,
sair.name,
sair.time_zone,
-- exposing association
_spfli
}
@AbapCatalog.sqlViewName: 'ZCDS_ASSOC21'
@AccessControl.authorizationCheck: #NOT_REQUIRED
define view zcds_assoc2 as select from spfli
association to sflight as _sfli on
spfli.carrid = _sfli.carrid and
spfli.connid = _sfli.connid
association [1..1] to sairport as _sair on
$projection.airportfrom = _sair.id
{
spfli.carrid,
spfli.connid,
spfli.airpfrom as airportfrom,
-- exposing association
_sfli,
_sair
}
@AbapCatalog.sqlViewName: 'ZCDS_ASSOC31'
@AccessControl.authorizationCheck: #NOT_REQUIRED
define view zcds_assoc3 as select from scarr
association [1..1] to zcds_assoc2 as _cdsassoc on
$projection.carrierid = _cdsassoc.carrid
{
scarr.carrid as carrierid,
-- Exposing Association
_cdsassoc
}
DATA(w_dbfeature) = cl_abap_dbfeatures=>use_features( requested_features = VALUE #( ( cl_abap_dbfeatures=>views_with_parameters ) ) ).
IF w_dbfeature IS NOT INITIAL.
SELECT carrierid ,
\_cdsassoc\_sfli-fldate AS flightdate,
\_cdsassoc\_sair-name AS flightname
FROM zcds_assoc3
WHERE carrierid = @carrid
INTO TABLE @DATA(t_data1).
ENDIF.
@AbapCatalog.sqlViewName: 'ZCDS_ON_ASSOC1'
define view zcds_on_assoc with parameters airport: S_FROMAIRP as select from zcds_assoc2 as cds2
{
cds2.carrid,
cds2.connid,
cds2.airportfrom,
cds2._sair.name, -- use inner join...by default association uses left outer join
cds2._sfli.planetype
}
where cds2.airportfrom = :airport
@AbapCatalog.sqlViewName: 'ZCDS_ON_ASSOC41'
define view zcds_on_assoc4 with parameters airport: S_FROMAIRP as select from zcds_assoc4 as cds_assoc
{
cds_assoc.airportfrom,
cds_assoc.name,
cds_assoc.time_zone,
cds_assoc._spfli.carrid -- use inner join...by default association uses left outer join
}
where cds_assoc.airportfrom = :airport
@AbapCatalog.sqlViewName: 'ZCDS_ON_ASSOC41'
define view zcds_on_assoc4 with parameters airport: S_FROMAIRP as select from zcds_assoc4 as cds_assoc
{
cds_assoc.airportfrom,
cds_assoc.name,
cds_assoc.time_zone,
cds_assoc._spfli[inner].carrid -- use inner join...by default association uses left outer join
}
where cds_assoc.airportfrom = :airport
@AbapCatalog.sqlViewName: 'ZCDS_ASSOC_FILT'
define view ZCDS_ASSOC_FILTER as select from zcds_assoc2 as cds2
{
cds2._sair[ id = 'TYO' ].name,
cds2._sfli.planetype
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
8 | |
5 | |
5 | |
4 | |
4 | |
4 | |
4 | |
3 | |
3 | |
3 |