P_EBOC_PlanCostEstimate2

DDL: P_EBOC_PLANCOSTESTIMATE2 SQL: PEBOCPLNCOSTEST2 Type: view COMPOSITE

P_EBOC_PlanCostEstimate2 is a Composite CDS View in SAP S/4HANA. It reads from 3 data sources (I_LedgerCompanyCodeCrcyRoles, I_MfgOrdPlngCat, P_EBOC_PlanCostEstimate1) and exposes 24 fields with key fields OrderID, OrderItem, CompanyCode, PlanningCategory, CostElement.

Data Sources (3)

SourceAliasJoin Type
I_LedgerCompanyCodeCrcyRoles _LedgerCompanyCodeCrcyRole inner
I_MfgOrdPlngCat _MfgOrdPlngCat inner
P_EBOC_PlanCostEstimate1 P_EBOC_PlanCostEstimate1 from

Parameters (3)

NameTypeDefault
P_OrderID fis_order_number
P_Ledger fins_ledger
P_CurrencyRole fac_crcyrole

Annotations (7)

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

Fields (24)

KeyFieldSource TableSource FieldDescription
KEY OrderID _CostEstimate OrderID
KEY OrderItem _CostEstimate OrderItem
KEY CompanyCode _CostEstimate CompanyCode
KEY PlanningCategory _CostEstimate PlanningCategory
KEY CostElement CostElement
KEY BusinessTransactionCategory BusinessTransactionCategory
KEY ControllingDebitCreditCode ControllingDebitCreditCode
KEY AccountAssignmentType AccountAssignmentType
KEY PartnerAccountAssignmentType PartnerAccountAssignmentType
KEY PartnerCostCenter PartnerCostCenter
KEY PartnerCostCtrActivityType PartnerCostCtrActivityType
KEY PartnerOrder PartnerOrder
KEY CostSourceUnit CostSourceUnit
KEY Material Material
KEY WorkCenterInternalID WorkCenterInternalID
KEY OrderOperation OrderOperation
KEY Plant Plant
KEY ControllingArea ControllingArea
KEY IsLotSizeIndependent IsLotSizeIndependent
KEY CostOriginGroup _CostEstimate CostOriginGroup
KEY OriginCostCenter OriginCostCenter
KEY OriginCostCtrActivityType OriginCostCtrActivityType
dec148asCostRateFixedAmount
TotalQuantity TotalQuantity
@AbapCatalog.sqlViewName: 'PEBOCPLNCOSTEST2'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@ClientHandling.algorithm: #SESSION_VARIABLE

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

define view P_EBOC_PlanCostEstimate2
  with parameters
    P_OrderID      : fis_order_number,
    P_Ledger       : fins_ledger,
    P_CurrencyRole : fac_crcyrole
  as select from P_EBOC_PlanCostEstimate1( P_OrderID: :P_OrderID,
                                           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.PlngCatIsForOrdReltdPlnCost = 'X'
{
  key _CostEstimate.OrderID,
  key _CostEstimate.OrderItem,
  key _CostEstimate.CompanyCode,
  key _CostEstimate.PlanningCategory,
  key CostElement,
  key BusinessTransactionCategory,
  key ControllingDebitCreditCode,
  key AccountAssignmentType,
  key PartnerAccountAssignmentType,
  key PartnerCostCenter,
  key PartnerCostCtrActivityType,
  key PartnerOrder,
  key CostSourceUnit,
  key Material,
  key WorkCenterInternalID,
  key OrderOperation,
  key Plant,
  key ControllingArea,
  key IsLotSizeIndependent,
  key _CostEstimate.CostOriginGroup,
  key OriginCostCenter,
  key OriginCostCtrActivityType,

      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,

      // Cost Rate for Fixed Amount

      cast(
        case
           when AmountInGlobalCurrency <> 0
             then division(FixedAmountInGlobalCurrency, AmountInGlobalCurrency, 8)
           else 0
         end as abap.dec(14, 8)
      )                                as CostRateFixedAmount,

      //Quantity

      TotalQuantity
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_LEDGERCOMPANYCODECRCYROLES",
"I_MFGORDPLNGCAT",
"P_EBOC_PLANCOSTESTIMATE1"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/