I_EHSRISKROOT

CDS View

EHS Risk Root

I_EHSRISKROOT is a CDS View in S/4HANA. EHS Risk Root. It contains 19 fields. 6 CDS views read from this table.

CDS Views using this table (6)

ViewTypeJoinVDMDescription
A_ChemicalForSafetyInfo view inner COMPOSITE Chemicals for Safety Relevant Information
C_ChemicalForSafetyInsights view inner CONSUMPTION Chemical for Safety Insights
I_ChemicalRiskReportC view inner COMPOSITE Chemical Risk Report Cube
I_ChmRskAtEHSLocC view inner COMPOSITE Chemical Risk at EHS Location Cube
I_EHSRiskStdVH view from COMPOSITE EHS Risk
P_EHSRasAtMyLocation view inner COMPOSITE

Fields (19)

KeyField CDS FieldsUsed in Views
KEY ChemicalUUID ChemicalUUID 2
KEY EHSJobUUID EHSJobUUID 4
KEY EHSLocationUUID EHSLocationUUID 5
KEY EHSRiskUUID EHSRiskUUID 2
KEY Hazard Hazard 3
_EHSJob _EHSJob 2
_EHSMethodOfUse _EHSMethodOfUse 2
_EHSOperationalStatus _EHSOperationalStatus 2
_Hazard _Hazard 2
_HazardCategory _HazardCategory 2
BusinessArea BusinessArea 1
CompanyCode CompanyCode 1
CostCenter CostCenter 1
EHSLocationAuthorizationGroup EHSLocationAuthorizationGroup 1
EHSRiskAssessmentType EHSRiskAssessmentType 1
HazardCategory HazardCategory 1
MethodOfUse MethodOfUse 2
OperationalStatus OperationalStatus 2
Plant Plant 1
@EndUserText.label: 'EHS Risk Root'
@Analytics: { dataCategory:#DIMENSION, dataExtraction.enabled:true }
@VDM.viewType: #BASIC
@ObjectModel.representativeKey: 'EHSRiskUUID'
@AccessControl.authorizationCheck: #CHECK
@AccessControl.privilegedAssociations: ['_CreatedByUser','_LastChangedByUser']
@AbapCatalog.sqlViewName: 'IEHSRSKROOT'
@AbapCatalog.compiler.compareFilter: 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 } 
@Metadata.allowExtensions:true                         
                         
define view I_EHSRiskRoot
  as select from ehhssd_rsk_root
  association [1..*] to I_EHSRiskRevision       as _EHSRiskRevision       on $projection.EHSRiskUUID = _EHSRiskRevision.EHSRiskUUID
  association [1..1] to I_Hazard                as _Hazard                on $projection.Hazard = _Hazard.Hazard
  association [1..1] to I_EHSLocationRoot       as _EHSLocationRoot       on $projection.EHSLocationUUID = _EHSLocationRoot.EHSLocationUUID  
  association [1..*] to I_EHSLocationRevision   as _EHSLocationRevision   on $projection.EHSLocationUUID = _EHSLocationRevision.EHSLocationUUID
  
  association [1..1] to I_EHSRiskAssessmentType as _EHSRiskAssessmentType on $projection.EHSRiskAssessmentType = _EHSRiskAssessmentType.EHSRiskAssessmentType
  association [0..1] to I_PhysicalAgent         as _PhysicalAgent         on $projection.PhysicalAgentUUID = _PhysicalAgent.PhysicalAgentUUID
  association [0..1] to I_ChemicalRoot          as _ChemicalRoot          on $projection.ChemicalUUID = _ChemicalRoot.ChemicalUUID
  association [0..1] to I_AirborneAgentRoot     as _AirborneAgentRoot     on $projection.AirborneAgentUUID = _AirborneAgentRoot.AirborneAgentUUID
  association [0..1] to I_EHSJob                as _EHSJob                on $projection.EHSJobUUID = _EHSJob.EHSJobUUID
  association [0..1] to I_EHSRiskLevel          as _EHSRiskLevel          on $projection.EHSRiskLevel = _EHSRiskLevel.EHSRiskLevel
  association [1..1] to I_HazardCategory        as _HazardCategory        on $projection.HazardCategory = _HazardCategory.HazardCategory
  association [0..1] to I_EHSMethodOfUse        as _EHSMethodOfUse        on $projection.MethodOfUse = _EHSMethodOfUse.MethodOfUse
  association [0..1] to I_EHSOperationalStatus  as _EHSOperationalStatus  on $projection.OperationalStatus = _EHSOperationalStatus.OperationalStatus
  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

