C_AssociatedProductComposition

DDL: C_ASSOCIATEDPRODUCTCOMPOSITION SQL: CASSOCPRODCMPSTN Type: view CONSUMPTION

Associated Compositions of Product

C_AssociatedProductComposition is a Consumption CDS View that provides data about "Associated Compositions of Product" in SAP S/4HANA. It reads from 1 data source (P_AssociatedProductComposition) and exposes 16 fields with key fields ChmlCmplncInfoUUID, ChmlCompositionType, ProdCmplncLegalArea. It has 5 associations to related views.

Data Sources (1)

SourceAliasJoin Type
P_AssociatedProductComposition Composition from

Associations (5)

CardinalityTargetAliasCondition
[0..1] I_ChmlCompositionType _CompositionType $projection.ChmlCompositionType = _CompositionType.ChmlCompositionType
[0..1] I_ChmlCompositionTypeText _CompositionTypeText $projection.ChmlCompositionType = _CompositionTypeText.ChmlCompositionType and _CompositionTypeText.Language = $session.system_language
[0..1] I_ProdCmplncLegalAreaText _ProdCmplncLegalAreaText $projection.ProdCmplncLegalArea = _ProdCmplncLegalAreaText.ProdCmplncLegalArea and _ProdCmplncLegalAreaText.Language = $session.system_language -- needed for CCI role and DCL
[0..1] I_ChmlCmplncInfo _ChmlCmplncInfo $projection.ChmlCmplncInfoUUID = _ChmlCmplncInfo.ChmlCmplncInfoUUID
[0..1] P_CChmlCmplConstants _Constants _Constants.Constant1 = _Constants.Constant1

Annotations (10)

NameValueLevelField
EndUserText.label Associated Compositions of Product view
AbapCatalog.sqlViewName CASSOCPRODCMPSTN view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #MANDATORY view
ClientHandling.algorithm #SESSION_VARIABLE view
VDM.viewType #CONSUMPTION view
ObjectModel.representativeKey ChmlCmplncInfoUUID view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.dataClass #MIXED view
ObjectModel.usageType.sizeCategory #L view

Fields (16)

KeyFieldSource TableSource FieldDescription
KEY ChmlCmplncInfoUUID ChmlCmplncInfoUUID
KEY ChmlCompositionType ChmlCompositionType
KEY ProdCmplncLegalArea ProdCmplncLegalArea
ChmlCompositionTypeName
ProdCmplncLegalAreaName
int1asChmlCmpstnNavgnStatusCritlty
SemanticObjectAction
Constant3endasChmlCompositionSort
MaterialIsProducedasMaterialIsProduced
MaterialIsSoldasMaterialIsSold
MaterialIsSourcedasMaterialIsSourced
ChmlCmplncProdCatztnPhrsText
neededforDCL_ChmlCmplncInfo
_CompositionType _CompositionType
_CompositionTypeText _CompositionTypeText
_ProdCmplncLegalAreaText _ProdCmplncLegalAreaText
@EndUserText.label: 'Associated Compositions of Product'
@AbapCatalog.sqlViewName: 'CASSOCPRODCMPSTN'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #MANDATORY

--Client Handling of the view
@ClientHandling.algorithm: #SESSION_VARIABLE

--VDM view type
@VDM.viewType: #CONSUMPTION

--ObjectModel Usage Type
@ObjectModel:
{
  representativeKey: 'ChmlCmplncInfoUUID',
  semanticKey:  [ 'ChmlCmplncInfoUUID', 'ChmlCompositionTypeName', 'ProdCmplncLegalAreaName' ],
  usageType:
  {
    serviceQuality: #C,
    dataClass: #MIXED,
    sizeCategory: #L
  }
}

--Header information
  /*define data for the header*/
@UI:
{
  headerInfo:
  {
    typeName: 'Composition',
    typeNamePlural: 'Compositions',
    title:
    {
      label: 'Compositions',
      value: 'ChmlCompositionTypeName'
    }
  },
  presentationVariant:
  [{
    sortOrder:
    [
      {
        by: 'ChmlCompositionSort',
        direction: #ASC
      },
      {
        by: 'ChmlCompositionType',
        direction: #ASC
      },
      {
        by: '_ProdCmplncLegalAreaText.ProdCmplncLegalAreaName',
        direction: #ASC
      }
    ],
    requestAtLeast: [
                      'ChmlCompositionInProcessUUID',
                      'ChmlCmpstnInProcStatus',
                      'ChmlCompositionReleasedUUID',
                      'ChmlCmpstnReldStatus',
                      'ChmlCompositionType',
                      'ChmlCompositionTypeName',
                      'ProdCmplncLegalArea',
                      'ProdCmplncLegalAreaName',
                      'SemanticObject',
                      'SemanticObjectAction',
                      'ChmlCmpstnNavgnLinkParamName',
                      'ChmlCmpstnActiveIndParamName',
                      'ChmlCmpstnNavgnLinkUUID',
                      'ChmlCmpstnIsActive',
                      'MaterialIsProduced',
                      'MaterialIsSold',
                      'MaterialIsSourced',
                      'MaterialIsTransported'
                    ]
  }]
}

