P_MfgOrdTargetCost1

DDL: P_MFGORDTARGETCOST1 SQL: PMFGORDTGTCST1 Type: view COMPOSITE

P_MfgOrdTargetCost1 is a Composite CDS View in SAP S/4HANA. It reads from 1 data source (P_COMFGOrderTargetCube) and exposes 19 fields with key fields Ledger, CompanyCode, OrderID, ControllingObject, AccountAssignmentType.

Data Sources (1)

SourceAliasJoin Type
P_COMFGOrderTargetCube P_COMFGOrderTargetCube from

Parameters (4)

NameTypeDefault
P_FromFiscalYearPeriod fins_fyearperiod
P_ToFiscalYearPeriod fins_fyearperiod
P_CurrencyRole fac_crcyrole
P_TgtCostPlngCategory fco_tgtcost_plngcategory

Annotations (7)

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

Fields (19)

KeyFieldSource TableSource FieldDescription
KEY Ledger _P_COMFGOrderTargetCube Ledger
KEY CompanyCode _P_COMFGOrderTargetCube CompanyCode
KEY OrderID _P_COMFGOrderTargetCube OrderID
KEY ControllingObject
KEY AccountAssignmentType AccountAssignmentType
KEY ControllingArea ControllingArea
KEY Product Material
KEY Plant Plant
KEY GLAccount GLAccount
KEY WorkCenterInternalID WorkCenterInternalID
KEY OrderOperation OrderOperation
KEY ControllingValueType
KEY ControllingDebitCreditCode ControllingDebitCreditCode
KEY PartnerCostCenter PartnerCostCenter
KEY PartnerCostCtrActivityType PartnerCostCtrActivityType
KEY UnitOfMeasure CostSourceUnit
FixedAmountInGlobalCrcy FixedAmountInGlobalCurrency
AmountInGlobalCurrency AmountInGlobalCurrency
TotalQuantity TotalQuantity
@AbapCatalog.sqlViewName: 'PMFGORDTGTCST1'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@VDM.viewType: #COMPOSITE
@ClientHandling.algorithm: #SESSION_VARIABLE
@AbapCatalog.preserveKey: true
@VDM.private: true
/*
  Planning category to distinguish order plan costs and standard costs.
  No fiscal year period restricition, for target costs calculation.
*/

define view P_MfgOrdTargetCost1    
  with parameters
    P_FromFiscalYearPeriod : fins_fyearperiod,
    P_ToFiscalYearPeriod   : fins_fyearperiod,
    P_CurrencyRole         : fac_crcyrole,
    P_TgtCostPlngCategory  : fco_tgtcost_plngcategory
  as select from           P_COMFGOrderTargetCube( P_FromFiscalYearPeriod: :P_FromFiscalYearPeriod,
                                                P_ToFiscalYearPeriod  : :P_ToFiscalYearPeriod,
                                                P_PlanningCategory         : :P_TgtCostPlngCategory  ) as _P_COMFGOrderTargetCube
    left outer to one join I_LedgerCompanyCodeCrcyRoles                                                as _CrcyRole on  _CrcyRole.CompanyCode = _P_COMFGOrderTargetCube.CompanyCode
                                                                                                                    and _CrcyRole.Ledger      = _P_COMFGOrderTargetCube.Ledger
  //   inner join   P_COMFGOrderOutputQuantities ( P_FromFiscalYearPeriod: :P_FromFiscalYearPeriod,

  //                                               P_ToFiscalYearPeriod: :P_ToFiscalYearPeriod) as _qty           on _plan.OrderID = _qty.OrderID

  //   inner join   I_MfgOrdPlngCat                                                             as _MfgOrdPlngCat on _MfgOrdPlngCat.PlanningCategory = _plan.PlanningCategory

