P_Matval_Manage_Val_Chart

DDL: P_MATVAL_MANAGE_VAL_CHART SQL: PMATVALMGMVCH Type: view COMPOSITE Package: ODATA_MATVAL_MANAGE

Base View for Mat.Val., Balances

P_Matval_Manage_Val_Chart is a Composite CDS View that provides data about "Base View for Mat.Val., Balances" in SAP S/4HANA. It reads from 4 data sources (I_FiscalYearPeriodForCmpnyCode, I_MatlLedgerValnCrcyRoleName, P_MatlCtrlRecdLdgrFiscalPeriod, I_MaterialLedgerPrice) and exposes 10 fields with key fields CostEstimate, FiscalYear, FiscalPeriod, LedgerValuationCurrencyRole, ValuationArea. It has 2 associations to related views. Part of development package ODATA_MATVAL_MANAGE.

Data Sources (4)

Associations (2)

CardinalityTargetAliasCondition
[0..1] I_MaterialLedgerPrice _ACT _ACT.CostEstimate = price.CostEstimate and _ACT.CurrencyRole = price.CurrencyRole and _ACT.Ledger = price.Ledger and _ACT.MaterialPriceType = 'ACT' and _ACT.MaterialPriceSubtype = 'ACT' and _ACT.MatlPrcValdtyStrtFsclYearPerd <= price.MatlPrcValdtyStrtFsclYearPerd and _ACT.MatlPrcValdtyEndFsclYearPeriod >= price.MatlPrcValdtyEndFsclYearPeriod
[0..1] I_MaterialLedgerPrice _MAP _MAP.CostEstimate = price.CostEstimate and _MAP.CurrencyRole = price.CurrencyRole and _MAP.Ledger = price.Ledger and _MAP.MaterialPriceType = 'MAP' and _MAP.MaterialPriceSubtype = '' and _MAP.MatlPrcValdtyStrtFsclYearPerd <= price.MatlPrcValdtyStrtFsclYearPerd and _MAP.MatlPrcValdtyEndFsclYearPeriod >= price.MatlPrcValdtyEndFsclYearPeriod

Annotations (7)

NameValueLevelField
AbapCatalog.compiler.compareFilter true view
AbapCatalog.sqlViewName PMATVALMGMVCH view
AccessControl.authorizationCheck #NOT_REQUIRED view
ClientHandling.algorithm #SESSION_VARIABLE view
VDM.private true view
VDM.viewType #COMPOSITE view
VDM.lifecycle.status #DEPRECATED view

Fields (10)

KeyFieldSource TableSource FieldDescription
KEY CostEstimate I_MaterialLedgerPrice CostEstimate
KEY FiscalYear I_FiscalYearPeriodForCmpnyCode FiscalYear
KEY FiscalPeriod I_FiscalYearPeriodForCmpnyCode FiscalPeriod
KEY LedgerValuationCurrencyRole I_MatlLedgerValnCrcyRoleName LedgerValuationCurrencyRole
KEY ValuationArea I_MaterialLedgerPrice ValuationArea
KEY CompanyCode I_MaterialLedgerPrice CompanyCode
FiscalYearPeriod I_FiscalYearPeriodForCmpnyCode FiscalYearPeriod
InventoryPrice I_MaterialLedgerPrice MaterialPrice
CompanyCodeCurrency I_MaterialLedgerPrice Currency
MaterialPrice0endasMovingAveragePrice
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.sqlViewName: 'PMATVALMGMVCH'

@AccessControl.authorizationCheck: #NOT_REQUIRED

@ClientHandling.algorithm: #SESSION_VARIABLE

@VDM.private: true
@VDM.viewType: #COMPOSITE

@VDM.lifecycle.status: #DEPRECATED

define view P_Matval_Manage_Val_Chart
  as select from           I_MaterialLedgerPrice          as price

    //  inner join             marv                                                       as mv         on mv.bukrs = price.CompanyCode

    inner join             P_MatlCtrlRecdLdgrFiscalPeriod as marvld
      on  marvld.CompanyCode = price.CompanyCode
      and marvld.Ledger      = price.Ledger

    inner join             I_FiscalYearPeriodForCmpnyCode as fyp
      on  fyp.CompanyCode = price.CompanyCode
      and price.MatlPrcValdtyStrtFsclYearPerd  <= fyp.FiscalYearPeriod
      and price.MatlPrcValdtyEndFsclYearPeriod >= fyp.FiscalYearPeriod
      and fyp.FiscalYearPeriod                 <= marvld.CurrentFiscalYearPeriod
      and fyp.FiscalYearPeriod                 >= concat(marvld.PreviousFiscalYear, marvld.CurrentFiscalPeriod)
      and fyp.IsSpecialPeriod                   = ''

    inner join             I_MatlLedgerValnCrcyRoleName   as lvcr
      on  lvcr.CompanyCode  = price.CompanyCode
      and lvcr.Ledger       = price.Ledger
      and lvcr.CurrencyRole = price.CurrencyRole

    left outer to one join I_MatlValnSemKeyMappg          as hd
      on price.CostEstimate = hd.CostEstimate

  association [0..1] to I_MaterialLedgerPrice as _ACT
    on  _ACT.CostEstimate                    = price.CostEstimate
    and _ACT.CurrencyRole                    = price.CurrencyRole
    and _ACT.Ledger = price.Ledger
    and _ACT.MaterialPriceType               = 'ACT'
    and _ACT.MaterialPriceSubtype            = 'ACT'
    and _ACT.MatlPrcValdtyStrtFsclYearPerd  <= price.MatlPrcValdtyStrtFsclYearPerd
    and _ACT.MatlPrcValdtyEndFsclYearPeriod >= price.MatlPrcValdtyEndFsclYearPeriod

  association [0..1] to I_MaterialLedgerPrice as _MAP
    on  _MAP.CostEstimate                    = price.CostEstimate
    and _MAP.CurrencyRole                    = price.CurrencyRole
    and _MAP.Ledger = price.Ledger
    and _MAP.MaterialPriceType               = 'MAP'
    and _MAP.MaterialPriceSubtype            = ''
    and _MAP.MatlPrcValdtyStrtFsclYearPerd  <= price.MatlPrcValdtyStrtFsclYearPerd
    and _MAP.MatlPrcValdtyEndFsclYearPeriod >= price.MatlPrcValdtyEndFsclYearPeriod

{
  key price.CostEstimate,
  key fyp.FiscalYear                   as FiscalYear,
  key fyp.FiscalPeriod                 as FiscalPeriod,
  key lvcr.LedgerValuationCurrencyRole as LedgerValuationCurrencyRole,
  key price.ValuationArea,
  key price.CompanyCode                as CompanyCode,

      fyp.FiscalYearPeriod             as FiscalYearPeriod,
      price.MaterialPrice              as InventoryPrice,
      price.Currency                   as CompanyCodeCurrency,

      case price.MaterialPriceControl
       when 'S'
           then case hd.PriceDeterminationControl
               when '2' then coalesce(_MAP.MaterialPrice, 0)
               when '3' then coalesce(_ACT.MaterialPrice, 0)
           end
       when 'V'
           then coalesce(price.MaterialPrice, 0)
       end                             as MovingAveragePrice
}

where price.MaterialPriceType    = 'INVPR'
  and price.MaterialPriceSubtype = ' '