define view C_AssociatedProductComposition

  as select from P_AssociatedProductComposition as Composition

  --Link to customizing data (Composition Type Name)
  association [0..1] to I_ChmlCompositionType     as _CompositionType         on  $projection.ChmlCompositionType = _CompositionType.ChmlCompositionType
  association [0..1] to I_ChmlCompositionTypeText as _CompositionTypeText     on  $projection.ChmlCompositionType = _CompositionTypeText.ChmlCompositionType
                                                                              and _CompositionTypeText.Language   = $session.system_language
  association [0..1] to I_ProdCmplncLegalAreaText as _ProdCmplncLegalAreaText on  $projection.ProdCmplncLegalArea   = _ProdCmplncLegalAreaText.ProdCmplncLegalArea
                                                                              and _ProdCmplncLegalAreaText.Language = $session.system_language

  -- needed for CCI role and DCL
  association [0..1] to I_ChmlCmplncInfo          as _ChmlCmplncInfo          on  $projection.ChmlCmplncInfoUUID = _ChmlCmplncInfo.ChmlCmplncInfoUUID
  /*+[hideWarning] { "IDS" : [ "CARDINALITY_CHECK" ] } */
  association [0..1] to P_CChmlCmplConstants      as _Constants               on  _Constants.Constant1 = _Constants.Constant1

