P_RSHTaskListOperations

DDL: P_RSHTASKLISTOPERATIONS SQL: PRSHTASKLST Type: view CONSUMPTION

Task List Operations

P_RSHTaskListOperations is a Consumption CDS View that provides data about "Task List Operations" in SAP S/4HANA. It reads from 4 data sources (I_RSHAssignedWorkCenters, I_OperationControlProfile, I_BOOSqncOperationAssgmtChgSt, I_BillOfOperationsOpBasic) and exposes 21 fields with key fields BillOfOperationsType, BillOfOperationsGroup, BillOfOperationsVariant, BillOfOperationsSequence, BOOOperationInternalID.

Data Sources (4)

SourceAliasJoin Type
I_RSHAssignedWorkCenters I_RSHAssignedWorkCenters inner
I_OperationControlProfile OperationControlProfile inner
I_BOOSqncOperationAssgmtChgSt plas inner
I_BillOfOperationsOpBasic plpo from

Annotations (7)

NameValueLevelField
AbapCatalog.sqlViewName PRSHTASKLST view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #CHECK view
VDM.private true view
VDM.viewType #CONSUMPTION view
EndUserText.label Task List Operations view
ClientHandling.algorithm #SESSION_VARIABLE view

Fields (21)

KeyFieldSource TableSource FieldDescription
KEY BillOfOperationsType I_BOOSqncOperationAssgmtChgSt BillOfOperationsType
KEY BillOfOperationsGroup I_BOOSqncOperationAssgmtChgSt BillOfOperationsGroup
KEY BillOfOperationsVariant I_BOOSqncOperationAssgmtChgSt BillOfOperationsVariant
KEY BillOfOperationsSequence I_BOOSqncOperationAssgmtChgSt BillOfOperationsSequence
KEY BOOOperationInternalID I_BOOSqncOperationAssgmtChgSt BOOOperationInternalID
KEY SuperiorOperationInternalID I_BillOfOperationsOpBasic SuperiorOperationInternalID
WorkCenterInternalID I_BillOfOperationsOpBasic WorkCenterInternalID
WorkCenterTypeCode I_BillOfOperationsOpBasic WorkCenterTypeCode
CapacityInternalId I_RSHAssignedWorkCenters CapacityInternalID
WorkCenter I_RSHAssignedWorkCenters WorkCenter
WorkCenterCategoryCode I_RSHAssignedWorkCenters WorkCenterCategoryCode
Plant I_BillOfOperationsOpBasic Plant
Operation Operation
OperationendasSubOperation
OperationOperationText
ControlKey I_BillOfOperationsOpBasic OperationControlProfile
OpPlannedWorkQuantity I_BillOfOperationsOpBasic OpPlannedWorkQuantity
OpWorkQuantityUnit I_BillOfOperationsOpBasic OpWorkQuantityUnit
fltpasTotalWork
TotalWorkUnit
MaintOperationExecStageCode I_BillOfOperationsOpBasic MaintOperationExecStageCode
@AbapCatalog.sqlViewName: 'PRSHTASKLST'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@VDM.private: true
@VDM.viewType: #CONSUMPTION
@EndUserText.label: 'Task List Operations'
@ClientHandling.algorithm: #SESSION_VARIABLE


/*
CONTRACT**********************************************************************************************************************

Name:                       List of Operations and Sub Operations of the task list
Specification:              This View reads the details of operaions and sub operations from the task list
Requires:                   NA
Ensures:                    All the operations and sub operations from the task list that are assigned to users work centers
                            are read.
                            Total Work is converted to seconds.
Owners:                     AN
Contributors:               CK
Unit Test required Y/N:     Yes
Additional comments         None

END OF CONTRACT***************************************************************************************************************
*/

define view P_RSHTaskListOperations

  as select from I_BillOfOperationsOpBasic     as plpo

    inner join   I_BOOSqncOperationAssgmtChgSt as plas                    on  plas.BillOfOperationsType             =  plpo.BillOfOperationsType
                                                                          and plas.BillOfOperationsGroup            =  plpo.BillOfOperationsGroup

    //                                                       and plas.ValidityStartDate      >= plpo.ValidityStartDate


                                                                          and plas.ValidityStartDate                <= plpo.ValidityEndDate
                                                                          and plas.ValidityEndDate                  >= plpo.ValidityStartDate


                                                                          and (
                                                                             ( // Operation

                                                                               plas.BOOOperationInternalID          =  plpo.BOOOperationInternalID
                                                                               and plpo.SuperiorOperationInternalID =  '00000000'
                                                                             )

                                                                             or

                                                                             ( // Sub-Operation

                                                                               plas.BOOOperationInternalID          =  plpo.SuperiorOperationInternalID
                                                                             )
                                                                           )

  //   ... for Assigned Work Centers ...

    inner join   I_RSHAssignedWorkCenters                                 on  plpo.WorkCenterInternalID = I_RSHAssignedWorkCenters.WorkCenterInternalID
                                                                          and plpo.WorkCenterTypeCode   = I_RSHAssignedWorkCenters.WorkCenterTypeCode

  //Filter out the operations with control key which is not relevant for scheduling

    inner join   I_OperationControlProfile     as OperationControlProfile on  OperationControlProfile.OperationControlProfile = plpo.OperationControlProfile
                                                                          and OperationControlProfile.OperationIsScheduled    = 'X'

{
  key plas.BillOfOperationsType,
  key plas.BillOfOperationsGroup,
  key plas.BillOfOperationsVariant,
  key plas.BillOfOperationsSequence,
  key plas.BOOOperationInternalID,
  key plpo.SuperiorOperationInternalID,

      plpo.WorkCenterInternalID,
      plpo.WorkCenterTypeCode,
      I_RSHAssignedWorkCenters.CapacityInternalID                 as CapacityInternalId,
      I_RSHAssignedWorkCenters.WorkCenter                         as WorkCenter,
      I_RSHAssignedWorkCenters.WorkCenterCategoryCode             as WorkCenterCategoryCode,
      plpo.Plant,

      cast(case when plpo.ValidityStartDate > plas.ValidityStartDate then plpo.ValidityStartDate
      else plas.ValidityStartDate
      end as pph_begda preserving type)                           as ValidityStartDate,

      //    In case the end date is not filled, do not fill it here; This has to be done by the application

      cast(case when plpo.ValidityEndDate < plas.ValidityEndDate then plpo.ValidityEndDate
      else plas.ValidityEndDate
      end as pph_endda preserving type)                           as ValidityEndDate,

      Operation,

      // Determine Sub Operation ID

      case when ( plas.BOOOperationInternalID = plpo.BOOOperationInternalID )
           then ' '
           else plpo.Operation end                                as SubOperation,

      -- Operation
      OperationText,

      plpo.OperationControlProfile                                as ControlKey,

      plpo.OpPlannedWorkQuantity,
      plpo.OpWorkQuantityUnit,

      // Get Total Work in Seconds

      cast( unit_conversion(
                 QUANTITY =>plpo.OpPlannedWorkQuantity ,
                 SOURCE_UNIT =>plpo.OpWorkQuantityUnit,
                 TARGET_UNIT => cast( 'S' as abap.unit(3) ),
                 ERROR_HANDLING => 'SET_TO_NULL' ) as abap.fltp ) as TotalWork,

      'S'                                                         as TotalWorkUnit,
      plpo.MaintOperationExecStageCode                            as MaintOperationExecStageCode

}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_BILLOFOPERATIONSOPBASIC",
"I_BOOSQNCOPERATIONASSGMTCHGST",
"I_OPERATIONCONTROLPROFILE",
"I_RSHASSIGNEDWORKCENTERS"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/