I_EHSRISKCONTROL

CDS View

EHS Risk Control

I_EHSRISKCONTROL is a CDS View in S/4HANA. EHS Risk Control. It contains 12 fields. 11 CDS views read from this table.

CDS Views using this table (11)

ViewTypeJoinVDMDescription
A_EHSRiskControlForSafetyInfo view from COMPOSITE Risk Controls for Safety Relevant Information
C_AdhocEHSCtrlForIdentifyRisks view from CONSUMPTION Adhoc EHS Control For Identify Risks
C_EHSControlImplmtnForTaskList view from CONSUMPTION EHS Control Implementation for Task List
C_StdEHSCtrlForIdentifyRisks view from CONSUMPTION Standard EHS Control
I_EHSControlImpl view from COMPOSITE EHS Risk Control Implementation
I_EHSCtrlImplmtnAuthznFields view from BASIC EHS Control Implementation Authorization Fields
P_EHSControlImplResponsible view from CONSUMPTION Control Implementation Responsible
P_EHSControlsCount view from CONSUMPTION
P_EHSRiskAssessmentControls view inner COMPOSITE
P_ImplmtdRiskCtrlCountByType view from COMPOSITE
P_RiskControlCountByType view from COMPOSITE

Fields (12)

KeyField CDS FieldsUsed in Views
KEY EHSControlInstanceUUID EHSControlInstanceUUID 2
KEY EHSRiskRevisionUUID EHSRiskRevisionUUID 4
_EHSControlAdhocSubtype _EHSControlAdhocSubtype 1
_EHSControlAdhocType _EHSControlAdhocType 1
_EHSControlRemarkText _EHSControlRemarkText 1
EHSControlAdhocSubtype EHSControlAdhocSubtype 1
EHSControlAdhocTitle EHSControlAdhocTitle 1
EHSControlAdhocType EHSControlAdhocType 1
EHSControlRemarkUUID EHSControlRemarkUUID 1
EHSControlUUID EHSControlUUID 2
EHSRiskUUID EHSRiskUUID 1
ResponsiblePerson ResponsiblePerson 1
@EndUserText.label: 'EHS Risk Control'
@VDM.viewType: #BASIC
@ObjectModel.representativeKey: 'EHSControlInstanceUUID'
@AccessControl.authorizationCheck: #NOT_REQUIRED

@AbapCatalog.sqlViewName: 'IEHSRSKCTRL'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey:true

// Client handling by session

@ClientHandling.algorithm: #SESSION_VARIABLE

// used for BOBF Master Data Object

