I_IncidentBasicInfo

DDL: I_INCIDENTBASICINFO SQL: IINCBINFA Type: view BASIC

Basic Information of an Incident

I_IncidentBasicInfo is a Basic CDS View (Dimension) that provides data about "Basic Information of an Incident" in SAP S/4HANA. It reads from 1 data source (ehhssd_inc_binfa) and exposes 45 fields with key field IncidentBasicInfoUUID. It has 19 associations to related views.

Data Sources (1)

SourceAliasJoin Type
ehhssd_inc_binfa ehhssd_inc_binfa from

Associations (19)

CardinalityTargetAliasCondition
[0..1] I_IncidentLocationType _IncidentLocationType $projection.IncidentLocationType = _IncidentLocationType.IncidentLocationType
[1..1] I_TernaryLogicalState _IncidentHasAccessRestriction $projection.IncidentHasAccessRestriction = _IncidentHasAccessRestriction.TernaryLogicalState
[0..1] I_Country _Country $projection.Country = _Country.Country
[0..1] I_Region _Region $projection.Region = _Region.Region and $projection.Country = _Region.Country
[0..1] I_OrgUnit _OrgUnit $projection.OrganizationalUnit = _OrgUnit.OrganizationalUnit
[0..1] I_Plant _Plant $projection.Plant = _Plant.Plant
[0..1] I_User _CreatedByUser $projection.CreatedByUser = _CreatedByUser.UserID
[0..1] I_User _LastChangedByUser $projection.LastChangedByUser = _LastChangedByUser.UserID
[0..1] I_EHSLocationRoot _EHSLocationRoot $projection.EHSLocationUUID = _EHSLocationRoot.EHSLocationUUID
[0..1] I_CalendarDate _CalendarDate $projection.IncidentDate = _CalendarDate.CalendarDate
[1..1] I_TimeZone _TimeZone $projection.IncidentTimeZone = _TimeZone.TimeZoneID
[1..1] I_TimeZone _EndTimeZone $projection.IncidentEndTimeZone = _EndTimeZone.TimeZoneID
[1..1] I_TimeZone _ReportedTimeZone $projection.IncidentReportedTimeZone = _ReportedTimeZone.TimeZoneID
[1..1] I_Indicator _IncidentTimeIsUnknown $projection.IncidentTimeIsUnknown = _IncidentTimeIsUnknown.IndicatorValue
[1..1] I_Incident _Incident $projection.IncidentUUID = _Incident.IncidentUUID
[0..*] I_CurrentEHSParentLocationID _CurrentEHSParentLocationID $projection.EHSLocationUUID = _CurrentEHSParentLocationID.EHSLocationUUID
[0..1] I_IncidentInjryIllnLogType _IncidentInjryIllnLogType $projection.IncidentInjuryIllnLogType = _IncidentInjryIllnLogType.IncidentInjuryIllnLogType
[1..1] I_LocationDescFallbackLang _LocTextDesc $projection.EHSLocationUUID = _LocTextDesc.EHSLocationUUID
[1..1] E_IncidentBasicInfo _Extension $projection.IncidentBasicInfoUUID = _Extension.IncidentBasicInfoUUID

Annotations (15)

NameValueLevelField
EndUserText.label Basic Information of an Incident view
Analytics.dataCategory #DIMENSION view
Analytics.dataExtraction.enabled true view
VDM.viewType #BASIC view
ObjectModel.representativeKey IncidentBasicInfoUUID view
AccessControl.authorizationCheck #CHECK view
AbapCatalog.sqlViewName IINCBINFA view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
Metadata.ignorePropagatedAnnotations true view
ClientHandling.algorithm #SESSION_VARIABLE view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #L view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
Metadata.allowExtensions true view

Fields (45)

