**********************************CDS_VIEW************************************************
@AbapCatalog.sqlViewName: 'ZCDS1SIMP'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Simple CDS View'
define view Z_CDS1_Simp
as select from sflight
key lower(carrid) as lowerCarrid, //lower(),upper(),concat()
key connid as Connid,
key fldate as Fldate,
floor(price) as roundPrice, // floor(),ceil(),round(,2)
currency as cdsCurrency,
planetype as cdsPlanetype,
seatsmax as cdsSeatsmax,
seatsocc as cdsSeatsocc,
paymentsum as cdsPaymentsum,
seatsmax_b as cdsSeatsmaxB,
seatsocc_b as cdsSeatsoccB,
seatsmax_f as cdsSeatsmaxF,
seatsocc_f as cdsSeatsoccF,
case // case , ifnull
when seatsocc > seatsmax then 'Full'
when seatsocc < seatsmax then 'Not Available'
else 'Invalid'
end as flightstatus
}
Driver Program –
REPORT z_amdp_oop_dp.
z_amdp_oop_ns=>get_flight_details(
EXPORTING
iv_client = sy-mandt
IMPORTING
et_result = DATA(it_result)
).
cl_demo_output=>display_data( value = it_result ).