P_EBWIP_MaterialCostEstimate2

DDL: P_EBWIP_MATERIALCOSTESTIMATE2 SQL: PEBWIPMTCSTEST2 Type: view COMPOSITE Package: ODATA_CO_RT_WIP_REPORTING

Event-Based Work In Process Material Cost Estimate layer 2

P_EBWIP_MaterialCostEstimate2 is a Composite CDS View that provides data about "Event-Based Work In Process Material Cost Estimate layer 2" in SAP S/4HANA. It reads from 3 data sources (I_LedgerCompanyCodeCrcyRoles, I_MfgOrdPlngCat, P_EBWIP_MaterialCostEstimate1) and exposes 8 fields with key fields CompanyCode, Plant, ProducedProduct, CostEstimateValidityStartDate, CostEstimateValidityEndDate. Part of development package ODATA_CO_RT_WIP_REPORTING.

Data Sources (3)

SourceAliasJoin Type
I_LedgerCompanyCodeCrcyRoles _LedgerCompanyCodeCrcyRole inner
I_MfgOrdPlngCat _MfgOrdPlngCat inner
P_EBWIP_MaterialCostEstimate1 P_EBWIP_MaterialCostEstimate1 from

Parameters (3)

NameTypeDefault
P_KeyDate fins_fperiod_enddate
P_Ledger fins_ledger
P_CurrencyRole fac_crcyrole

Annotations (7)

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

Fields (8)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode _CostEstimate CompanyCode
KEY Plant Plant
KEY ProducedProduct ProducedProduct
KEY CostEstimateValidityStartDate CostEstimateValidityStartDate
KEY CostEstimateValidityEndDate CostEstimateValidityEndDate
KEY CostingLotSize CostingLotSize
KEY LotSizeUnit LotSizeUnit
KEY IsLotSizeIndependent IsLotSizeIndependent
@AbapCatalog.sqlViewName: 'PEBWIPMTCSTEST2'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey:true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@ClientHandling.algorithm: #SESSION_VARIABLE

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

define view P_EBWIP_MaterialCostEstimate2
  with parameters
    @Environment.systemField: #SYSTEM_DATE
    P_KeyDate      : fins_fperiod_enddate,
    P_Ledger       : fins_ledger,
    P_CurrencyRole : fac_crcyrole
  as select from P_EBWIP_MaterialCostEstimate1( P_KeyDate : :P_KeyDate,
                                                P_Ledger  : :P_Ledger ) as _CostEstimate
    inner join   I_LedgerCompanyCodeCrcyRoles                           as _LedgerCompanyCodeCrcyRole on  _LedgerCompanyCodeCrcyRole.CompanyCode = _CostEstimate.CompanyCode
                                                                                                      and _LedgerCompanyCodeCrcyRole.Ledger      = :P_Ledger
    inner join   I_MfgOrdPlngCat                                        as _MfgOrdPlngCat             on  _MfgOrdPlngCat.PlanningCategory               = _CostEstimate.PlanningCategory
                                                                                                      and _MfgOrdPlngCat.PlngCatIsForMatlCostEstPlnCost = 'X'
{
  key _CostEstimate.CompanyCode,
  key Plant,
  key ProducedProduct,
  key CostEstimateValidityStartDate,
  key CostEstimateValidityEndDate,
  key CostingLotSize,
  key LotSizeUnit,
  key IsLotSizeIndependent,

      cast(
        case :P_CurrencyRole
           when CompanyCodeCurrencyRole  then AmountInCompanyCodeCurrency
           when GlobalCurrencyRole       then AmountInGlobalCurrency
           when FreeDefinedCurrency1Role then AmountInFreeDefinedCurrency1
           when FreeDefinedCurrency2Role then AmountInFreeDefinedCurrency2
           when FreeDefinedCurrency3Role then AmountInFreeDefinedCurrency3
           when FreeDefinedCurrency4Role then AmountInFreeDefinedCurrency4
           when FreeDefinedCurrency5Role then AmountInFreeDefinedCurrency5
           when FreeDefinedCurrency6Role then AmountInFreeDefinedCurrency6
           when FreeDefinedCurrency7Role then AmountInFreeDefinedCurrency7
           when FreeDefinedCurrency8Role then AmountInFreeDefinedCurrency8
         else 0
      end as farp_amount_display_crcy) as AmountInDisplayCurrency
}
where
 ( (
        KeyDate                       <= $session.system_date
    and CostEstimateValidityStartDate <= KeyDate
    and CostEstimateValidityEndDate   >= KeyDate
  )
  or(
        KeyDate                       > $session.system_date
    and CostEstimateValidityStartDate <= $session.system_date
    and CostEstimateValidityEndDate   >= $session.system_date
  ) ) and CostEstimateValidityStartDate <> '00000000'