P_SECURITYPRICEDATE

DDL: P_SECURITYPRICEDATE SQL: PSECPRICEDATE Type: view COMPOSITE

P_SECURITYPRICEDATE is a Composite CDS View in SAP S/4HANA. It reads from 2 data sources (I_CalendarDate, I_SECURITYPRICE) and exposes 5 fields with key fields SecurityClass, SecurityExchange, SecurityClassPriceType, KeyDate.

Data Sources (2)

SourceAliasJoin Type
I_CalendarDate _CalendarDate from
I_SECURITYPRICE SECURITYPRICE left_outer

Parameters (1)

NameTypeDefault
P_KeyDate vdm_v_key_date

Annotations (7)

NameValueLevelField
AbapCatalog.sqlViewName PSECPRICEDATE view
ClientHandling.algorithm #SESSION_VARIABLE view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #NOT_REQUIRED view
VDM.viewType #COMPOSITE view
ObjectModel.usageType.serviceQuality #B view
VDM.private true view

Fields (5)

KeyFieldSource TableSource FieldDescription
KEY SecurityClass I_SECURITYPRICE SecurityClass
KEY SecurityExchange I_SECURITYPRICE SecurityExchange
KEY SecurityClassPriceType I_SECURITYPRICE SecurityClassPriceType
KEY KeyDate I_CalendarDate CalendarDate
TreasuryPriceDate
@AbapCatalog.sqlViewName: 'PSECPRICEDATE'
@ClientHandling.algorithm: #SESSION_VARIABLE
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@VDM.viewType: #COMPOSITE
@ObjectModel.usageType.serviceQuality: #B
@VDM.private:true
define view P_SECURITYPRICEDATE 
    with parameters
        @Environment.systemField: #SYSTEM_DATE
        P_KeyDate : vdm_v_key_date
        as select from I_CalendarDate   as _CalendarDate
       left outer join I_SECURITYPRICE  as SECURITYPRICE on _CalendarDate.CalendarDate >= SECURITYPRICE.TreasuryPriceDate                                                                     
    {
        key SECURITYPRICE.SecurityClass,
        key SECURITYPRICE.SecurityExchange, 
        key SECURITYPRICE.SecurityClassPriceType,
        key _CalendarDate.CalendarDate as KeyDate,
        max(SECURITYPRICE.TreasuryPriceDate) as TreasuryPriceDate

    }
    where
            _CalendarDate.CalendarDate <= $parameters.P_KeyDate
        and _CalendarDate.CalendarDate >= SECURITYPRICE.TreasuryPriceDate         
    group by 
        SECURITYPRICE.SecurityClass,
        SECURITYPRICE.SecurityExchange,
        SECURITYPRICE.SecurityClassPriceType,
        _CalendarDate.CalendarDate

/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_CALENDARDATE",
"I_SECURITYPRICE"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/