{
  key cast( db_key as ehhss_risk_uuid_ref preserving type )               as EHSRiskUUID,
      _EHSRiskRevision,

      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,

      id                                                                  as EHSRiskID,

      @ObjectModel.foreignKey.association: '_Hazard'
      cast ( hazard as ehhss_hazard_code_nc preserving type )             as Hazard,
      _Hazard,

      @ObjectModel.foreignKey.association: '_EHSLocationRoot'
      @Consumption.valueHelpDefinition: [{ entity: { name: 'I_EHSLocationValueHelp', element: 'EHSLocationUUID' }}]      
      cast( loc_root_key_ref as ehfnd_location_uuid_ref preserving type ) as EHSLocationUUID,
      _EHSLocationRoot,

      @ObjectModel.foreignKey.association: '_EHSRiskAssessmentType'
      cast( ras_type as ehhss_ras_type_code_nc preserving type )          as EHSRiskAssessmentType,
      _EHSRiskAssessmentType,

      //--[ GENERATED:012:29JlHNUf7jY4oS0yl5vKTW

      @Consumption.valueHelpDefinition: [ 
        { entity:  { name:    'I_PhysicalAgentStdVH',
                     element: 'PhysicalAgentUUID' }
        }]
      // ]--GENERATED

      @ObjectModel.foreignKey.association: '_PhysicalAgent'
      cast( agent_key_ref as ehhss_agent_uuid_ref preserving type )       as PhysicalAgentUUID,
      _PhysicalAgent,

      @ObjectModel.foreignKey.association: '_ChemicalRoot'
      @Consumption.valueHelpDefinition: [{ entity: { name: 'I_ChemicalStdVH', element: 'ChemicalUUID' }}]      
      cast( cma_key_ref as ehhss_cma_uuid_ref preserving type )           as ChemicalUUID,
      _ChemicalRoot,

      @ObjectModel.foreignKey.association: '_AirborneAgentRoot'
      @Consumption.valueHelpDefinition: [{ entity: { name: 'I_AirborneAgentStdVH', element: 'AirborneAgentUUID' }}]      
      cast( abagt_key_ref as ehhss_abagt_uuid_ref preserving type )       as AirborneAgentUUID,
      _AirborneAgentRoot,
      
      //@ObjectModel.foreignKey.association: '_EHSAgent'

      // Merge the "Agent" fields (Physical, Chemical and Airborne) into one single field

      cast ( case
        when cma_key_ref != hextobin( '00000000000000000000000000000000' )
        then cma_key_ref
        when abagt_key_ref != hextobin( '00000000000000000000000000000000' )
        then abagt_key_ref
        when agent_key_ref != hextobin( '00000000000000000000000000000000' )
        then agent_key_ref
        else hextobin( '00000000000000000000000000000000' )
      end as ehhss_agent_combined_uuid_ref preserving type )               as EHSAgentUUID,

      @ObjectModel.foreignKey.association: '_EHSRiskLevel'
      cast (risk_level as ehhss_risk_level_code_nc preserving type )       as EHSRiskLevel,
      _EHSRiskLevel,

      //--[ GENERATED:012:29JlHNUf7jY4oS0yl5vKTW

      @Consumption.valueHelpDefinition: [ 
        { entity:  { name:    'I_EHSJobStdVH',
                     element: 'EHSJobUUID' }
        }]
      // ]--GENERATED

      @ObjectModel.foreignKey.association: '_EHSJob'
      cast( job_key_ref as ehhss_job_uuid_ref preserving type )            as EHSJobUUID,
      _EHSJob,
      
      step_id as EHSJobStep,

      @ObjectModel.foreignKey.association: '_HazardCategory'
      cast( haz_cat as ehhss_haz_category_code_nc preserving type )        as HazardCategory,
      _HazardCategory,

      @ObjectModel.foreignKey.association: '_EHSMethodOfUse'
      cast( meth_of_use_code  as ehfnd_method_of_use_nc preserving type )  as MethodOfUse,
      _EHSMethodOfUse,

      @ObjectModel.foreignKey.association: '_EHSOperationalStatus'
      cast( operation_status as ehhss_opstatus_code_nc preserving type )   as OperationalStatus,
      _EHSOperationalStatus,

      is_simulated                                                         as IsSimulatedEHSRisk,

      
      _EHSLocationRevision[1: RevisionStartDate <= $session.system_date and RevisionEndDate >= $session.system_date].EHSLocationAuthorizationGroup,
      _EHSLocationRevision[1: RevisionStartDate <= $session.system_date and RevisionEndDate >= $session.system_date]._EHSLocationAuthGroup,
      _EHSLocationRevision[1: RevisionStartDate <= $session.system_date and RevisionEndDate >= $session.system_date].Plant,
      _EHSLocationRevision[1: RevisionStartDate <= $session.system_date and RevisionEndDate >= $session.system_date]._Plant,
      //--[ GENERATED:012:29JlHNUf7jY4oS0yl5vKTW

      @Consumption.valueHelpDefinition: [ 
        { entity:  { name:    'I_CostCenterStdVH',
                     element: 'CostCenter' },
          additionalBinding: [{ localElement: 'ControllingArea',
                                element: 'ControllingArea' }]
        }]
      // ]--GENERATED

      _EHSLocationRevision[1: RevisionStartDate <= $session.system_date and RevisionEndDate >= $session.system_date].CostCenter,
//      _EHSLocationRevision[1: RevisionStartDate <= $session.system_date and RevisionEndDate >= $session.system_date]._CostCenter,

      //--[ GENERATED:012:29JlHNUf7jY4oS0yl5vKTW

      @Consumption.valueHelpDefinition: [ 
        { entity:  { name:    'I_CompanyCodeStdVH',
                     element: 'CompanyCode' }
        }]
      // ]--GENERATED

      _EHSLocationRevision[1: RevisionStartDate <= $session.system_date and RevisionEndDate >= $session.system_date].CompanyCode,
      _EHSLocationRevision[1: RevisionStartDate <= $session.system_date and RevisionEndDate >= $session.system_date]._CompanyCode,
      //--[ GENERATED:012:29JlHNUf7jY4oS0yl5vKTW

      @Consumption.valueHelpDefinition: [ 
        { entity:  { name:    'I_BusinessAreaStdVH',
                     element: 'BusinessArea' }
        }]
      // ]--GENERATED

      _EHSLocationRevision[1: RevisionStartDate <= $session.system_date and RevisionEndDate >= $session.system_date].BusinessArea,
      _EHSLocationRevision[1: RevisionStartDate <= $session.system_date and RevisionEndDate >= $session.system_date]._BusinessArea,
      _EHSLocationRevision[1: RevisionStartDate <= $session.system_date and RevisionEndDate >= $session.system_date].ControllingArea,
      _EHSLocationRevision[1: RevisionStartDate <= $session.system_date and RevisionEndDate >= $session.system_date]._ControllingArea




}                                                                    
 
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_EHSLOCATIONREVISION",
"EHHSSD_RSK_ROOT"
],
"ASSOCIATED":
[
"I_AIRBORNEAGENTROOT",
"I_BUSINESSAREA",
"I_CHEMICALROOT",
"I_COMPANYCODE",
"I_CONTROLLINGAREA",
"I_EHSJOB",
"I_EHSLOCATIONAUTHZNGROUP",
"I_EHSLOCATIONREVISION",
"I_EHSLOCATIONROOT",
"I_EHSMETHODOFUSE",
"I_EHSOPERATIONALSTATUS",
"I_EHSRISKASSESSMENTTYPE",
"I_EHSRISKLEVEL",
"I_EHSRISKREVISION",
"I_HAZARD",
"I_HAZARDCATEGORY",
"I_PHYSICALAGENT",
"I_PLANT",
"I_USER"
],
"BASE":
[
"I_EHSLOCATIONREVISION"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/