P_RecipeFormulaItmForExplsnScp

DDL: P_RECIPEFORMULAITMFOREXPLSNSCP SQL: PRCPFML4EXPLSCP Type: view COMPOSITE

P_RecipeFormulaItmForExplsnScp is a Composite CDS View in SAP S/4HANA. It reads from 4 data sources (I_RecipeFormulaItemForKeyDate, I_RecipeFormulaItemForKeyDate, I_RecipeFormulaItemForKeyDate, I_RecipeFormulaItemForKeyDate) and exposes 63 fields with key field RcpFmlaItemUUID.

Data Sources (4)

SourceAliasJoin Type
I_RecipeFormulaItemForKeyDate I_RecipeFormulaItemForKeyDate from
I_RecipeFormulaItemForKeyDate I_RecipeFormulaItemForKeyDate inner
I_RecipeFormulaItemForKeyDate I_RecipeFormulaItemForKeyDate inner
I_RecipeFormulaItemForKeyDate I_RecipeFormulaItemForKeyDate union

Parameters (1)

NameTypeDefault
P_KeyDate sydate

Annotations (7)

NameValueLevelField
AbapCatalog.sqlViewName PRCPFML4EXPLSCP view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #NOT_REQUIRED view
ClientHandling.algorithm #SESSION_VARIABLE view
VDM.private true view
VDM.lifecycle.contract.type #NONE view
VDM.viewType #COMPOSITE view

Fields (63)

KeyFieldSource TableSource FieldDescription
KEY RcpFmlaItemUUID formula RcpFmlaItemUUID
RcpFmlaUUID formula RcpFmlaUUID
RcpFmlaItemSourceFmlaItemUUID formula RcpFmlaItemSourceFmlaItemUUID
RcpFmlaItemPosition formula RcpFmlaItemPosition
RcpFmlaItemAlternativeItemPos formula RcpFmlaItemAlternativeItemPos
RcpFmlaItemType formula RcpFmlaItemType
SpecificationInternalID formula SpecificationInternalID
Material formula Material
RcpFmlaStreamUUID formula RcpFmlaStreamUUID
RcpFmlaItemComponentType formula RcpFmlaItemComponentType
RcpFmlaItemLowerLimit formula RcpFmlaItemLowerLimit
RcpFmlaItemUpperLimit formula RcpFmlaItemUpperLimit
RcpFmlaItemQuantity formula RcpFmlaItemQuantity
RcpFmlaItemUnit formula RcpFmlaItemUnit
RcpFmlaItemExceptionCode formula RcpFmlaItemExceptionCode
RcpFmlaItemScrapInPercent formula RcpFmlaItemScrapInPercent
RcpFmlaItemOverrunInPercent formula RcpFmlaItemOverrunInPercent
RcpFmlaItemAlternativeItemUUID formula RcpFmlaItemAlternativeItemUUID
RcpFmlaItemQuantityInKilogram formula RcpFmlaItemQuantityInKilogram
RcpFmlaItemZeroSign formula RcpFmlaItemZeroSign
RcpFmlaItemIsSelectedForCalc formula RcpFmlaItemIsSelectedForCalc
RcpFmlaItemExplosionRecipeUUID formula RcpFmlaItemExplosionRecipeUUID
RcpFmlaCalculationType formula RcpFmlaCalculationType
RcpFmlaItemIsBalancingItem formula RcpFmlaItemIsBalancingItem
RecipeFmlaItemAltvIsUsed formula RecipeFmlaItemAltvIsUsed
RecipeUUID formula RecipeUUID
Path
RcpPrimOutpComponentType po RcpFmlaItemComponentType
_ComponentType formula _ComponentType
_Product formula _Product
_RecipeForKeyDate formula _RecipeForKeyDate
RcpFmlaItemUUID
RcpFmlaUUID formula RcpFmlaUUID
RcpFmlaItemSourceFmlaItemUUID formula RcpFmlaItemSourceFmlaItemUUID
RcpFmlaItemPosition formula RcpFmlaItemPosition
RcpFmlaItemAlternativeItemPos formula RcpFmlaItemAlternativeItemPos
RcpFmlaItemType formula RcpFmlaItemType
SpecificationInternalID
Material formula Material
RcpFmlaStreamUUID formula RcpFmlaStreamUUID
RcpFmlaItemComponentType formula RcpFmlaItemComponentType
RcpFmlaItemLowerLimit formula RcpFmlaItemLowerLimit
RcpFmlaItemUpperLimit formula RcpFmlaItemUpperLimit
RcpFmlaItemQuantity formula RcpFmlaItemQuantity
RcpFmlaItemUnit formula RcpFmlaItemUnit
RcpFmlaItemExceptionCode formula RcpFmlaItemExceptionCode
RcpFmlaItemScrapInPercent formula RcpFmlaItemScrapInPercent
RcpFmlaItemOverrunInPercent formula RcpFmlaItemOverrunInPercent
RcpFmlaItemAlternativeItemUUID formula RcpFmlaItemAlternativeItemUUID
RcpFmlaItemQuantityInKilogram formula RcpFmlaItemQuantityInKilogram
RcpFmlaItemZeroSign formula RcpFmlaItemZeroSign
RcpFmlaItemIsSelectedForCalc formula RcpFmlaItemIsSelectedForCalc
RcpFmlaItemExplosionRecipeUUID formula RcpFmlaItemExplosionRecipeUUID
RcpFmlaCalculationType formula RcpFmlaCalculationType
RcpFmlaItemIsBalancingItem formula RcpFmlaItemIsBalancingItem
RecipeFmlaItemAltvIsUsed formula RecipeFmlaItemAltvIsUsed
RecipeUUID formula RecipeUUID
Path
RcpPrimOutpComponentType po RcpFmlaItemComponentType
_ComponentType formula _ComponentType
_Product formula _Product
_RecipeForKeyDate formula _RecipeForKeyDate
_RecipeProcessElementAssgmt formula _RecipeProcessElementAssgmt
@AbapCatalog.sqlViewName: 'PRCPFML4EXPLSCP'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@ClientHandling.algorithm: #SESSION_VARIABLE

