P_CmmdtyHdgFinTransQuantitySum

DDL: P_CMMDTYHDGFINTRANSQUANTITYSUM Type: view COMPOSITE

P_CmmdtyHdgFinTransQuantitySum is a Composite CDS View in SAP S/4HANA. It reads from 4 data sources (I_CommodityHedgePlanExposure, I_CmmdtyHdgExpsrRelByDteCmpst, I_CmmdtyHdgHdggArRelByDteCmpst, P_CmmdtyHdgCnstltnFinTransQty) and exposes 6 fields with key field CommodityHedgePlanExposureID.

Data Sources (4)

SourceAliasJoin Type
I_CommodityHedgePlanExposure cm_exposure inner
I_CmmdtyHdgExpsrRelByDteCmpst I_CmmdtyHdgExpsrRelByDteCmpst inner
I_CmmdtyHdgHdggArRelByDteCmpst I_CmmdtyHdgHdggArRelByDteCmpst inner
P_CmmdtyHdgCnstltnFinTransQty P_CmmdtyHdgCnstltnFinTransQty from

Parameters (1)

NameTypeDefault
P_EvalDate dats

Annotations (10)

NameValueLevelField
AbapCatalog.sqlViewName PCMMFTRANSQSUM view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
AccessControl.authorizationCheck #NOT_REQUIRED view
VDM.viewType #COMPOSITE view
VDM.private true view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #L view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
ClientHandling.algorithm #SESSION_VARIABLE view

Fields (6)

KeyFieldSource TableSource FieldDescription
KEY CommodityHedgePlanExposureID fintran_qty CommodityHedgePlanExposureID
FinancialTransactionQuantity
FinTransDesignatedQuantity
FinTransPlndDesignatedQuantity
UnitOfMeasure fintran_qty UnitOfMeasure
_CM_Exposure fintran_qty _CM_Exposure
@AbapCatalog: { sqlViewName:            'PCMMFTRANSQSUM',
                compiler.compareFilter: true,
                preserveKey:            true }

@AccessControl.authorizationCheck: #NOT_REQUIRED

@VDM: { viewType: #COMPOSITE,
        private:  true }

@ObjectModel.usageType: { serviceQuality: #C,
                          sizeCategory:   #L,
                          dataClass:      #TRANSACTIONAL }

@ClientHandling.algorithm: #SESSION_VARIABLE

//@EndUserText.label: 'Commodity Hedge Const. Trans. Quant. Sum'


define view P_CmmdtyHdgFinTransQuantitySum
  with parameters
    @Environment.systemField: #SYSTEM_DATE
    P_EvalDate : dats

  as select from P_CmmdtyHdgCnstltnFinTransQty(P_EvalDate:$parameters.P_EvalDate)     as fintran_qty

    inner join   I_CmmdtyHdgExpsrRelByDteCmpst( P_EvalDate : $parameters.P_EvalDate ) as cm_exp_last_released on cm_exp_last_released.CommodityHedgePlanExposureID = fintran_qty.CommodityHedgePlanExposureID

    inner join   I_CommodityHedgePlanExposure                                         as cm_exposure          on cm_exposure.CommodityHedgePlanExposureUUID = cm_exp_last_released.CommodityHedgePlanExposureUUID

    inner join   I_CmmdtyHdgHdggArRelByDteCmpst( P_EvalDate : $parameters.P_EvalDate) as hedging_area         on hedging_area.HedgingAreaIdentification = cm_exposure.CmmdtyHdgPlnExpsrHedgingArea
{
  key fintran_qty.CommodityHedgePlanExposureID,

      @Semantics.quantity.unitOfMeasure: 'UnitOfMeasure'
      sum( fintran_qty.FinancialTransactionQuantity )     as FinancialTransactionQuantity,
      @Semantics.quantity.unitOfMeasure: 'UnitOfMeasure'
      sum( fintran_qty.FinTransDesignatedQuantity       ) as FinTransDesignatedQuantity,
      @Semantics.quantity.unitOfMeasure: 'UnitOfMeasure'
      sum( fintran_qty.FinTransPlndDesignatedQuantity )   as FinTransPlndDesignatedQuantity,

      @Semantics.unitOfMeasure: true
      fintran_qty.UnitOfMeasure,

      /* Associations */
      fintran_qty._CM_Exposure
}
where
       fintran_qty.CommodityHedgePlanExposureID   is not null
  and  fintran_qty.CmmdtyHdgCnstltnProductArea    =  'CTY'
  and  fintran_qty.CmmdtyHdgConstellationDealRole <> 'OFFSETTING'
  and  fintran_qty.CompanyCode                    =  fintran_qty.CmmdtyHdgPlnExpsrCompanyCode
  and(
       fintran_qty.TreasuryValuationArea          is null
    or fintran_qty.TreasuryValuationArea          =  hedging_area.HdggAreaLeadingValuationArea
  )
  and(
       fintran_qty.HedgingRelationshipStatus      is null
    or fintran_qty.HedgingRelationshipStatus      <> '02' // 02 = Revoked

  )
group by
  fintran_qty.CommodityHedgePlanExposureID,
  fintran_qty.UnitOfMeasure
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_CMMDTYHDGEXPSRRELBYDTECMPST",
"I_CMMDTYHDGHDGGARRELBYDTECMPST",
"I_COMMODITYHEDGEPLANEXPOSURE",
"P_CMMDTYHDGCNSTLTNFINTRANSQTY"
],
"ASSOCIATED":
[
"I_CMMDTYHDGPLNEXPSRLASTRELD"
],
"BASE":
[
"P_CMMDTYHDGCNSTLTNFINTRANSQTY"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/