C_OperationActyPRTAssignment

DDL: C_OPERATIONACTYPRTASSIGNMENT SQL: CMPEOAPRTA Type: view CONSUMPTION

C_OperationActyPRTAssignment is a Consumption CDS View in SAP S/4HANA. It reads from 1 data source (P_OperationActyPRTAssignment) and exposes 44 fields with key fields OpActyNtwkInstance, OpActyNtwkElement, OrderInternalID, MfgOrderOpProdnRsceToolIntID, Equipment. It has 1 association to related views.

Data Sources (1)

SourceAliasJoin Type
P_OperationActyPRTAssignment OperationActyPRTAssignment from

Associations (1)

CardinalityTargetAliasCondition
[0..*] I_OpActyInstceEquipActvRegn _OpActyInstceEquipActvRegn $projection.OpActyNtwkInstance = _OpActyInstceEquipActvRegn.OpActyNtwkInstance and $projection.OpActyNtwkElement = _OpActyInstceEquipActvRegn.OpActyNtwkElement and $projection.OrderInternalID = _OpActyInstceEquipActvRegn.OrderInternalID and $projection.MfgOrderOpProdnRsceToolIntID = _OpActyInstceEquipActvRegn.MfgOrderOpProdnRsceToolIntID and ( $projection.ProdnRsceToolCategory <> 'E' or $projection.Equipment = _OpActyInstceEquipActvRegn.Equipment )

Annotations (8)

NameValueLevelField
AbapCatalog.sqlViewName CMPEOAPRTA view
AccessControl.authorizationCheck #CHECK view
ClientHandling.algorithm #SESSION_VARIABLE view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.sizeCategory #XL view
ObjectModel.usageType.dataClass #MIXED view
VDM.viewType #CONSUMPTION view
AbapCatalog.compiler.compareFilter true view

Fields (44)