@VDM.private: true
@VDM.lifecycle.contract.type: #NONE
@VDM.viewType: #COMPOSITE

/**
 * Helper view for handling explosion stop in recipes, which creates a view for the formula items
 * in which a virtual PO line is generated where the property specification is used. The union
 * with the two paths is to replace a calculated attribute (and the filtering on that).
 */
define view P_RecipeFormulaItmForExplsnScp
  with parameters
    @Environment.systemField: #SYSTEM_DATE
    P_KeyDate : sydate
  as select from I_RecipeFormulaItemForKeyDate( P_KeyDate : $parameters.P_KeyDate ) as formula
    inner join   I_RecipeFormulaItemForKeyDate( P_KeyDate : $parameters.P_KeyDate ) as po on  formula.RcpFmlaUUID         = po.RcpFmlaUUID
                                                                                          and po.RcpFmlaItemType          = 'PO'
                                                                                          and po.RecipeFmlaItemAltvIsUsed = 'X'

{
  key formula.RcpFmlaItemUUID,
      formula.RcpFmlaUUID,
      formula.RcpFmlaItemSourceFmlaItemUUID,
      formula.RcpFmlaItemPosition,
      formula.RcpFmlaItemAlternativeItemPos,
      formula.RcpFmlaItemType,
      formula.SpecificationInternalID,
      formula.Material,
      formula.RcpFmlaStreamUUID,
      formula.RcpFmlaItemComponentType,
      formula.RcpFmlaItemLowerLimit,
      formula.RcpFmlaItemUpperLimit,
      formula.RcpFmlaItemQuantity,
      formula.RcpFmlaItemUnit,
      formula.RcpFmlaItemExceptionCode,
      formula.RcpFmlaItemScrapInPercent,
      formula.RcpFmlaItemOverrunInPercent,
      formula.RcpFmlaItemAlternativeItemUUID,
      formula.RcpFmlaItemQuantityInKilogram,
      formula.RcpFmlaItemZeroSign,
      formula.RcpFmlaItemIsSelectedForCalc,
      formula.RcpFmlaItemExplosionRecipeUUID,
      formula.RcpFmlaCalculationType,
      formula.RcpFmlaItemIsBalancingItem,
      formula.RecipeFmlaItemAltvIsUsed,
      formula.RecipeUUID,
      ''                          as Path,
      po.RcpFmlaItemComponentType as RcpPrimOutpComponentType,

      formula._ComponentType,
      formula._Product,
      formula._RecipeForKeyDate,
      formula._RecipeProcessElementAssgmt
}
// alternative POs are not relevant