@ObjectModel.usageType:{ serviceQuality: #C,        // < 15 msec

                         sizeCategory:  #L,         // < 10.000.000

                         dataClass: #MIXED }

define view I_EHSRiskControl
  as select from ehhssd_rsk_ctrl

  association [0..1] to I_User                  as _CreatedByUser               on $projection.CreatedByUser = _CreatedByUser.UserID
  association [0..1] to I_User                  as _LastChangedByUser           on $projection.LastChangedByUser = _LastChangedByUser.UserID
  association [1..1] to I_EHSCtrlImplStatus     as _EHSCtrlImplementationStatus on $projection.EHSControlImplStatus = _EHSCtrlImplementationStatus.EHSControlImplStatus
  association [0..1] to I_EHSCtrlRefCat         as _EHSControlRefCategory       on $projection.EHSControlRefCategory = _EHSControlRefCategory.EHSControlRefCategory
  association [1..1] to I_EHSRiskRoot           as _EHSRiskRoot                 on $projection.EHSRiskUUID = _EHSRiskRoot.EHSRiskUUID
  association [1..1] to I_EHSRiskRevision       as _EHSRiskRevision             on $projection.EHSRiskRevisionUUID = _EHSRiskRevision.EHSRiskRevisionUUID
  association [0..1] to I_EHSControl            as _EHSControl                  on $projection.EHSControlUUID = _EHSControl.EHSControlUUID
  association [0..1] to I_EHSCtrlEffect         as _DesiredEHSControlEffect     on $projection.DesiredEHSControlEffect = _DesiredEHSControlEffect.DesiredEHSControlEffect
  association [0..1] to I_EHSCtrlGoalTar        as _EHSControlTarget            on $projection.EHSControlTarget = _EHSControlTarget.EHSControlTarget
  association [1..1] to I_Hazard                as _Hazard                      on $projection.Hazard = _Hazard.Hazard
  association [0..*] to I_EHSTextCollectionText as _EHSControlRemarkText        on $projection.EHSControlRemarkUUID = _EHSControlRemarkText.TextCollectionUUID
  association [0..1] to I_EHSControlType        as _EHSControlAdhocType         on $projection.EHSControlAdhocType = _EHSControlAdhocType.EHSControlType
  association [0..1] to I_EHSControlSubtype     as _EHSControlAdhocSubtype      on $projection.EHSControlAdhocSubtype = _EHSControlAdhocSubtype.EHSControlSubtype
{



  key db_key                                                                                as EHSControlInstanceUUID,
      bintohex(db_key)                                                                      as EHSControlInstanceUUIDHex,
      @ObjectModel.foreignKey.association: '_EHSRiskRoot'
      cast( ehhssd_rsk_ctrl.root_key as ehhss_risk_key_ref preserving type )                as EHSRiskUUID,
      _EHSRiskRoot,
      @ObjectModel.foreignKey.association: '_EHSRiskRevision'
      cast( parent_key as ehhss_risk_key_ref preserving type )                              as EHSRiskRevisionUUID,
      _EHSRiskRevision,
      @ObjectModel.foreignKey.association: '_EHSControl'
      control_code                                                                          as EHSControlUUID,
      _EHSControl,
      resp_id                                                                               as ResponsiblePerson,

      //    ResponsiblePersonFullName not determined here, because complex authority-checks would be needed

      //    check if conversion exits in the UI return the name


      @ObjectModel.foreignKey.association: '_EHSCtrlImplementationStatus'
      cast( impl_status as ehhss_ctrl_impl_status_nc preserving type )                      as EHSControlImplStatus,
      _EHSCtrlImplementationStatus,

      //    For testing show Status Text in English * remove me *

      //      _EHSCtrlImplStatus._Text[1: Language = $session.system_language ].EHSControlImplStatusName,


      @ObjectModel.foreignKey.association: '_Hazard'
      hazard_code                                                                           as Hazard,
      _Hazard,

      @ObjectModel.foreignKey.association: '_EHSControlTarget'
      goal_target_code                                                                      as EHSControlTarget,
      _EHSControlTarget,

      goal_object_code                                                                      as EHSControlObjective,
      @ObjectModel.foreignKey.association: '_DesiredEHSControlEffect'
      goal_ctrl_effect                                                                      as DesiredEHSControlEffect,
      _DesiredEHSControlEffect,

      @ObjectModel.text.association: '_EHSControlRemarkText'
      cast ( desc_key_ref as ehhss_ctrl_remark_uuid preserving type )                       as EHSControlRemarkUUID,
      _EHSControlRemarkText,

      @ObjectModel.foreignKey.association: '_EHSControlRefCategory'
      ref_category                                                                          as EHSControlRefCategory,
      _EHSControlRefCategory,

      //    For testing show Status Text in English * remove me *

      //      _EHSCtrlRefCat._Text[1: Language = $session.system_language ].EHSControlRefCategoryName as EHSControlRefCategoryName,


      ref_id                                                                                as EHSControlRefObject,

      //    has to be checked if case should be executed in higher view - example below returns the correct names

      cast ( case ref_category
        when '01' then ehhssd_rsk_ctrl.ref_id
        else ''
      end as matnr  )                                                                       as Material,

      cast ( case ref_category
        when '02' then ehhssd_rsk_ctrl.ref_id
        else ''
      end as equnr )                                                                        as Equipment,

      cast ( case ref_category
        when '03' then ehhssd_rsk_ctrl.ref_id
        else ''
      end as tplnr )                                                                        as FunctionalLocation,

      cast ( case ref_category
        when '02' then ehhssd_rsk_ctrl.ref_id
        when '03' then ehhssd_rsk_ctrl.ref_id
        else ''
      end as ehfnd_tmo_id_conv_eams )                                                       as MaintenanceObject,

      cast ( case ref_category
        when '02' then 'EAMS_EQUI'
        when '03' then 'EAMS_FL'
        else ''
      end as eams_tec_obj_type_value )                                                      as TechObjIsEquipOrFuncnlLoc,

      // Fields for Ad-Hoc Control

      proposal_ind                                                                          as EHSControlIsAdhoc,
      ehhssd_rsk_ctrl.proposed_title                                                        as EHSControlAdhocTitle,

      @ObjectModel.foreignKey.association: '_EHSControlAdhocType'
      cast ( ehhssd_rsk_ctrl.proposed_type as ehhss_control_type_code preserving type )     as EHSControlAdhocType,
      _EHSControlAdhocType,

      @ObjectModel.foreignKey.association: '_EHSControlAdhocSubtype'
      cast ( ehhssd_rsk_ctrl.proposed_subj  as ehhss_control_subtype_code preserving type ) as EHSControlAdhocSubtype,
      _EHSControlAdhocSubtype,

      // Admin data

      cast(datetime_cr as timestamp preserving type)                                        as CreationDateTime,
      user_id_cr                                                                            as CreatedByUser,
      _CreatedByUser,
      cast(datetime_ch as timestamp preserving type)                                        as LastChangeDateTime,
      user_id_ch                                                                            as LastChangedByUser,
      _LastChangedByUser

}