P_BOMITEMS

CDS View

Get Valid BOM items for BOM header

P_BOMITEMS is a CDS View in S/4HANA. Get Valid BOM items for BOM header. It contains 103 fields. 7 CDS views read from this table.

CDS Views using this table (7)

ViewTypeJoinVDMDescription
C_OpActyInstceReferenceCompVH view_entity inner CONSUMPTION Reference component of an OA instance
I_BillOfMaterialComponent view from COMPOSITE Bill of Material Components
I_BillOfMaterialItem view from COMPOSITE Bill of Material Items
I_ChgImpactETOVersBOMItem view from COMPOSITE ETO Version BOM Items
I_OpActyInstceRefCompInstce view_entity inner COMPOSITE Component instance of an OA instance
P_BOMCOMPONENTS view from BASIC Get Valid BOM items for BOM header
P_BOMComponentsWithKeyDate view from COMPOSITE

Fields (103)

KeyField CDS FieldsUsed in Views
KEY BillOfMaterial BillOfMaterial 3
KEY BillOfMaterialCategory BillOfMaterialCategory 4
KEY BillOfMaterialItemNodeNumber BillOfMaterialItemNodeNumber 3
KEY BillOfMaterialItemUUID BillOfMaterialItemUUID 2
KEY BillOfMaterialVariant BillOfMaterialVariant 4
KEY BillOfMaterialVersion BillOfMaterialVersion 4
KEY BOMItemInternalChangeCount BOMItemInternalChangeCount 1
AlternativeItemGroup AlternativeItemGroup 3
AlternativeItemPriority AlternativeItemPriority 2
AlternativeItemStrategy AlternativeItemStrategy 2
BillOfMaterialComponent BillOfMaterialComponent 3
BillOfMaterialItemCategory BillOfMaterialItemCategory 3
BillOfMaterialItemNumber BillOfMaterialItemNumber 3
BillOfMaterialItemQuantity BillOfMaterialItemQuantity 1
BillOfMaterialItemUnit BillOfMaterialItemUnit 1
BOMIsRecursive BOMIsRecursive 3
BOMItemCreatedByUser BOMItemCreatedByUser 3
BOMItemDescription BOMItemDescription 3
BOMItemHasFixedQuantity BOMItemHasFixedQuantity 3
BOMItemIsCostingRelevant BOMItemIsCostingRelevant 3
BOMItemIsPlantMaintRelevant BOMItemIsPlantMaintRelevant 3
BOMItemIsSalesRelevant BOMItemIsSalesRelevant 3
BOMItemIsSparePart BOMItemIsSparePart 3
BOMItemLastChangeDate BOMItemLastChangeDate 3
BOMItemLastChangedByUser BOMItemLastChangedByUser 3
BOMItemRecordCreationDate BOMItemRecordCreationDate 1
BOMItemSorter BOMItemSorter 3
BOMItemText2 BOMItemText2 3
ChangeNumberFrom EngineeringChangeDocument 4
ChangeNumberTo ChgToEngineeringChgDocument 1
ClassNumber ClassNumber 3
ClassType ClassType 3
ComponentScrapInPercent ComponentScrapInPercent 3
CostElement CostElement 3
Creditor Creditor 3
Currency Currency 3
DeliveryDurationInDays DeliveryDurationInDays 3
DependencyObjectNumber DependencyObjectNumber 3
DiscontinuationGroup DiscontinuationGroup 3
DistrKeyCompConsumption DistrKeyCompConsumption 3
DocNumber DocNumber 3
DocumentIsCreatedByCAD DocumentIsCreatedByCAD 4
DocumentPart DocumentPart 3
DocumentType DocumentType 3
DocumentVersion DocumentVersion 3
ExplosionType ExplosionType 3
FixedQuantity FixedQuantity 3
FollowUpGroup FollowUpGroup 3
FormulaKey FormulaKey 3
GoodsReceiptDuration GoodsReceiptDuration 3
IdentifierBOMItem IdentifierBOMItem 3
InheritedNodeNumberForBOMItem InheritedNodeNumberForBOMItem 3
InheritedNodeNumberVersionBOM InheritedNodeNumberVersionBOM 3
IsALE IsALE 4
IsAssembly IsAssembly 1
IsBOMRecursiveAllowed IsBOMRecursiveAllowed 3
IsBulkMaterial IsBulkMaterial 3
IsClassificationRelevant IsClassificationRelevant 3
IsConfigurableBOM IsConfigurableBOM 3
IsDeleted IsDeleted 3
IsEngineeringRelevant IsEngineeringRelevant 3
IsMaterialProvision IsMaterialProvision 3
IsNetScrap IsNetScrap 3
IsPhantomItem IsPhantomItem 1
IsPMAssemblyRelevant IsPMAssemblyRelevant 1
IsProductionRelevant IsProductionRelevant 3
IsSoftwareComponent IsSoftwareComponent 3
IsSubItem IsSubItem 3
LastChangeDateTime LastChangeDateTime 2
LeadTimeOffset LeadTimeOffset 3
LongTextLanguage LongTextLanguage 1
MaterialComponentPrice MaterialComponentPrice 3
MaterialGroup MaterialGroup 4
MaterialIsCoProduct MaterialIsCoProduct 3
MaterialPriceUnitQty MaterialPriceUnitQty 3
MultipleSelectionAllowed MultipleSelectionAllowed 3
NumberOfVariableSizeItem NumberOfVariableSizeItem 3
ObjectType ObjectType 3
OperationLeadTimeOffset OperationLeadTimeOffset 3
OperationScrapInPercent OperationScrapInPercent 3
OpsLeadTimeOffsetUnit OpsLeadTimeOffsetUnit 3
OrigSalesOrderBOM OrigSalesOrderBOM 1
OrigSalesOrderBOMItmCategory OrigSalesOrderBOMItmCategory 2
OrigSalesOrderBOMItmNodeNumber OrigSalesOrderBOMItmNodeNumber 2
OrigSalesOrderBOMItmNumber OrigSalesOrderBOMItmNumber 2
PreliminaryMaterial PreliminaryMaterial 1
ProdOrderIssueLocation ProdOrderIssueLocation 3
ProductionSupplyArea ProductionSupplyArea 3
PurchasingGroup PurchasingGroup 3
PurchasingOrganization PurchasingOrganization 3
QuantityVariableSizeItem QuantityVariableSizeItem 2
ReferencePoint ReferencePoint 3
RequiredComponent RequiredComponent 3
ResultingItemCategory ResultingItemCategory 3
Size1 Size1 3
Size2 Size2 3
Size3 Size3 3
SpecialProcurementType SpecialProcurementType 3
UnitOfMeasureForSize1To3 UnitOfMeasureForSize1To3 3
UnitOfMeasureForVarSizeItem UnitOfMeasureForVarSizeItem 2
UsageProbabilityPercent UsageProbabilityPercent 2
ValidityEndDate ValidityEndDate 3
ValidityStartDate ValidityStartDate 3
@AbapCatalog.sqlViewName: 'P_ITEMS'
@AbapCatalog.preserveKey:true
@ClientHandling.type : #INHERITED
@ClientHandling.algorithm : #AUTOMATED
@VDM.private: true
@VDM.viewType: #BASIC
@AbapCatalog.compiler.compareFilter: true
@ObjectModel.usageType: {serviceQuality: #B, sizeCategory: #XL, dataClass: #TRANSACTIONAL}
@AccessControl.authorizationCheck: #NOT_REQUIRED
@VDM.lifecycle.contract.type: #NONE
--@EndUserText.label: 'Get Valid BOM items for BOM header'
define view P_BOMItems
  as select from    stpo          as stpo // Removed distinct due to performance impact : testing need to be done


    inner join      stas          as stas     on  stpo.stlty = stas.stlty
                                              and stpo.stlnr = stas.stlnr
                                              and stpo.stlkn = stas.stlkn
                                              and stas.lkenz = ' '

    inner join      tcs03         as tcs03    on tcs03.agb29 = '29'
    left outer to one join P_T460aGlobal as t460a    on t460a.Sobes = stpo.itsob

    left outer to one join I_Supplier    as Supplier on stpo.lifnr                            = Supplier.Supplier
                                              and(
                                                Supplier.IsBusinessPurposeCompleted    is null
                                                or Supplier.IsBusinessPurposeCompleted = ''
                                              )


{
  key stpo.stlty                         as BillOfMaterialCategory,
  key stpo.stlnr                         as BillOfMaterial,
  key stas.stlal                         as BillOfMaterialVariant,
  key stpo.stlkn                         as BillOfMaterialItemNodeNumber,
      stpo.guidx                         as BillOfMaterialItemUUID,
      stpo.stpoz                         as BOMItemInternalChangeCount,
      stas.stvkn                         as InheritedNodeNumberForBOMItem,
      stpo.stvkn_versn                   as InheritedNodeNumberVersionBOM,
      stas.bom_versn                     as BillOfMaterialVersion,
      @Semantics.businessDate.from: true
      stpo.datuv                         as ValidityStartDate,
      --      @ObjectModel.virtualElement : true
      --      @ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_CS_BOM_ATTR_DETERMINATION'

      --    case when ( stpo.valid_to = '00000000' and stpo.datuv <> '00000000' )
      --       then      valid_items.ValidityEndDate
      -- else                 -- end
      @Semantics.businessDate.to: true
      case
        when stpo.datuv != '00000000' and stpo.valid_to = '00000000'
        then  cast('99991231' as datub )
        else cast( stpo.valid_to as datub preserving type )
      end                                as ValidityEndDate,
      stpo.aennr                         as ChangeNumberFrom,
      stpo.ecn_to                        as ChangeNumberTo,
      // @ObjectModel.readOnly: true

      stpo.andat                         as BOMItemRecordCreationDate,
      //@ObjectModel.readOnly: true

      stpo.annam                         as BOMItemCreatedByUser,
      //@ObjectModel.readOnly: true

      stpo.aedat                         as BOMItemLastChangeDate,
      //@ObjectModel.readOnly: true

      stpo.aenam                         as BOMItemLastChangedByUser,
      stpo.idnrk                         as BillOfMaterialComponent,
      stpo.postp                         as BillOfMaterialItemCategory,
      stpo.posnr                         as BillOfMaterialItemNumber,
      @Semantics.unitOfMeasure: true
      stpo.meins                         as BillOfMaterialItemUnit,
      @Semantics.quantity.unitOfMeasure: 'BillOfMaterialItemUnit'
      stpo.menge                         as BillOfMaterialItemQuantity,
      stpo.upskz                         as IsSubItem,
      stpo.sortf                         as SortString,
      stpo.sortf                         as BOMItemSorter,
      stpo.fmeng                         as FixedQuantity,
      stpo.fmeng                         as BOMItemHasFixedQuantity,
      stpo.ekgrp                         as PurchasingGroup,
      @Semantics.currencyCode: true
      stpo.waers                         as Currency,
      @Semantics.amount.currencyCode : 'Currency'
      stpo.preis                         as MaterialComponentPrice,
      case when
      ( stpo.itmid is null or stpo.itmid = '')
       then stpo.stvkn
       else
      stpo.itmid
      end                                as IdentifierBOMItem,
      //stpo.itmid                            as    IdentifierBOMItem,

      stpo.peinh                         as MaterialPriceUnitQty,
      stpo.ausch                         as ComponentScrapInPercent,
      stpo.avoau                         as OperationScrapInPercent,
      stpo.netau                         as IsNetScrap,
      stpo.roanz                         as NumberOfVariableSizeItem,
      stpo.romen                         as QuantityVariableSizeItem,
      stpo.rform                         as FormulaKey,
      stpo.potx1                         as BOMItemDescription,
      stpo.potx2                         as BOMItemText2,
      stpo.ltxsp                         as LongTextLanguage,
      stpo.matkl                         as MaterialGroup,
      stpo.dokar                         as DocumentType,
      stpo.doknr                         as DocNumber,
      stpo.dokvr                         as DocumentVersion,
      stpo.doktl                         as DocumentPart,
      stpo.class                         as ClassNumber,
      stpo.klart                         as ClassType,
      stpo.potpr                         as ResultingItemCategory,
      stpo.knobj                         as DependencyObjectNumber,
      stpo.objty                         as ObjectType,
      stpo.kzclb                         as IsClassificationRelevant,
      stpo.schgt                         as IsBulkMaterial,
      stpo.erskz                         as BOMItemIsSparePart,
      stpo.rvrel                         as BOMItemIsSalesRelevant,
      stpo.sanfe                         as IsProductionRelevant,
      stpo.sanin                         as BOMItemIsPlantMaintRelevant,
      stpo.sanka                         as BOMItemIsCostingRelevant,
      stpo.sanko                         as IsEngineeringRelevant,
      stpo.itsob                         as SpecialProcurementType,
      stpo.rekrs                         as IsBOMRecursiveAllowed,
      stpo.nlfzv                         as OperationLeadTimeOffset,
      stpo.nlfmv                         as OpsLeadTimeOffsetUnit,
      stpo.aedat                         as BOMItemChangeDate,
      stpo.beikz                         as IsMaterialProvision,
      stpo.rekri                         as BOMIsRecursive,
      stpo.cadpo                         as DocumentIsCreatedByCAD,
      stpo.verti                         as DistrKeyCompConsumption,
      stpo.lifzt                         as DeliveryDurationInDays,
      case when Supplier.IsBusinessPurposeCompleted is null or Supplier.IsBusinessPurposeCompleted = ''
      then stpo.lifnr else
      cast ('          ' as lifnr preserving type)
      end                                as Creditor,
      stpo.sakto                         as CostElement,
      stpo.roms1                         as Size1,
      stpo.roms2                         as Size2,
      stpo.roms3                         as Size3,
      stpo.romei                         as UnitOfMeasureForSize1To3,
      stpo.webaz                         as GoodsReceiptDuration,
      stpo.ekorg                         as PurchasingOrganization,
      stpo.clobk                         as RequiredComponent,
      stpo.clmul                         as MultipleSelectionAllowed,
      stpo.lgort                         as ProdOrderIssueLocation,
      stpo.kzkup                         as MaterialIsCoProduct,
      stpo.dspst                         as ExplosionType,
      stpo.nfgrp                         as FollowUpGroup,
      stpo.nfeag                         as DiscontinuationGroup,
      stpo.cview                         as ReinsurContrOrgUnit,
      stpo.awakz                         as IsConfigurableBOM,
      stpo.rfpnt                         as ReferencePoint,
      stpo.nlfzt                         as LeadTimeOffset,
      stpo.sfwind                        as IsSoftwareComponent,
      stpo.prvbe                         as ProductionSupplyArea,
      stpo.lkenz                         as IsDeleted,
      stpo.alekz                         as IsALE,
      tcs03.bmein                        as UnitOfMeasureForPiece,
      tcs03.roame                        as UnitOfMeasureForVarSizeItem,
      //Alternative Item Fields

      stpo.alpgr                         as AlternativeItemGroup,
      stpo.alprf                         as AlternativeItemPriority,
      stpo.alpst                         as AlternativeItemStrategy,
      stpo.ewahr                         as UsageProbabilityPercent,
      stpo.stkkz                         as IsPMAssemblyRelevant,
      cast(' ' as xfeld preserving type) as IsAssembly,
      case
        when t460a.Dumps = 'X'
       then cast('X' as xfeld preserving type)
       else
       cast('' as xfeld preserving type)
       end                               as IsPhantomItem,
      t460a.SpclProcmtTypeIsConsistent,
      case
        when stpo.lastchangedatetime = 0.0000000  then
          case when stpo.aenam <> '' then cast(dats_tims_to_tstmp(stpo.aedat, cast('120000' as uzeit), 'UTC', $session.client, 'NULL') as timestampl )
            else cast(dats_tims_to_tstmp(stpo.andat, cast('120000' as uzeit), 'UTC', $session.client, 'NULL') as timestampl )
          end
        else
          stpo.lastchangedatetime
      end                                as LastChangeDateTime,
      stpo.kstty                         as OrigSalesOrderBOMItmCategory,
      stpo.kstnr                         as OrigSalesOrderBOM,
      stpo.kstkn                         as OrigSalesOrderBOMItmNodeNumber,
      stpo.kstpz                         as OrigSalesOrderBOMItmNumber,
      stpo.preliminary_material          as PreliminaryMaterial
     // stpo.idpos                         as BOMItemGroup      

      

}
--where
--stpo.valid_to != '00000000'
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_SUPPLIER",
"P_T460AGLOBAL",
"STAS",
"STPO",
"TCS03"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/