P_BILLOFMATERIALHEADER

CDS View

P_BILLOFMATERIALHEADER is a CDS View in S/4HANA. It contains 49 fields. 2 CDS views read from this table.

CDS Views using this table (2)

ViewTypeJoinVDMDescription
C_BOMCreateForUI view union_all CONSUMPTION Consumption view for Create BOM scenario
I_BillOfMaterialHeader view from COMPOSITE BOM Header details

Fields (49)

KeyField CDS FieldsUsed in Views
KEY BillOfMaterial BillOfMaterial 1
KEY BillOfMaterialCategory BillOfMaterialCategory 2
KEY BillOfMaterialHeaderUUID BillOfMaterialHeaderUUID 1
KEY BillOfMaterialVariant BillOfMaterialVariant 2
KEY BillOfMaterialVariantUsage BillOfMaterialVariantUsage 2
KEY BillOfMaterialVersion BillOfMaterialVersion 2
KEY EngineeringChangeDocument EngineeringChangeDocument 2
KEY Material Material 2
KEY Plant Plant 2
BillOfMaterialAuthsnGrp BillOfMaterialAuthsnGrp 1
BillOfMaterialStatus BillOfMaterialStatus 1
BillOfMaterialUUID BillOfMaterialUUID 1
BOMAlternativeText BOMAlternativeText 1
BOMAssetNtwkHndovrIsRelevant BOMAssetNtwkHndovrIsRelevant 1
BOMExplosionApplication BOMExplosionApplication 1
BOMGroup BOMGroup 1
BOMHeaderBaseUnit BOMHeaderBaseUnit 1
BOMHeaderInternalChangeCount BOMHeaderInternalChangeCount 1
BOMHeaderQuantityInBaseUnit BOMHeaderQuantityInBaseUnit 1
BOMHeaderText BOMHeaderText 1
BOMIsArchivedForDeletion BOMIsArchivedForDeletion 1
BOMIsToBeDeleted BOMIsToBeDeleted 1
BOMPredecessorVersion BOMPredecessorVersion 1
BOMPrioritizedVersion BOMPrioritizedVersion 1
BOMTechnicalType BOMTechnicalType 1
BOMUsagePriority BOMUsagePriority 1
BOMVersionStatus BOMVersionStatus 1
ChgToEngineeringChgDocument ChgToEngineeringChgDocument 1
CreatedByUser CreatedByUser 1
DocumentIsCreatedByCAD DocumentIsCreatedByCAD 1
HeaderValidityEndDate HeaderValidityEndDate 1
HeaderValidityStartDate HeaderValidityStartDate 1
IndicatorIsBOMChangedWithHist IndicatorIsBOMChangedWithHist 1
IndicatorIsBOMWithDateHistory IndicatorIsBOMWithDateHistory 1
IsConfiguredMaterial IsConfiguredMaterial 1
IsLatestBOMVersion IsLatestBOMVersion 1
IsMarkedForDeletion IsMarkedForDeletion 1
IsMultipleBOMAlt IsMultipleBOMAlt 1
IsVersionBillOfMaterial IsVersionBillOfMaterial 1
LaboratoryOrDesignOffice LaboratoryOrDesignOffice 1
LastChangeDate LastChangeDate 1
LastChangeDateTime LastChangeDateTime 1
LastChangedByUser LastChangedByUser 1
LongTextExists LongTextExists 1
LongTextLanguage LongTextLanguage 1
MaterialBOMObjectID MaterialBOMObjectID 1
RecordCreationDate RecordCreationDate 1
SalesOrder SalesOrder 1
SalesOrderItem SalesOrderItem 1
@AbapCatalog.sqlViewName: 'PBOMHEADER'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@ClientHandling.algorithm: #SESSION_VARIABLE
@VDM.private: true
@ObjectModel.usageType: {serviceQuality: #B, sizeCategory: #L, dataClass: #TRANSACTIONAL}
@VDM.viewType: #COMPOSITE
define view P_BillOfMaterialHeader
  as select from    I_BillOfMaterial    as materialBOM
//Left Outer Join will get no data

//Only Done to remove cast from SalesOrder field and use it in default search  

    left outer join I_SalesOrderBOMLink as _Kdst on  materialBOM.BillOfMaterialCategory = 'M'
                                                 and materialBOM.BillOfMaterial         = _Kdst.BillOfMaterial
                                                 and materialBOM.BillOfMaterialVariant  = _Kdst.BillOfMaterialVariant

{
  key materialBOM.BillOfMaterialHeaderUUID         as BillOfMaterialHeaderUUID,
  key materialBOM.BillOfMaterialVariantUsage       as BillOfMaterialVariantUsage,
  key materialBOM.BillOfMaterialCategory           as BillOfMaterialCategory,
  key materialBOM.BillOfMaterial                   as BillOfMaterial,
  key materialBOM.BillOfMaterialVariant            as BillOfMaterialVariant,
  key materialBOM.BillOfMaterialVersion            as BillOfMaterialVersion,
  key materialBOM.EngineeringChangeDocument        as EngineeringChangeDocument,
  key _Mast.Material                               as Material,
  key _Mast.Plant                                  as Plant,
      _Kdst.SalesOrder                             as SalesOrder,
    //  cast('' as cs_vbeln ) as SalesOrder,

      cast( '000000' as cs_vbpos preserving type ) as SalesOrderItem,

      //materialBOM.BillOfMaterialVariantUsage                                                                                                                                     as BillOfMaterialVariantUsage,

      // materialBOM.BillOfMaterialHeaderUUID                                                                                                                                        as BillOfMaterialHeaderUUID,

      --      bintohex( materialBOM.BillOfMaterialHeaderUUID )                                                                                                                            as BOMCharUUID,
      materialBOM.BillOfMaterialUUID               as BillOfMaterialUUID,
      materialBOM.IsMultipleBOMAlt                 as IsMultipleBOMAlt,
      //@ObjectModel.readOnly: true

      materialBOM.BOMHeaderInternalChangeCount     as BOMHeaderInternalChangeCount,
      //@ObjectModel.readOnly: true

      materialBOM.BOMPrioritizedVersion            as BOMPrioritizedVersion,
      @Consumption.hidden: true
      //@ObjectModel.readOnly: true

      materialBOM.BOMExplosionApplication          as BOMExplosionApplication,
      //@ObjectModel.readOnly: true

      materialBOM.BOMUsagePriority                 as BOMUsagePriority,
      materialBOM.BillOfMaterialAuthsnGrp          as BillOfMaterialAuthsnGrp,
      materialBOM.BOMVersionStatus                 as BOMVersionStatus,
      _Mast.MaterialToLotSizeQuantity,
      _Mast.MatFromLotSizeQuantity,
      materialBOM.IsVersionBillOfMaterial          as IsVersionBillOfMaterial,
      materialBOM.IsLatestBOMVersion               as IsLatestBOMVersion,
      materialBOM.BOMTechnicalType                 as BOMTechnicalType,
      materialBOM.BOMGroup                         as BOMGroup,
      materialBOM.IndicatorIsBOMWithDateHistory    as IndicatorIsBOMWithDateHistory,
      materialBOM.IndicatorIsBOMChangedWithHist    as IndicatorIsBOMChangedWithHist,
      materialBOM.BOMHeaderText                    as BOMHeaderText,
      materialBOM.BOMAlternativeText               as BOMAlternativeText,
      materialBOM.LongTextLanguage                 as LongTextLanguage,
      cast('' as ltxzu preserving type)            as LongTextExists,
      materialBOM.BillOfMaterialStatus             as BillOfMaterialStatus,
    //  @ObjectModel.readOnly: true

 //     @Semantics.businessDate.to: true

      materialBOM.HeaderValidityEndDate,
      @Semantics.businessDate.from: true
      materialBOM.HeaderValidityStartDate,
      materialBOM.ChgToEngineeringChgDocument      as ChgToEngineeringChgDocument,
      materialBOM.IsMarkedForDeletion              as IsMarkedForDeletion,
      materialBOM.BOMIsArchivedForDeletion,
      materialBOM.IsConfiguredMaterial             as IsConfiguredMaterial, -- MAST-KZKFG
      materialBOM.BOMIsConfigurable                as BOMIsConfigurable, -- MAST-KZKFG
      //@ObjectModel.readOnly: true

      materialBOM.IsALE                            as IsALE,
      @Semantics.unitOfMeasure: true
      @ObjectModel.foreignKey.association: '_UnitOfMeasure'
      materialBOM.BOMHeaderBaseUnit                as BOMHeaderBaseUnit,
      @Semantics.quantity.unitOfMeasure: 'BOMHeaderBaseUnit'
      @DefaultAggregation :#NONE
      materialBOM.BOMHeaderQuantityInBaseUnit      as BOMHeaderQuantityInBaseUnit,
      materialBOM.RecordCreationDate               as RecordCreationDate,
      materialBOM.LastChangeDate                   as LastChangeDate,
      materialBOM.LastChangedByUser                as LastChangedByUser,
      materialBOM.CreatedByUser                    as CreatedByUser,
      materialBOM.BOMIsToBeDeleted                 as BOMIsToBeDeleted,
      materialBOM.DocumentIsCreatedByCAD           as DocumentIsCreatedByCAD,
      materialBOM.LaboratoryOrDesignOffice         as LaboratoryOrDesignOffice,
      materialBOM.LastChangeDateTime               as LastChangeDateTime,
      materialBOM.BOMAssetNtwkHndovrIsRelevant     as BOMAssetNtwkHndovrIsRelevant,
      materialBOM._Mast.MaterialBOMObjectID        as MaterialBOMObjectID,
      --   '' as BOMPredecessorVersion,
      materialBOM.BOMPredecessorVersion
      

}
where
   materialBOM.BillOfMaterialCategory = 'M'

union all select from I_BillOfMaterial as orderBOM
{
  key orderBOM.BillOfMaterialHeaderUUID     as BillOfMaterialHeaderUUID,
  key orderBOM.BillOfMaterialVariantUsage   as BillOfMaterialVariantUsage,
  key orderBOM.BillOfMaterialCategory       as BillOfMaterialCategory,
  key orderBOM.BillOfMaterial               as BillOfMaterial,
  key orderBOM.BillOfMaterialVariant        as BillOfMaterialVariant,
  key orderBOM.BillOfMaterialVersion        as BillOfMaterialVersion,
  key orderBOM.EngineeringChangeDocument    as EngineeringChangeDocument,
  key _Kdst.Material                        as Material,
  key _Kdst.Plant                           as Plant,
      _Kdst.SalesOrder                      as SalesOrder,
      _Kdst.SalesOrderItem                  as SalesOrderItem,

      //orderBOM.BillOfMaterialVariantUsage                                                                                                                                     as BillOfMaterialVariantUsage,

      // orderBOM.BillOfMaterialHeaderUUID                                                                                                                                        as BillOfMaterialHeaderUUID,

      --      bintohex( orderBOM.BillOfMaterialHeaderUUID )                                                                                                                            as BOMCharUUID,
      orderBOM.BillOfMaterialUUID           as BillOfMaterialUUID,
      orderBOM.IsMultipleBOMAlt             as IsMultipleBOMAlt,
      //@ObjectModel.readOnly: true

      orderBOM.BOMHeaderInternalChangeCount as BOMHeaderInternalChangeCount,
      //@ObjectModel.readOnly: true

      orderBOM.BOMPrioritizedVersion        as BOMPrioritizedVersion,
      @Consumption.hidden: true
      //@ObjectModel.readOnly: true

      orderBOM.BOMExplosionApplication      as BOMExplosionApplication,
      //@ObjectModel.readOnly: true

      orderBOM.BOMUsagePriority             as BOMUsagePriority,
      orderBOM.BillOfMaterialAuthsnGrp      as BillOfMaterialAuthsnGrp,
      orderBOM.BOMVersionStatus             as BOMVersionStatus,
      cast( 0 as losvn )                    as MaterialToLotSizeQuantity,
      cast( 0 as losbs )                    as MatFromLotSizeQuantity,
      orderBOM.IsVersionBillOfMaterial      as IsVersionBillOfMaterial,
      orderBOM.IsLatestBOMVersion           as IsLatestBOMVersion,
      orderBOM.BOMTechnicalType             as BOMTechnicalType,
      orderBOM.BOMGroup                     as BOMGroup,
      orderBOM.IndicatorIsBOMWithDateHistory as IndicatorIsBOMWithDateHistory,
      orderBOM.IndicatorIsBOMChangedWithHist as IndicatorIsBOMChangedWithHist,
      orderBOM.BOMHeaderText                as BOMHeaderText,
      orderBOM.BOMAlternativeText           as BOMAlternativeText,
      orderBOM.LongTextLanguage             as LongTextLanguage,
      cast('' as ltxzu )                    as LongTextExists,
      orderBOM.BillOfMaterialStatus         as BillOfMaterialStatus,
      //@ObjectModel.readOnly: true

      @Semantics.businessDate.to: true
      orderBOM.HeaderValidityEndDate,
      @Semantics.businessDate.from: true
      orderBOM.HeaderValidityStartDate,
      orderBOM.ChgToEngineeringChgDocument  as ChgToEngineeringChgDocument,
      orderBOM.IsMarkedForDeletion          as IsMarkedForDeletion,
      orderBOM.BOMIsArchivedForDeletion,
      orderBOM.IsConfiguredMaterial         as IsConfiguredMaterial, -- MAST-KZKFG
      orderBOM.BOMIsConfigurable            as BOMIsConfigurable, -- MAST-KZKFG
      //@ObjectModel.readOnly: true

      orderBOM.IsALE                        as IsALE,
      @Semantics.unitOfMeasure: true
      @ObjectModel.foreignKey.association: '_UnitOfMeasure'
      orderBOM.BOMHeaderBaseUnit            as BOMHeaderBaseUnit,
      @Semantics.quantity.unitOfMeasure: 'BOMHeaderBaseUnit'
      @DefaultAggregation :#NONE
      orderBOM.BOMHeaderQuantityInBaseUnit  as BOMHeaderQuantityInBaseUnit,
      orderBOM.RecordCreationDate           as RecordCreationDate,
      orderBOM.LastChangeDate               as LastChangeDate,
      orderBOM.LastChangedByUser            as LastChangedByUser,
      orderBOM.CreatedByUser                as CreatedByUser,
      orderBOM.BOMIsToBeDeleted             as BOMIsToBeDeleted,
      orderBOM.DocumentIsCreatedByCAD       as DocumentIsCreatedByCAD,
      orderBOM.LaboratoryOrDesignOffice     as LaboratoryOrDesignOffice,
      orderBOM.LastChangeDateTime           as LastChangeDateTime,
      orderBOM.BOMAssetNtwkHndovrIsRelevant as BOMAssetNtwkHndovrIsRelevant,
      cast('' as cs_matbom_key )            as MaterialBOMObjectID,
      --   '' as BOMPredecessorVersion,
      orderBOM.BOMPredecessorVersion
      

}
where
  BillOfMaterialCategory = 'K'
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_BILLOFMATERIAL",
"I_MATERIALBOMLINK",
"I_SALESORDERBOMLINK"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/