{
      @UI.hidden: true
  key ChmlCmplncInfoUUID                                                                    as ChmlCmplncInfoUUID,

      @ObjectModel.foreignKey.association: '_CompositionType'
  key ChmlCompositionType                                                                   as ChmlCompositionType,

  key ProdCmplncLegalArea                                                                   as ProdCmplncLegalArea,

      @Semantics.text: true
      @UI.lineItem: [{
        position: 10,
        label: 'Composition'
      }]
      @ObjectModel.readOnly: true
      @ObjectModel:{
        virtualElement: true,
        virtualElementCalculatedBy: 'ABAP:CL_EHFND_CMPSTN_ASSGN_CALC_EXT',
        sort.transformedBy: 'ABAP:CL_EHFND_CMPSTN_ASSGN_CALC_EXT'
      }
      cast('' as ehfnd_cci_ccmps_type_dsc )                                                 as ChmlCompositionTypeName,

      @UI: {
        textArrangement: #TEXT_ONLY,
        lineItem: [{
            position: 20,
            label: 'Legal Area'
        }]
      }
      @ObjectModel:{
        virtualElement: true,
        virtualElementCalculatedBy: 'ABAP:CL_EHFND_CMPSTN_ASSGN_CALC_EXT',
        sort.transformedBy: 'ABAP:CL_EHFND_CMPSTN_ASSGN_CALC_EXT'
      }
      cast('' as ehfnd_cci_ccmps_type_dsc )                                                 as ProdCmplncLegalAreaName,

      -- Composition Status for Navigation
      @UI:{
        lineItem: [{
          position: 40,
          label: 'Processing Status',
          criticality: 'ChmlCmpstnNavgnStatusCritlty',
          criticalityRepresentation: #WITHOUT_ICON
        }],
        textArrangement: #TEXT_ONLY
      }
      @ObjectModel.text.element: ['ChmlCmpstnNavgnStatusName']
      @ObjectModel.readOnly: true
      @ObjectModel.virtualElement
      @ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_EHFND_CMPSTN_ASSGN_CALC_EXT'
      cast('' as ehfnd_cci_ccmps_status)                                                    as ChmlCmpstnNavgnStatus,

      -- Text of Composition Status for Navigation
      @ObjectModel.readOnly: true
      @UI.hidden: true
      @ObjectModel.virtualElement
      @ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_EHFND_CMPSTN_ASSGN_CALC_EXT'
      cast('' as val_text)                                                                  as ChmlCmpstnNavgnStatusName,

      -- Criticality of Composition Status for Navigation
      @ObjectModel.readOnly: true
      @UI.hidden: true
      @ObjectModel.virtualElement
      @ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_EHFND_CMPSTN_ASSGN_CALC_EXT'
      cast(0 as abap.int1)                                                                  as ChmlCmpstnNavgnStatusCritlty,

      -- Navigation Link UUID
      @ObjectModel.readOnly: true
      @UI.hidden: true
      ChmlCmpstnNavgnLinkUUID                                                               as ChmlCmpstnNavgnLinkUUID,

      -- Criticality of Composition Status for Navigation
      @ObjectModel.readOnly: true
      @UI.hidden: true
      @Semantics.booleanIndicator: true
      cast( _Constants[inner].ConstantTrue as sdraft_is_active preserving type )            as ChmlCmpstnIsActive,

      --SemanticObject and Action for Navigation
      @ObjectModel.readOnly: true
      @UI.hidden: true
      @ObjectModel.virtualElement
      @ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_EHFND_CMPSTN_ASSGN_CALC_EXT'
      cast('' as val_text)                                                                  as SemanticObject,

      @ObjectModel.readOnly: true
      @UI.hidden: true
      @ObjectModel.virtualElement
      @ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_EHFND_CMPSTN_ASSGN_CALC_EXT'
      cast('' as val_text)                                                                  as SemanticObjectAction,

      --Parameter Name for Navigation Link
      @ObjectModel.readOnly: true
      @UI.hidden: true
      @ObjectModel.virtualElement
      @ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_EHFND_CMPSTN_ASSGN_CALC_EXT'
      cast('' as val_text)                                                                  as ChmlCmpstnNavgnLinkParamName,

      --Parameter Name for Active Indicator
      @ObjectModel.readOnly: true
      @UI.hidden: true
      @ObjectModel.virtualElement
      @ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_EHFND_CMPSTN_ASSGN_CALC_EXT'
      cast('' as val_text)                                                                  as ChmlCmpstnActiveIndParamName,

      --  In Process Composition UUID
      @UI.hidden: true
      @ObjectModel.readOnly: true
      ChmlCompositionInProcessUUID                                                          as ChmlCompositionInProcessUUID,

      --  In Process Status
      @UI.hidden: true
      @ObjectModel.readOnly: true
      ChmlCmpstnInProcStatus                                                                as ChmlCmpstnInProcStatus,

      --  Released Composition UUID
      @UI.hidden: true
      @ObjectModel.readOnly: true
      ChmlCompositionReleasedUUID                                                           as ChmlCompositionReleasedUUID,

      --  Released Status
      @UI.hidden: true
      @ObjectModel.readOnly: true
      ChmlCmpstnReldStatus                                                                  as ChmlCmpstnReldStatus,

      -- Sorting Order
      @UI.hidden: true
      case
        when Composition.ChmlCompositionType = 'MATLBSD2'
          then _Constants[inner].Constant1
        when Composition.ChmlCompositionType = 'ANALYTIC1'
          then _Constants[inner].Constant2
        when Composition.ChmlCompositionType = 'TS'
          then _Constants[inner].Constant4
        else
           _Constants[inner].Constant3
      end                                                                                   as ChmlCompositionSort,

      -- Indicator Material is Produced
      @ObjectModel.readOnly: true
      @UI.hidden: true
      _ChmlCmplncInfo.MaterialIsProduced                                                    as MaterialIsProduced,

      -- Indicator Material is Sold
      @ObjectModel.readOnly: true
      @UI.hidden: true
      _ChmlCmplncInfo.MaterialIsSold                                                        as MaterialIsSold,

      -- Indicator Material is Sourced
      @ObjectModel.readOnly: true
      @UI.hidden: true
      _ChmlCmplncInfo.MaterialIsSourced                                                     as MaterialIsSourced,

      -- Indicator Material is Transported
      @ObjectModel.readOnly: true
      @UI.hidden: true
      _ChmlCmplncInfo.MaterialIsTransported                                                 as MaterialIsTransported,

      --- Product Categorization
      @ObjectModel.text.element: ['ChmlCmplncProdCatztnPhrsText']
      @UI:{
        lineItem: [{ position: 30 }],
        textArrangement: #TEXT_ONLY
      }
      cast(ChmlCmplncProdCatztnPhrsUUID as ehfnd_chm_prod_catztnphrs_uuid preserving type ) as ChmlCmplncProdCatztnPhrsUUID,

      @ObjectModel.readOnly: true
      @ObjectModel:{
        virtualElement: true,
        virtualElementCalculatedBy: 'ABAP:CL_EHFND_PRPTY_PHRS_EXIT'
      }
      cast('' as ehfnd_phrs_text )                                                          as ChmlCmplncProdCatztnPhrsText,

      -- needed for DCL
      _ChmlCmplncInfo,
      _CompositionType,
      _CompositionTypeText,
      _ProdCmplncLegalAreaText
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_CHMLCMPLNCINFO",
"P_ASSOCIATEDPRODUCTCOMPOSITION",
"P_CCHMLCMPLCONSTANTS"
],
"ASSOCIATED":
[
"I_CHMLCMPLNCINFO",
"I_CHMLCOMPOSITIONTYPE",
"I_CHMLCOMPOSITIONTYPETEXT",
"I_PRODCMPLNCLEGALAREATEXT",
"P_CCHMLCMPLCONSTANTS"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/