0% found this document useful (0 votes)
425 views

Numeric Functions in ABAP CDS

This CDS view joins the SFLIGHT and SPFLI tables to select flight data including airfare price, distance, currency, plane type, seats, and countries. Various mathematical operations are applied to selected fields, including ceiling, flooring, division, modulo, rounding, and absolute value. The view can be filtered by an optional display currency parameter.

Uploaded by

bipin012
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
425 views

Numeric Functions in ABAP CDS

This CDS view joins the SFLIGHT and SPFLI tables to select flight data including airfare price, distance, currency, plane type, seats, and countries. Various mathematical operations are applied to selected fields, including ceiling, flooring, division, modulo, rounding, and absolute value. The view can be filtered by an optional display currency parameter.

Uploaded by

bipin012
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

@AbapCatalog.

sqlViewName: 'ZSFLIGHTVIEW'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Flight CDS View with parameter'
@VDM.viewType: #BASIC
view Zflight_View //with parameters p_displaycurrency : displaycurrency
as select from sflight inner join //inner Join
spfli on sflight.carrid = spfli.carrid and spfli.connid = sflight.connid
{
key sflight.carrid ,
key sflight.connid ,
key sflight.fldate ,
spfli.distance as DISTANCE,
sflight.price as Airfare,
/*Ceil and Floor*/
ceil(sflight.price) as Ceil,
floor(sflight.price) as Floor,
/*Division*/
div( spfli.distance , sflight.price ) as Div_Op,
division(sflight.seatsocc ,sflight.seatsmax, 3) as Div_Op2,
/*mod*/
MOD(sflight.seatsmax,sflight.seatsocc ) as MOD,
/*Round*/
ROUND(sflight.price,1 ) as round,
/*ABS*/
abs(-2) as Abs,

sflight.currency as FareCurrency,
sflight.planetype as PlaneCategory,
sflight.seatsmax as MaxAvailableSeats,
sflight.seatsocc as OccupiedSeats ,
spfli.countryfr as COUNTRYFR,
spfli.countryto as COUNTRYTO

You might also like