KeyFieldSource TableSource FieldDescription
KEY OpActyNtwkInstance P_OperationActyPRTAssignment OpActyNtwkInstance
KEY OpActyNtwkElement P_OperationActyPRTAssignment OpActyNtwkElement
KEY OrderInternalID P_OperationActyPRTAssignment OrderInternalID
KEY MfgOrderOpProdnRsceToolIntID P_OperationActyPRTAssignment MfgOrderOpProdnRsceToolIntID
KEY Equipment
KEY ProductionResourceType P_OperationActyPRTAssignment ProductionResourceType
KEY ProductionResourceInternalID P_OperationActyPRTAssignment ProductionResourceInternalID
PRTIsUsedAsTestEquipment P_OperationActyPRTAssignment PRTIsUsedAsTestEquipment
ProdnRsceToolCategory
ProdnRsceToolCategoryName
MiscProductionResourceTool P_OperationActyPRTAssignment MiscProductionResourceTool
ProdnRsceToolRegnIsAllowed P_OperationActyPRTAssignment ProdnRsceToolRegnIsAllowed
Material P_OperationActyPRTAssignment Material
MaterialName
SerialNumber
UniqueItemIdentifier
DocumentType P_OperationActyPRTAssignment DocumentType
DocumentInfoRecord P_OperationActyPRTAssignment DocumentInfoRecord
DocumentVersion P_OperationActyPRTAssignment DocumentVersion
DocumentPart P_OperationActyPRTAssignment DocumentPart
PlannedProdnRsceToolQtyUnit P_OperationActyPRTAssignment PlannedProdnRsceToolQtyUnit
PlannedTotalProdnRsceToolQty P_OperationActyPRTAssignment PlannedTotalProdnRsceToolQty
PlannedTotalProdnRsceToolQtythen1red
NumberOfActvEquipRegistrations P_OperationActyPRTAssignment NumberOfActvEquipRegistrations
BaseUnit P_OperationActyPRTAssignment BaseUnit
RegisteredPRTQtyInBaseUnit
ManufacturingOrderCategory P_OperationActyPRTAssignment ManufacturingOrderCategory
ManufacturingOrderType P_OperationActyPRTAssignment ManufacturingOrderType
ProductionPlant P_OperationActyPRTAssignment ProductionPlant
ProdnRsceToolItemNumber P_OperationActyPRTAssignment ProdnRsceToolItemNumber
MfgOrderOpPRTItemNumber
BOOOperationPRTInternalID P_OperationActyPRTAssignment BOOOperationPRTInternalID
PRTRegistrationControl P_OperationActyPRTAssignment PRTRegistrationControl
PRTRegistrationControlName
_OpActyNtwkInstance
_OperationActivityInstance P_OperationActyPRTAssignment _OperationActivityInstance
_OrdInternalBillOfOperations P_OperationActyPRTAssignment _OrdInternalBillOfOperations
_ProductionResourceType P_OperationActyPRTAssignment _ProductionResourceType
_ProdnRsceToolCategory P_OperationActyPRTAssignment _ProdnRsceToolCategory
_Material P_OperationActyPRTAssignment _Material
_MfgOrderCategory P_OperationActyPRTAssignment _MfgOrderCategory
_MfgOrderType P_OperationActyPRTAssignment _MfgOrderType
_OpActyInstceEquipActvRegn _OpActyInstceEquipActvRegn
_ProductionPlant P_OperationActyPRTAssignment _ProductionPlant
@AbapCatalog.sqlViewName: 'CMPEOAPRTA'
@AccessControl.authorizationCheck: #CHECK
@ClientHandling.algorithm: #SESSION_VARIABLE
@ObjectModel.usageType: {serviceQuality: #D, sizeCategory: #XL, dataClass: #MIXED}
@VDM.viewType: #CONSUMPTION
@AbapCatalog.compiler.compareFilter: true
//@AbapCatalog.preserveKey:true

define view C_OperationActyPRTAssignment
  as select from           P_OperationActyPRTAssignment as OperationActyPRTAssignment
    left outer to one join P_OpActyNrOfActvEquipRegn    as OpActyNrOfActvEquipRegn on  OpActyNrOfActvEquipRegn.OpActyNtwkInstance           =  OperationActyPRTAssignment.OpActyNtwkInstance
                                                                                   and OpActyNrOfActvEquipRegn.OpActyNtwkElement            =  OperationActyPRTAssignment.OpActyNtwkElement
                                                                                   and OpActyNrOfActvEquipRegn.OrderInternalID              =  OperationActyPRTAssignment.OrderInternalID
                                                                                   and OpActyNrOfActvEquipRegn.MfgOrderOpProdnRsceToolIntID =  OperationActyPRTAssignment.MfgOrderOpProdnRsceToolIntID
                                                                                   and OpActyNrOfActvEquipRegn.MfgOrderOpProdnRsceToolIntID <> '00000000'
    left outer to one join I_DocumentInfoRecordDesc     as DocumentInfoRecordDesc  on  DocumentInfoRecordDesc.DocumentInfoRecordDocType    = OperationActyPRTAssignment.DocumentType
                                                                                   and DocumentInfoRecordDesc.DocumentInfoRecordDocNumber  = OperationActyPRTAssignment.DocumentInfoRecord
                                                                                   and DocumentInfoRecordDesc.DocumentInfoRecordDocVersion = OperationActyPRTAssignment.DocumentVersion
                                                                                   and DocumentInfoRecordDesc.DocumentInfoRecordDocPart    = OperationActyPRTAssignment.DocumentPart
                                                                                   and DocumentInfoRecordDesc.Language                     = $session.system_language

  association [0..*] to I_OpActyInstceEquipActvRegn as _OpActyInstceEquipActvRegn on  $projection.OpActyNtwkInstance           =  _OpActyInstceEquipActvRegn.OpActyNtwkInstance
                                                                                  and $projection.OpActyNtwkElement            =  _OpActyInstceEquipActvRegn.OpActyNtwkElement
                                                                                  and $projection.OrderInternalID              =  _OpActyInstceEquipActvRegn.OrderInternalID
                                                                                  and $projection.MfgOrderOpProdnRsceToolIntID =  _OpActyInstceEquipActvRegn.MfgOrderOpProdnRsceToolIntID
                                                                                  and (
                                                                                     $projection.ProdnRsceToolCategory         <> 'E'
                                                                                     or $projection.Equipment                  =  _OpActyInstceEquipActvRegn.Equipment
                                                                                   )
{
        @UI.hidden: true
        @ObjectModel.foreignKey.association: '_OpActyNtwkInstance'
        @Consumption.valueHelpDefinition: [ { entity: { name: 'I_OpActyNtwkInstanceStdVH', element: 'OpActyNtwkInstance' } } ]
  key   OperationActyPRTAssignment.OpActyNtwkInstance,

        @UI.hidden: true
        @ObjectModel.foreignKey.association: '_OperationActivityInstance'
        @Consumption.valueHelpDefinition: [ { entity: { name: 'I_OpActyInstceStdVH', element: 'OpActyNtwkElement' } } ]
  key   OperationActyPRTAssignment.OpActyNtwkElement,

        @UI.hidden: true
        @ObjectModel.foreignKey.association: '_OrdInternalBillOfOperations'
  key   OperationActyPRTAssignment.OrderInternalID,

        @UI.hidden: true
  key   OperationActyPRTAssignment.MfgOrderOpProdnRsceToolIntID,

        @UI.lineItem: [{position: 40, qualifier: 'MYWORKQUEUE' }]
  key   cast(coalesce(OperationActyPRTAssignment.Equipment, '') as equnr)                                                                               as Equipment,

        @UI.hidden: true
        @ObjectModel.foreignKey.association: '_ProductionResourceType'
  key   OperationActyPRTAssignment.ProductionResourceType                                                                                               as ProductionResourceType,

        @UI.hidden: true
  key   OperationActyPRTAssignment.ProductionResourceInternalID                                                                                         as ProductionResourceInternalID,

        @UI: {
          identification.position: 10,
          statusInfo.position: 10,
          lineItem: [{ position: 10 }, {position: 10, qualifier: 'MYWORKQUEUE' } ],
          selectionField.position: 10,
          fieldGroup.position: 10
        }
        @ObjectModel: {
          virtualElement: true,
          virtualElementCalculatedBy: 'ABAP:CL_MPE_PRT_CNVRSN_ROUTINE_EXE'
        }
        cast(
        // case OperationActyPRTAssignment.ProdnRsceToolCategory

        //   when 'M' then OperationActyPRTAssignment.Material

        //   when 'E' then OperationActyPRTAssignment.Equipment

        //   when 'S' then ProdnRsceToolMasterData.MiscProductionResourceTool

        //   when 'D' then concat_with_space(concat_with_space(concat_with_space(

        //                 OperationActyPRTAssignment.DocumentInfoRecord, OperationActyPRTAssignment.DocumentType, 1), OperationActyPRTAssignment.DocumentPart, 1), OperationActyPRTAssignment.DocumentVersion, 1)

        //    when 'P' then ProdnRsceToolMasterData.MeasuringPoint

        //  else ' ' end

        '' as pph_fhmnr )                                                                                                                               as ProductionResourceTool,

        @UI: {
          identification.position: 20,
          statusInfo.position: 20,
          lineItem: [{ position: 20 }],
          selectionField.position: 20,
          fieldGroup.position: 20
        }
        cast(case
          when OperationActyPRTAssignment.OrderProdnRsceToolText <> ''
            then OperationActyPRTAssignment.OrderProdnRsceToolText
          else case OperationActyPRTAssignment.ProdnRsceToolCategory
            when 'M' then OperationActyPRTAssignment._Material._Text[1: Language=$session.system_language].MaterialName
            when 'E' then OperationActyPRTAssignment._Equipment._EquipmentText[1: Language=$session.system_language].EquipmentName
            when 'S' then OperationActyPRTAssignment._MiscProdnRsceToolText[1: Language=$session.system_language].MiscProductionResourceToolDesc
            when 'D' then DocumentInfoRecordDesc.DocumentDescription
        // when 'P' then I_MeasuringPoint.MeasuringPointDescription

            else ' '
          end end as fhktx preserving type)                                                                                                             as MfgOrderOpProdnRsceToolText,

        OperationActyPRTAssignment.PRTIsUsedAsTestEquipment                                                                                             as PRTIsUsedAsTestEquipment,

        @UI: {
          identification: [{position: 30}],
          statusInfo: [{position: 30}],
          lineItem: [{ position: 30 }, {position: 20, qualifier: 'MYWORKQUEUE' } ],
          selectionField : [{position: 30}],
          fieldGroup : [{position: 30}]
        }
        @ObjectModel.text.element: ['ProdnRsceToolCategoryName']
        cast(OperationActyPRTAssignment._ProdnRsceToolCategory._Text[1: Language=$session.system_language].ProdnRsceToolCategoryExtCode
          as mpe_fhmar preserving type)                                                                                                                 as ProdnRsceToolCategoryExtCode,

        @UI.hidden: true
        @ObjectModel.foreignKey.association: '_ProdnRsceToolCategory'
        cast(OperationActyPRTAssignment.ProdnRsceToolCategory as mpe_fhmar preserving type)                                                             as ProdnRsceToolCategory,

        @UI.hidden: true
        OperationActyPRTAssignment._ProdnRsceToolCategory._Text[1: Language=$session.system_language].ProdnRsceToolCategoryName                         as ProdnRsceToolCategoryName,

        @UI.hidden: true
        OperationActyPRTAssignment.MiscProductionResourceTool                                                                                           as MiscProductionResourceTool,

        @UI.hidden: true
        OperationActyPRTAssignment.ProdnRsceToolRegnIsAllowed                                                                                           as ProdnRsceToolRegnIsAllowed,

        @ObjectModel.foreignKey.association: '_Material'
        @ObjectModel.text.element: ['MaterialName']
        OperationActyPRTAssignment.Material                                                                                                             as Material,

        @UI.hidden: true
        OperationActyPRTAssignment._Material._Text[1: Language=$session.system_language].MaterialName                                                   as MaterialName,

        @UI.lineItem: [{position: 50, qualifier: 'MYWORKQUEUE' }]
        OperationActyPRTAssignment._Equipment.SerialNumber                                                                                              as SerialNumber,
        @UI.lineItem: [{position: 70, qualifier: 'MYWORKQUEUE' }]
        OperationActyPRTAssignment._Equipment.UniqueItemIdentifier                                                                                      as UniqueItemIdentifier,

        @UI.hidden: true
        OperationActyPRTAssignment.DocumentType                                                                                                         as DocumentType,
        @UI.hidden: true
        OperationActyPRTAssignment.DocumentInfoRecord                                                                                                   as DocumentInfoRecord,
        @UI.hidden: true
        OperationActyPRTAssignment.DocumentVersion                                                                                                      as DocumentVersion,
        @UI.hidden: true
        OperationActyPRTAssignment.DocumentPart                                                                                                         as DocumentPart,

        @UI.hidden: true
        @Semantics.unitOfMeasure: true
        OperationActyPRTAssignment.PlannedProdnRsceToolQtyUnit,

        @UI: {
          identification.position: 40,
          statusInfo.position: 40,
          lineItem: [{ position: 40 }, {position: 60, qualifier: 'MYWORKQUEUE' } ],
          selectionField.position: 40,
          fieldGroup.position: 40
        }
        @Semantics.quantity.unitOfMeasure: 'PlannedProdnRsceToolQtyUnit'
        OperationActyPRTAssignment.PlannedTotalProdnRsceToolQty,

        @UI.hidden: true
        case
          when OperationActyPRTAssignment.MfgOrderOpProdnRsceToolIntID = '00000000' then 1
          else case
            when OperationActyPRTAssignment.RegisteredPRTQtyInBaseUnit = 0
              or OperationActyPRTAssignment.RegisteredPRTQtyInBaseUnit is null
              or OperationActyPRTAssignment.PlannedTotalProdnRsceToolQty is null then 0 --gray
            when OperationActyPRTAssignment.RegisteredPRTQtyInBaseUnit > OperationActyPRTAssignment.PlannedTotalProdnRsceToolQty then 1 --red, because overfilled
            when OperationActyPRTAssignment.RegisteredPRTQtyInBaseUnit = OperationActyPRTAssignment.PlannedTotalProdnRsceToolQty then 3 --green
            else 2 --yellow, not filled completely
          end
        end                                                                                                                                             as PRTRegistrationCriticality,

        @UI: {
          identification.position: 50,
          statusInfo.position: 50,
          lineItem: [{ position: 50 }],
          selectionField.position: 50,
          fieldGroup.position: 50
        }
        OperationActyPRTAssignment.NumberOfActvEquipRegistrations                                                                                       as NumberOfActvEquipRegistrations,

        @UI.hidden: true
        @Semantics.unitOfMeasure: true
        OperationActyPRTAssignment.BaseUnit                                                                                                             as BaseUnit,

        @Semantics.quantity.unitOfMeasure: 'BaseUnit'
        cast( OperationActyPRTAssignment.RegisteredPRTQtyInBaseUnit as mpe_prt_registered_qty preserving type )                                         as RegisteredPRTQtyInBaseUnit,

        @UI.hidden: true
        @ObjectModel.foreignKey.association: '_MfgOrderCategory'
        OperationActyPRTAssignment.ManufacturingOrderCategory                                                                                           as ManufacturingOrderCategory,

        @UI.hidden: true
        @ObjectModel.foreignKey.association: '_MfgOrderType'
        OperationActyPRTAssignment.ManufacturingOrderType                                                                                               as ManufacturingOrderType,

        @UI.hidden: true
        @ObjectModel.foreignKey.association: '_ProductionPlant'
        OperationActyPRTAssignment.ProductionPlant                                                                                                      as ProductionPlant,

        @UI.hidden: true
        OperationActyPRTAssignment.ProdnRsceToolItemNumber                                                                                              as ProdnRsceToolItemNumber,

        cast(OperationActyPRTAssignment.ProdnRsceToolItemNumber as mpe_psnfh_char)                                                                      as MfgOrderOpPRTItemNumber,

        @UI.hidden: true
        OperationActyPRTAssignment.BOOOperationPRTInternalID,
        @UI: {
          lineItem: [{ position: 30 }],
          textArrangement: #TEXT_ONLY
        }
        @ObjectModel.text.element: ['PRTRegistrationControlName']
        OperationActyPRTAssignment.PRTRegistrationControl                                                                                               as PRTRegistrationControl,

        @UI.hidden: true
        OperationActyPRTAssignment._PRTRegistrationControl._PRTRegistrationControlText[1: Language=$session.system_language].PRTRegistrationControlName as PRTRegistrationControlName,

        --Association
        OperationActyPRTAssignment._OpActyNtwkInstance,
        OperationActyPRTAssignment._OperationActivityInstance,
        OperationActyPRTAssignment._OrdInternalBillOfOperations,
        OperationActyPRTAssignment._ProductionResourceType,
        OperationActyPRTAssignment._ProdnRsceToolCategory,
        OperationActyPRTAssignment._Material,
        OperationActyPRTAssignment._MfgOrderCategory,
        OperationActyPRTAssignment._MfgOrderType,
        _OpActyInstceEquipActvRegn,
        OperationActyPRTAssignment._ProductionPlant

};
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_DOCUMENTINFORECORDDESC",
"I_EQUIPMENT",
"I_EQUIPMENTTEXT",
"I_MATERIAL",
"I_MATERIALTEXT",
"I_MISCPRODNRSCETOOLTEXT",
"I_PRODNRSCETOOLCATEGORYTEXT_2",
"I_PRODNRSCETOOLCATEGORY_2",
"I_PRTREGISTRATIONCONTROL",
"I_PRTREGISTRATIONCONTROLTEXT",
"P_OPACTYNROFACTVEQUIPREGN",
"P_OPERATIONACTYPRTASSIGNMENT"
],
"ASSOCIATED":
[
"I_MATERIAL",
"I_MFGORDERCATEGORY",
"I_MFGORDERTYPE",
"I_OPACTYINSTCEEQUIPACTVREGN",
"I_OPACTYNTWKINSTANCE",
"I_OPERATIONACTIVITYINSTANCE",
"I_ORDINTERNALBILLOFOPERATIONS",
"I_PLANT",
"I_PRODNRSCETOOLCATEGORY_2",
"I_PRODUCTIONRESOURCETYPE"
],
"BASE":
[
"P_OPERATIONACTYPRTASSIGNMENT"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/