I_ChgRecdWithMatl

DDL: I_CHGRECDWITHMATL SQL: ICRWITHMATL Type: view BASIC Package: MPE_PLAN_MEC

Open Change Record Details with Material

I_ChgRecdWithMatl is a Basic CDS View that provides data about "Open Change Record Details with Material" in SAP S/4HANA. It reads from 6 data sources and exposes 2 fields with key field ChangeRecordUUID. Part of development package MPE_PLAN_MEC.

Data Sources (6)

SourceAliasJoin Type
/plmi/cr_type cr_type inner
vmp_plnscp_hdr hdr left_outer
marc marc left_outer
mast mast left_outer
/iam/d_i_root root inner
stko stko left_outer

Annotations (10)

NameValueLevelField
AbapCatalog.sqlViewName ICRWITHMATL view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #MANDATORY view
VDM.viewType #BASIC view
AbapCatalog.preserveKey true view
ClientHandling.algorithm #SESSION_VARIABLE view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.dataClass #MIXED view
ObjectModel.usageType.sizeCategory #L view
EndUserText.label Open Change Record Details with Material view

Fields (2)

KeyFieldSource TableSource FieldDescription
KEY ChangeRecordUUID /iam/d_i_root db_key
ChangeRecord /iam/d_i_root issue_id
@AbapCatalog.sqlViewName: 'ICRWITHMATL'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #MANDATORY
@VDM.viewType:#BASIC
@AbapCatalog.preserveKey:true
@ClientHandling.algorithm: #SESSION_VARIABLE
@ObjectModel.usageType: {serviceQuality: #C,
                         dataClass: #MIXED,
                         sizeCategory: #L}
@EndUserText.label: 'Open Change Record Details with Material'

define view I_ChgRecdWithMatl
  as select distinct from /iam/d_i_obj_ref as ref
    inner join            /iam/d_i_root    as root    on(
         ref.parent_key = root.db_key
       )
    inner join            /plmi/cr_type    as cr_type on(
      root.issue_type = cr_type.cr_type
    )
    left outer join       stko                        on(
                             stko.stlty     = ref.internal_id1
                             and stko.stlnr = ref.internal_id2
                             and stko.stlal = ref.internal_id3
                           )
    left outer join       mast                        on(
                             mast.stlnr     = stko.stlnr
                             and mast.stlal = stko.stlal
                           )
    left outer join       vmp_plnscp_hdr   as hdr     on(
          hdr.documentid         = ref.internal_id1
          and hdr.plan_scope_alt = ref.internal_id2
        )
    left outer join       marc                        on(
                             marc.matnr = ref.internal_id1
                           )
{
  key root.db_key               as ChangeRecordUUID,

  key cast(case when ref.type_cd = 'BOM' or ref.type_cd ='EBM' or ref.type_cd ='MBM' then mast.matnr
  when ref.type_cd = 'PLS' then hdr.src_matnr
  when ref.type_cd = 'MAT' then ref.internal_id1
  end as matnr preserving type) as Material,
  
      root.issue_id             as ChangeRecord
}
where
       root.application    = 'CR'
  and  root.issue_category = 'CR'
  and  cr_type.cr_category = 'ECR'
  and(
       ref.type_cd         = 'BOM'
    or ref.type_cd         = 'EBM'
    or ref.type_cd         = 'MBM'
    or ref.type_cd         = 'MAT'
    or ref.type_cd         = 'PLS'
  )
  and root.lcycle_cd != '09'