P_INVPRICE_UNION_OLD

CDS View

P_INVPRICE_UNION_OLD is a CDS View in S/4HANA. 1 CDS views read from this table.

CDS Views using this table (1)

ViewTypeJoinVDMDescription
P_InventoryPriceByKeydate view from BASIC
@AbapCatalog.sqlViewName: 'PINVPRUNIOLD'
@AbapCatalog.preserveKey:true
@ClientHandling.algorithm: #SESSION_VARIABLE
@VDM.private: true
@VDM.viewType: #BASIC
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
define view P_InvPrice_Union_Old
  with parameters
    P_CalendarDate : calendardate

  as select from           ckmlhd                      as hd
    left outer to one join P_InvPrice_MaxFiscalYearPeriod(P_CalendarDate :
                           $parameters.P_CalendarDate) as zp on zp.CostEstimate = hd.kalnr
    left outer to one join ckmlcr                      as cr on  cr.kalnr = hd.kalnr
                                                             and cr.bdatj = left(
      zp.MaxFiscPerCKMLPP, 4
    )
                                                             and cr.poper = right(
      zp.MaxFiscPerCKMLPP, 3
    )
    left outer to one join ckmlpp                      as pp on  pp.kalnr = hd.kalnr
                                                             and pp.bdatj = left(
      zp.MaxFiscPerCKMLPP, 4
    )
                                                             and pp.poper = right(
      zp.MaxFiscPerCKMLPP, 3
    )

    left outer to one join t001k                       as tk on hd.bwkey = tk.bwkey
  association [0..1] to R_LedgerValuationCrcyRole as _CurrencyInfo on _CurrencyInfo.LedgerValuationCurrencyRole = cr.curtp
  association [0..1] to I_MatlLedgerValnCrcyRoleName as _MLCurrencyInfo on  _MLCurrencyInfo.LedgerValuationCurrencyRole = cr.curtp
                                                                        and _MLCurrencyInfo.CompanyCode = tk.bukrs

{

  key  hd.kalnr                                                    as CostEstimate,
  key  coalesce(_MLCurrencyInfo.Ledger, cast('  ' as fins_ledger)) as Ledger,
  key  cr.curtp                                                    as CurrencyRole,

       zp.MaxFiscPerCKMLPP                                         as MaxFiscPerCKMLPP,
       cr.poper                                                    as FiscalPeriod,
       cr.bdatj                                                    as FiscalYear,
       hd.matnr                                                    as Material,
       hd.bwkey                                                    as ValuationArea,
       hd.bwtar                                                    as InventoryValuationType,
       hd.vbeln                                                    as SalesOrder,
       hd.posnr                                                    as SalesOrderItem,
       hd.lifnr                                                    as Supplier,
       hd.pspnr                                                    as WBSElementInternalID,
       tk.bukrs                                                    as CompanyCode,
       pp.meins                                                    as BaseUnit,
       hd.sobkz                                                    as InventorySpecialStockType,
       hd.kzbws                                                    as InventorySpecialStockValnType,
       hd.xobew                                                    as IsSupplierStockValuation,
       hd.mlast                                                    as PriceDeterminationControl,
       hd.price_sdm_yearper                                        as MatlPrcMigratedUntilFsclYrPerd,
       cr.vprsv                                                    as MaterialPriceControl,
       coalesce(cr.peinh, 1)                                       as MaterialPriceUnitQty,
       cr.waers                                                    as Currency,
       @Semantics.amount.currencyCode: 'Currency'
       case cr.vprsv
         when 'S' then coalesce(cr.stprs, 0)
         when 'V' then coalesce(cr.pvprs, 0)
         else coalesce(cr.stprs, 0)
       end                                                         as InventoryPrice,
       @Semantics.amount.currencyCode: 'Currency'
       cr.stprs                                                    as StandardPrice,
       @Semantics.amount.currencyCode: 'Currency'
       cr.pvprs                                                    as MovingAveragePrice,

       _MLCurrencyInfo.LedgerName                                  as LedgerName,
       _CurrencyInfo.CurrencyRoleName                              as CurrencyRoleName,
       _CurrencyInfo.LegalCurrencyRole                             as LegalCurrencyRole,
       _CurrencyInfo.LegalCurrencyRoleName                         as LegalCurrencyRoleName,
       cast(_CurrencyInfo.AccountingValuationView as fins_valutyp) as AccountingValuationView,
       _CurrencyInfo.AcctgValnVwSubviewCombinedName                as AcctgValnVwSubviewCombinedName,
       _MLCurrencyInfo.LedgerValnCrcyRoleIsUsedInLogs              as LedgerValnCrcyRoleIsUsedInLogs

}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_MATLLEDGERVALNCRCYROLENAME",
"P_INVPRICE_MAXFISCALYEARPERIOD",
"R_LEDGERVALUATIONCRCYROLE",
"CKMLCR",
"CKMLHD",
"CKMLPP",
"T001K"
],
"ASSOCIATED":
[
"I_MATLLEDGERVALNCRCYROLENAME",
"R_LEDGERVALUATIONCRCYROLE"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/