KeyFieldSource TableSource FieldDescription
KEY IncidentBasicInfoUUID db_key
IncidentUUID
_Incident _Incident
CreationDateTime
CreatedByUser user_id_cr
_CreatedByUser _CreatedByUser
LastChangeDateTime
LastChangedByUser user_id_ch
_LastChangedByUser _LastChangedByUser
IncidentTitle title
OrganizationalUnit
_OrgUnit _OrgUnit
Plant plant_id
_Plant _Plant
EHSLocationUUID
_EHSLocationRoot _EHSLocationRoot
_CurrentEHSParentLocationID _CurrentEHSParentLocationID
IncidentLocationType
_IncidentLocationType _IncidentLocationType
IncidentUTCDateTime
IncidentUTCEndDateTime
IncidentTimeIsUnknown time_not_det_ind
_IncidentTimeIsUnknown _IncidentTimeIsUnknown
IncidentTimeZone start_time_zone
_TimeZone _TimeZone
IncidentEndTimeZone end_time_zone
_EndTimeZone _EndTimeZone
_CalendarDate _CalendarDate
IncidentHasAccessRestriction confidential_ts
_IncidentHasAccessRestriction _IncidentHasAccessRestriction
Country country
_Country _Country
Region region
_Region _Region
IncidentInjuryIllnLogType
_IncidentInjryIllnLogType _IncidentInjryIllnLogType
EHSStreetHouseNumberText street_house_num
EHSPostalCodeText postal_code
EHSCityText city
IncidentDescOfEventUUID txc_desc_key
IncidentReportedDateTime
IncidentReportedTimeZone rep_time_zone
_ReportedTimeZone _ReportedTimeZone
EHSLocationID
_LocTextDesc _LocTextDesc
@EndUserText.label: 'Basic Information of an Incident'
@Analytics: { dataCategory:#DIMENSION , dataExtraction.enabled:true }
@VDM.viewType: #BASIC
@ObjectModel.representativeKey: 'IncidentBasicInfoUUID'
@AccessControl:{ authorizationCheck: #CHECK, privilegedAssociations:  [ '_OrgUnit', '_CreatedByUser', '_LastChangedByUser'] }
@AbapCatalog.sqlViewName: 'IINCBINFA'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@Metadata.ignorePropagatedAnnotations:true
@ClientHandling.algorithm: #SESSION_VARIABLE

@ObjectModel.usageType: {serviceQuality: #C, sizeCategory: #L, dataClass: #TRANSACTIONAL}
@Metadata.allowExtensions:true
@ObjectModel.supportedCapabilities: [ #SQL_DATA_SOURCE, #EXTRACTION_DATA_SOURCE ]

define view I_IncidentBasicInfo
  as select from ehhssd_inc_binfa
  association [0..1] to I_IncidentLocationType       as _IncidentLocationType         on  $projection.IncidentLocationType = _IncidentLocationType.IncidentLocationType
  association [1..1] to I_TernaryLogicalState        as _IncidentHasAccessRestriction on  $projection.IncidentHasAccessRestriction = _IncidentHasAccessRestriction.TernaryLogicalState
  association [0..1] to I_Country                    as _Country                      on  $projection.Country = _Country.Country
  association [0..1] to I_Region                     as _Region                       on  $projection.Region  = _Region.Region
                                                                                      and $projection.Country = _Region.Country
  association [0..1] to I_OrgUnit                    as _OrgUnit                      on  $projection.OrganizationalUnit = _OrgUnit.OrganizationalUnit
  association [0..1] to I_Plant                      as _Plant                        on  $projection.Plant = _Plant.Plant
  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 [0..1] to I_EHSLocationRoot            as _EHSLocationRoot              on  $projection.EHSLocationUUID = _EHSLocationRoot.EHSLocationUUID
  association [0..1] to I_CalendarDate               as _CalendarDate                 on  $projection.IncidentDate = _CalendarDate.CalendarDate
  association [1..1] to I_TimeZone                   as _TimeZone                     on  $projection.IncidentTimeZone = _TimeZone.TimeZoneID
  association [1..1] to I_TimeZone                   as _EndTimeZone                  on  $projection.IncidentEndTimeZone = _EndTimeZone.TimeZoneID
  association [1..1] to I_TimeZone                   as _ReportedTimeZone             on  $projection.IncidentReportedTimeZone = _ReportedTimeZone.TimeZoneID
  association [1..1] to I_Indicator                  as _IncidentTimeIsUnknown        on  $projection.IncidentTimeIsUnknown = _IncidentTimeIsUnknown.IndicatorValue
  association [1..1] to I_Incident                   as _Incident                     on  $projection.IncidentUUID = _Incident.IncidentUUID
  // in order to determine location id and all parent ids for the authorization check

  association [0..*] to I_CurrentEHSParentLocationID as _CurrentEHSParentLocationID   on  $projection.EHSLocationUUID = _CurrentEHSParentLocationID.EHSLocationUUID
  association [0..1] to I_IncidentInjryIllnLogType   as _IncidentInjryIllnLogType     on  $projection.IncidentInjuryIllnLogType = _IncidentInjryIllnLogType.IncidentInjuryIllnLogType
  association [1..1] to I_LocationDescFallbackLang   as _LocTextDesc                  on $projection.EHSLocationUUID = _LocTextDesc.EHSLocationUUID

  // Extension include

  association [1..1] to E_IncidentBasicInfo          as _Extension                    on  $projection.IncidentBasicInfoUUID = _Extension.IncidentBasicInfoUUID


{
  key db_key                                                             as IncidentBasicInfoUUID,
      cast(parent_key as ehhss_incident_uuid preserving type)            as IncidentUUID,
      _Incident,

      // Admin data

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

      title                                                              as IncidentTitle,

      @ObjectModel.foreignKey.association: '_OrgUnit'
      cast( org_id as ehhss_org_unit_id_nc preserving type )             as OrganizationalUnit,
      _OrgUnit,

      @ObjectModel.foreignKey.association: '_Plant'
      plant_id                                                           as Plant,
      _Plant,

      @ObjectModel.foreignKey.association: '_EHSLocationRoot'
      cast(loc_root_key_ref as ehfnd_location_uuid_ref  preserving type) as EHSLocationUUID,
      _EHSLocationRoot,
      // when incident is assigned to location and user has authorizations for any of the location parents, then the user has the same autorizations for this incident

      _CurrentEHSParentLocationID,

      @ObjectModel.foreignKey.association: '_IncidentLocationType'
      cast( loc_type as ehhss_location_type_code_nc preserving type )    as IncidentLocationType,
      _IncidentLocationType,

      cast( start_timestamp as timestamp preserving type )               as IncidentUTCDateTime,
      
      cast( end_timestamp as timestamp preserving type )                 as IncidentUTCEndDateTime,

      @ObjectModel.foreignKey.association: '_IncidentTimeIsUnknown'
      time_not_det_ind                                                   as IncidentTimeIsUnknown,
      _IncidentTimeIsUnknown,

      @ObjectModel.foreignKey.association: '_TimeZone'
      start_time_zone                                                    as IncidentTimeZone,                  
      _TimeZone,

      @ObjectModel.foreignKey.association: '_EndTimeZone'
      end_time_zone                                                      as IncidentEndTimeZone,                  
      _EndTimeZone,

      // It is possible that the start_timestamp temporarily has no value when an incident

      // has been imported via PDF form. Thus we should not use 'FAIL' for error processing.

      @ObjectModel.foreignKey.association: '_CalendarDate'
      cast(tstmp_to_dats(start_timestamp,$session.user_timezone,$session.client,'INITIAL')
           as ehhss_inc_start_date preserving type )                     as IncidentDate,
      _CalendarDate,

      @ObjectModel.foreignKey.association: '_IncidentHasAccessRestriction'
      confidential_ts                                                    as IncidentHasAccessRestriction,
      _IncidentHasAccessRestriction,

      @ObjectModel.foreignKey.association: '_Country'
      country                                                            as Country,
      _Country,

      @ObjectModel.foreignKey.association: '_Region'
      region                                                             as Region,
      _Region,

      @ObjectModel.foreignKey.association: '_IncidentInjryIllnLogType'
      cast( type as ehhss_inc_inj_type_code_nc preserving type )         as IncidentInjuryIllnLogType,
      _IncidentInjryIllnLogType,
      
      street_house_num                                                   as EHSStreetHouseNumberText,
      
      postal_code                                                        as EHSPostalCodeText,
      
      city                                                               as EHSCityText,
         
      txc_desc_key                                                       as IncidentDescOfEventUUID,
      
      cast( rep_timestamp as timestamp preserving type )                 as IncidentReportedDateTime,
      
      @ObjectModel.foreignKey.association: '_ReportedTimeZone'
      rep_time_zone                                                      as IncidentReportedTimeZone,
      _ReportedTimeZone,
      
      coalesce(_EHSLocationRoot.EHSLocationID,'') as EHSLocationID,
      
      _LocTextDesc
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_EHSLOCATIONROOT",
"EHHSSD_INC_BINFA"
],
"ASSOCIATED":
[
"E_INCIDENTBASICINFO",
"I_CALENDARDATE",
"I_COUNTRY",
"I_CURRENTEHSPARENTLOCATIONID",
"I_EHSLOCATIONROOT",
"I_INCIDENT",
"I_INCIDENTINJRYILLNLOGTYPE",
"I_INCIDENTLOCATIONTYPE",
"I_INDICATOR",
"I_LOCATIONDESCFALLBACKLANG",
"I_ORGUNIT",
"I_PLANT",
"I_REGION",
"I_TERNARYLOGICALSTATE",
"I_TIMEZONE",
"I_USER"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/