0% found this document useful (0 votes)
9 views2 pages

CDS View

The document defines a simple CDS view named Z_CDS1_Simp that selects and transforms data from the sflight table, including fields like carrier ID, connection ID, flight date, and various seat counts. It also includes a case statement to determine flight status based on seat occupancy. Additionally, a driver program is provided to export flight details and display the results.

Uploaded by

me.thirumalai
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views2 pages

CDS View

The document defines a simple CDS view named Z_CDS1_Simp that selects and transforms data from the sflight table, including fields like carrier ID, connection ID, flight date, and various seat counts. It also includes a case statement to determine flight status based on seat occupancy. Additionally, a driver program is provided to export flight details and display the results.

Uploaded by

me.thirumalai
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

**********************************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 ).

You might also like