P_InvPricesMaxFis

DDL: P_INVPRICESMAXFIS SQL: PINVPRMAXFIS Type: view COMPOSITE

P_InvPricesMaxFis is a Composite CDS View in SAP S/4HANA. It reads from 8 data sources and exposes 9 fields with key field CostEstimate.

Data Sources (8)

SourceAliasJoin Type
I_MLInventoryPriceRawData cr inner
ckmlhd hd inner
ckmlhd hd inner
I_MatlLedgerValnCrcyRoleName lcurtp inner
P_MLValAreaMaxPeriod P_MLValAreaMaxPeriod from
I_MaterialLedgerPrice price union_all
R_MatlPriceDataMigrationStatus tf inner
R_MatlPriceDataMigrationStatus tf inner

Parameters (1)

NameTypeDefault
P_CalendarDate calendardate

Annotations (7)

NameValueLevelField
AbapCatalog.sqlViewName PINVPRMAXFIS view
VDM.private true view
VDM.viewType #COMPOSITE view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #NOT_REQUIRED view
ClientHandling.algorithm #SESSION_VARIABLE view
AbapCatalog.preserveKey true view

Fields (9)

KeyFieldSource TableSource FieldDescription
KEY CostEstimate it CostEstimate
ValuationArea it ValuationArea
InventoryPrice I_MLInventoryPriceRawData InventoryPrice
Currency I_MLInventoryPriceRawData Currency
CostEstimate
ValuationArea I_MaterialLedgerPrice ValuationArea
InventoryPrice I_MaterialLedgerPrice MaterialPrice
Currency I_MaterialLedgerPrice Currency
MaterialPriceUnitQty I_MaterialLedgerPrice MaterialPriceUnitQty
@AbapCatalog.sqlViewName: 'PINVPRMAXFIS'
@VDM.private: true
@VDM.viewType: #COMPOSITE
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@ClientHandling.algorithm: #SESSION_VARIABLE
@AbapCatalog.preserveKey:true 
define view P_InvPricesMaxFis

  with parameters
    P_CalendarDate : calendardate

  as select from P_MLValAreaMaxPeriod(P_CalendarDate : $parameters.P_CalendarDate) as it
    inner join   R_MatlPriceDataMigrationStatus as tf on(
      tf.MatlPriceDataMigrationStatus                                                   = 'X'
    )
                                                      or(
                                                        tf.MatlPriceDataMigrationStatus = 'R'
                                                      )                                                                            
    inner join   ckmlhd                     as hd on hd.kalnr = it.CostEstimate
    inner join   I_MLInventoryPriceRawData  as cr on  cr.CostEstimate  = it.CostEstimate
                                                  and ToFiscalYearPeriod = cr.FiscalYearPeriod
{
  key it.CostEstimate,
      it.ValuationArea,
      cr.InventoryPrice,
      cr.Currency,
      cr.MaterialPriceUnitQty
}
where ( ( hd.price_sdm_yearper = '0000000' or hd.price_sdm_yearper > ToFiscalYearPeriod ) or tf.MatlPriceDataMigrationStatus = 'X' )


union all
 select from I_MaterialLedgerPrice            as price
  inner join R_MatlPriceDataMigrationStatus as tf on(
    tf.MatlPriceDataMigrationStatus                                                 = 'F'
  )
                                                  or(
                                                    tf.MatlPriceDataMigrationStatus = 'R'
                                                  )                                                                              
  inner join ckmlhd                           as hd         on hd.kalnr = price.CostEstimate
  inner join I_MatlLedgerValnCrcyRoleName     as lcurtp     on lcurtp.CompanyCode  = price.CompanyCode
                                                           and lcurtp.CurrencyRole = price.CurrencyRole
                                                           and lcurtp.Ledger       = price.Ledger
                                                           and lcurtp.LedgerValnCrcyRoleIsUsedInLogs = 'X'
{
  key price.CostEstimate,
      price.ValuationArea,
      price.MaterialPrice as InventoryPrice,
      price.Currency,
      price.MaterialPriceUnitQty
}
where ( ( hd.price_sdm_yearper <> '0000000' and hd.price_sdm_yearper <= price.MatlPrcValdtyStrtFsclYearPerd ) or tf.MatlPriceDataMigrationStatus = 'F' ) 

   and price.MaterialPriceType = 'INVPR'
   and price.MaterialPriceSubtype = ' '
   and price.MaterialPriceValidityStartDate <= :P_CalendarDate
   and price.MaterialPriceValidityEndDate   >= :P_CalendarDate
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_MATERIALLEDGERPRICE",
"I_MATLLEDGERVALNCRCYROLENAME",
"I_MLINVENTORYPRICERAWDATA",
"P_MLVALAREAMAXPERIOD",
"R_MATLPRICEDATAMIGRATIONSTATUS",
"CKMLHD"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/