I_OrdCostRollUpReplnmtElmnt

DDL: I_ORDCOSTROLLUPREPLNMTELMNT Type: view_entity COMPOSITE

Replenishment element in order cost roll up

I_OrdCostRollUpReplnmtElmnt is a Composite CDS View that provides data about "Replenishment element in order cost roll up" in SAP S/4HANA. It reads from 2 data sources (aufk, aufk) and exposes 9 fields.

Data Sources (2)

SourceAliasJoin Type
aufk _k from
aufk _k union_all

Annotations (7)

NameValueLevelField
AccessControl.authorizationCheck #CHECK view
EndUserText.label Replenishment element in order cost roll up view
Metadata.ignorePropagatedAnnotations true view
ObjectModel.usageType.serviceQuality #X view
ObjectModel.usageType.sizeCategory #S view
ObjectModel.usageType.dataClass #MIXED view
VDM.viewType #COMPOSITE view

Fields (9)

KeyFieldSource TableSource FieldDescription
MRPElementIDForDisplay
pstyp0thenBEelseendasMRPElementCategory
MatlStkOwnrGrpgWBSElmntIntID
Material a matnr
MRPElementIDForDisplay
MRPElementCategory
MatlStkOwnrGrpgWBSElmntIntID
Material _o matnr
Plant _o dwerk
@AbapCatalog.viewEnhancementCategory: [#PROJECTION_LIST, #UNION]
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Replenishment element in order cost roll up'
@Metadata.ignorePropagatedAnnotations: true
@ObjectModel.usageType:{
  serviceQuality: #X,
  sizeCategory: #S,
  dataClass: #MIXED
}
@VDM.viewType: #COMPOSITE
define view entity I_OrdCostRollUpReplnmtElmnt
  as select distinct from ekpo as a
    join                  ekko as b on a.ebeln = b.ebeln
    join                  ekkn as c on  a.ebeln = c.ebeln
                                    and a.ebelp = c.ebelp


{

  key cast(case
    when a.pstyp  = '3' then concat('KE', concat(a.ebeln , a.ebelp ))
    when a.pstyp  = '7' then concat('UE', concat(a.ebeln , a.ebelp ))
    when a.pstyp  = '0' then concat('BE', concat(a.ebeln , concat('0', a.ebelp ) ))
  end   as pmmo_sender_pgrepobj_d   )                                                     as ReplenishmentElement,

      cast(concat(concat(a.ebeln, '/') , ltrim(a.ebelp, '0') )  as pmmo_repobj_display_d) as MRPElementIDForDisplay,

      case
        when a.pstyp  = '3' then 'KE'
        when a.pstyp  = '7' then 'UE'
        when a.pstyp  = '0' then 'BE'
        else ''
      end                                                                                 as MRPElementCategory,

      cast(c.ps_psp_pnr as ps_s4_pspnr preserving type)                                   as MatlStkOwnrGrpgWBSElmntIntID,
      a.matnr                                                                             as Material,
      a.werks                                                                             as Plant

}
where
       a.sobkz = 'Q'
  and(
       a.loekz = ''
    or a.loekz = 'S'
  )
  and(
       a.bstyp = 'F'
    or a.bstyp = 'L'
  )
  and  c.loekz = ''

union all select from aufk as _k
  join                afpo as _o on _k.aufnr = _o.aufnr

{
  key cast (concat('OR', _k.aufnr )  as pmmo_sender_pgrepobj_d)             as ReplenishmentElement,
      cast(ltrim(substring(_k.aufnr, 1, 18), '0') as pmmo_repobj_display_d) as MRPElementIDForDisplay,
      'OR'                                                                  as MRPElementCategory,

      cast(_o.projn    as ps_s4_pspnr preserving type)                      as MatlStkOwnrGrpgWBSElmntIntID,
      _o.matnr                                                              as Material,
      _o.dwerk                                                              as Plant


}
where
      _o.sobkz =  'Q'
  and _o.dauty <> '04'
  and _o.dauty <> '05'
  and _o.dauty <> '06'
  and _o.posnr =  '0001'
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"AFPO",
"AUFK",
"EKKN",
"EKKO",
"EKPO"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/