{
  key    _P_COMFGOrderTargetCube.Ledger,
  key    _P_COMFGOrderTargetCube.CompanyCode,
  key    _P_COMFGOrderTargetCube.OrderID,
  key    cast(concat(AccountAssignmentType, _P_COMFGOrderTargetCube.OrderID) as j_objnr) as ControllingObject,
  key    AccountAssignmentType,
  key    ControllingArea,
  key    Material                                                                        as Product,
  key    Plant,
  key    GLAccount,
  key    WorkCenterInternalID,
  key    OrderOperation,
  key    cast('05' as co_wrttp)                                                          as ControllingValueType,
  key    ControllingDebitCreditCode,
  key    PartnerCostCenter,
  key    PartnerCostCtrActivityType,
  key    CostSourceUnit                                                                  as UnitOfMeasure,

         @Semantics.currencyCode:true
         case :P_CurrencyRole
           when _CrcyRole.CompanyCodeCurrencyRole  then _P_COMFGOrderTargetCube.CompanyCodeCurrency
           when _CrcyRole.GlobalCurrencyRole       then _P_COMFGOrderTargetCube.GlobalCurrency
           when _CrcyRole.FreeDefinedCurrency1Role then _P_COMFGOrderTargetCube.FreeDefinedCurrency1
           when _CrcyRole.FreeDefinedCurrency2Role then _P_COMFGOrderTargetCube.FreeDefinedCurrency2
           when _CrcyRole.FreeDefinedCurrency3Role then _P_COMFGOrderTargetCube.FreeDefinedCurrency3
           when _CrcyRole.FreeDefinedCurrency4Role then _P_COMFGOrderTargetCube.FreeDefinedCurrency4
           when _CrcyRole.FreeDefinedCurrency5Role then _P_COMFGOrderTargetCube.FreeDefinedCurrency5
           when _CrcyRole.FreeDefinedCurrency6Role then _P_COMFGOrderTargetCube.FreeDefinedCurrency6
           when _CrcyRole.FreeDefinedCurrency7Role then _P_COMFGOrderTargetCube.FreeDefinedCurrency7
           when _CrcyRole.FreeDefinedCurrency8Role then _P_COMFGOrderTargetCube.FreeDefinedCurrency8
           else cast('' as vdm_v_display_currency)
         end                                                                             as DisplayCurrency,



         @Semantics.amount.currencyCode: 'DisplayCurrency'
         cast(
           case :P_CurrencyRole
              when _CrcyRole.CompanyCodeCurrencyRole  then _P_COMFGOrderTargetCube.AmountInCompanyCodeCurrency
              when _CrcyRole.GlobalCurrencyRole       then _P_COMFGOrderTargetCube.AmountInGlobalCurrency
              when _CrcyRole.FreeDefinedCurrency1Role then _P_COMFGOrderTargetCube.AmountInFreeDefinedCurrency1
              when _CrcyRole.FreeDefinedCurrency2Role then _P_COMFGOrderTargetCube.AmountInFreeDefinedCurrency2
              when _CrcyRole.FreeDefinedCurrency3Role then _P_COMFGOrderTargetCube.AmountInFreeDefinedCurrency3
              when _CrcyRole.FreeDefinedCurrency4Role then _P_COMFGOrderTargetCube.AmountInFreeDefinedCurrency4
              when _CrcyRole.FreeDefinedCurrency5Role then _P_COMFGOrderTargetCube.AmountInFreeDefinedCurrency5
              when _CrcyRole.FreeDefinedCurrency6Role then _P_COMFGOrderTargetCube.AmountInFreeDefinedCurrency6
              when _CrcyRole.FreeDefinedCurrency7Role then _P_COMFGOrderTargetCube.AmountInFreeDefinedCurrency7
              when _CrcyRole.FreeDefinedCurrency8Role then _P_COMFGOrderTargetCube.AmountInFreeDefinedCurrency8
            else 0
         end as farp_amount_display_crcy)                                                as AmountInDisplayCurrency,

         FixedAmountInGlobalCurrency                                                     as FixedAmountInGlobalCrcy,
         AmountInGlobalCurrency,
         TotalQuantity
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_LEDGERCOMPANYCODECRCYROLES",
"P_COMFGORDERTARGETCUBE"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/