where
     formula.RcpFmlaItemType          <> 'PO'
  or formula.RecipeFmlaItemAltvIsUsed =  'X'
union select from I_RecipeFormulaItemForKeyDate( P_KeyDate : $parameters.P_KeyDate ) as formula
  inner join      I_RecipeFormulaItemForKeyDate( P_KeyDate : $parameters.P_KeyDate ) as po on  formula.RcpFmlaUUID         = po.RcpFmlaUUID
                                                                                           and po.RcpFmlaItemType          = 'PO'
                                                                                           and po.RecipeFmlaItemAltvIsUsed = 'X'

{

  key formula.RcpFmlaItemUUID,
      formula.RcpFmlaUUID,
      formula.RcpFmlaItemSourceFmlaItemUUID,
      formula.RcpFmlaItemPosition,
      formula.RcpFmlaItemAlternativeItemPos,
      formula.RcpFmlaItemType,
      formula._RecipeForKeyDate( P_KeyDate : $parameters.P_KeyDate ).RecipePropertySpecInternalID            as SpecificationInternalID, // replace spec by prop spec.

      formula.Material,
      formula.RcpFmlaStreamUUID,
      formula.RcpFmlaItemComponentType,
      formula.RcpFmlaItemLowerLimit,
      formula.RcpFmlaItemUpperLimit,
      formula.RcpFmlaItemQuantity,
      formula.RcpFmlaItemUnit,
      formula.RcpFmlaItemExceptionCode,
      formula.RcpFmlaItemScrapInPercent,
      formula.RcpFmlaItemOverrunInPercent,
      formula.RcpFmlaItemAlternativeItemUUID,
      formula.RcpFmlaItemQuantityInKilogram,
      formula.RcpFmlaItemZeroSign,
      formula.RcpFmlaItemIsSelectedForCalc,
      formula.RcpFmlaItemExplosionRecipeUUID,
      formula.RcpFmlaCalculationType,
      formula.RcpFmlaItemIsBalancingItem,
      formula.RecipeFmlaItemAltvIsUsed,
      formula.RecipeUUID,
      cast('P' as char1)                                                                                     as Path,
      po.RcpFmlaItemComponentType                                                                            as RcpPrimOutpComponentType,

      formula._ComponentType,
      formula._Product,
      formula._RecipeForKeyDate,
      formula._RecipeProcessElementAssgmt
}
// replacement is only needed for the (used) PO line

where
      formula.RcpFmlaItemType          = 'PO'
  and formula.RecipeFmlaItemAltvIsUsed = 'X'
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_RECIPEFORKEYDATE",
"I_RECIPEFORMULAITEMFORKEYDATE"
],
"ASSOCIATED":
[
"I_PRODUCT",
"I_RECIPEFORKEYDATE",
"I_RECIPEPROCESSELEMENTASSGMT",
"I_SPECCOMPONENTTYPE"
],
"BASE":
[
"I_RECIPEFORMULAITEMFORKEYDATE"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/