P_InjuryIllnessCase

DDL: P_INJURYILLNESSCASE SQL: PINJRYILLNCASE Type: view COMPOSITE

P_InjuryIllnessCase is a Composite CDS View in SAP S/4HANA. It reads from 2 data sources (I_IncidentWithTime, I_IncidentInjuredPersonInfo) and exposes 59 fields with key field InjuredPersonInfoUUID. It has 2 associations to related views.

Data Sources (2)

SourceAliasJoin Type
I_IncidentWithTime incwithtime inner
I_IncidentInjuredPersonInfo persinfo from

Associations (2)

CardinalityTargetAliasCondition
[1..1] I_Indicator _InjuryIllnessCaseIsRecordable $projection.InjuryIllnessCaseIsRecordable = _InjuryIllnessCaseIsRecordable.IndicatorValue
[1..1] I_TernaryLogicalState _PersonInfoHasAccRestriction $projection.PersonInfoHasAccRestriction = _PersonInfoHasAccRestriction.TernaryLogicalState

Annotations (11)

NameValueLevelField
VDM.private true view
VDM.viewType #COMPOSITE view
AccessControl.authorizationCheck #NOT_REQUIRED view
AbapCatalog.sqlViewName PINJRYILLNCASE view
AbapCatalog.preserveKey true view
AbapCatalog.compiler.compareFilter true view
ClientHandling.algorithm #SESSION_VARIABLE view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.sizeCategory #L view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
AccessControl.personalData.blocking #NOT_REQUIRED view

Fields (59)

KeyFieldSource TableSource FieldDescription
KEY InjuredPersonInfoUUID I_IncidentInjuredPersonInfo InjuredPersonInfoUUID
InvolvedPersonUUID I_IncidentInjuredPersonInfo InvolvedPersonUUID
IncidentUUID I_IncidentWithTime IncidentUUID Incident UUID
IncidentID I_IncidentWithTime IncidentID
IncidentStatus I_IncidentWithTime IncidentStatus
_IncidentStatus I_IncidentWithTime _IncidentStatus
IncidentCategory I_IncidentWithTime IncidentCategory
_IncidentCategory I_IncidentWithTime _IncidentCategory
IncidentMajorRootCause I_IncidentWithTime IncidentMajorRootCause
_IncidentMajorRootCause I_IncidentWithTime _IncidentMajorRootCause
IncidentInvestigationStatus I_IncidentWithTime IncidentInvestigationStatus
_IncidentInvestigationStatus I_IncidentWithTime _IncidentInvestigationStatus
IncidentTitle I_IncidentWithTime IncidentTitle
Country I_IncidentWithTime Country Venue: Ctry/Reg
_Country I_IncidentWithTime _Country
Region I_IncidentWithTime Region Venue Region
_Region I_IncidentWithTime _Region
Plant I_IncidentWithTime Plant Valuation Area
_Plant I_IncidentWithTime _Plant
OrganizationalUnit I_IncidentWithTime OrganizationalUnit Org. Unit ID
_OrgUnit I_IncidentWithTime _OrgUnit
EHSLocationUUID I_IncidentWithTime EHSLocationUUID NodeID
_EHSLocationRoot I_IncidentWithTime _EHSLocationRoot
EHSLocationID I_IncidentWithTime EHSLocationID
_CurrentEHSParentLocationID I_IncidentWithTime _CurrentEHSParentLocationID
IncidentDate I_IncidentWithTime IncidentDate
_CalendarDate I_IncidentWithTime _CalendarDate
IncidentMonth I_IncidentWithTime IncidentMonth
_CalendarMonth I_IncidentWithTime _CalendarMonth
IncidentYear I_IncidentWithTime IncidentYear
_CalendarYear I_IncidentWithTime _CalendarYear
IncidentTimeIsUnknown I_IncidentWithTime IncidentTimeIsUnknown
_IncidentTimeIsUnknown I_IncidentWithTime _IncidentTimeIsUnknown
IncidentTime I_IncidentWithTime IncidentTime
IncidentHour I_IncidentWithTime IncidentHour
IncidentWeekDay I_IncidentWithTime IncidentWeekDay
_WeekDay I_IncidentWithTime _WeekDay
IncidentHasAccessRestriction I_IncidentWithTime IncidentHasAccessRestriction Restricted
_IncidentHasAccessRestriction I_IncidentWithTime _IncidentHasAccessRestriction
IncidentInjuryIllnLogType I_IncidentWithTime IncidentInjuryIllnLogType
_IncidentInjryIllnLogType I_IncidentWithTime _IncidentInjryIllnLogType
_IncidentBasicInfo I_IncidentWithTime _IncidentBasicInfo
PersonInfoHasAccRestriction invpers PersonInfoHasAccRestriction
_PersonInfoHasAccRestriction _PersonInfoHasAccRestriction
InjuryIllnessCaseIsRecordable
_InjuryIllnessCaseIsRecordable _InjuryIllnessCaseIsRecordable
InjuryIllnessClassification injury InjuryIllnessClassification
_InjuryIllnessClass injury _InjuryIllnessClass
MainInjuryIllnessClassfctn injury MainInjuryIllnessClassfctn
_MainInjuryIllnessClassfctn injury _MainInjuryIllnessClassfctn
MainInjuryIllnessType injury MainInjuryIllnessType
_InjuryIllnessType injury _InjuryIllnessType
MainInjuryIllnessBodyPart injury MainInjuryIllnessBodyPart
_IncidentBodyPart injury _IncidentBodyPart
MainInjuryIllnessBodySide injury MainInjuryIllnessBodySide
_IncidentBodySide injury _IncidentBodySide
int4asCaseWithWorkDaysLost
int4asCaseWithRstrcnOrTransf
int4endasNumberOfDeathCases

Derived SQL interpretation, reconstructed from the parsed view metadata (data sources, associations, and field mappings). SAP annotations are omitted and the structure is reformulated as SQL — this is a functional approximation, not the verbatim SAP source.

-- Derived SQL interpretation of CDS view P_InjuryIllnessCase.
-- Reconstructed from parsed metadata (data sources, associations, fields).
-- SAP annotations are omitted and the structure is reformulated as SQL;
-- this is a functional approximation, not the verbatim SAP source. Some join
-- conditions may be unavailable and a few CDS constructs are kept as-is.
-- SQL view name: PINJRYILLNCASE

CREATE VIEW P_InjuryIllnessCase AS
SELECT
  persinfo.InjuredPersonInfoUUID AS InjuredPersonInfoUUID,
  persinfo.InvolvedPersonUUID AS InvolvedPersonUUID,
  incwithtime.IncidentUUID AS IncidentUUID,
  incwithtime.IncidentID AS IncidentID,
  incwithtime.IncidentStatus AS IncidentStatus,
  incwithtime._IncidentStatus AS _IncidentStatus,
  incwithtime.IncidentCategory AS IncidentCategory,
  incwithtime._IncidentCategory AS _IncidentCategory,
  incwithtime.IncidentMajorRootCause AS IncidentMajorRootCause,
  incwithtime._IncidentMajorRootCause AS _IncidentMajorRootCause,
  incwithtime.IncidentInvestigationStatus AS IncidentInvestigationStatus,
  incwithtime._IncidentInvestigationStatus AS _IncidentInvestigationStatus,
  incwithtime.IncidentTitle AS IncidentTitle,
  incwithtime.Country AS Country,
  incwithtime._Country AS _Country,
  incwithtime.Region AS Region,
  incwithtime._Region AS _Region,
  incwithtime.Plant AS Plant,
  incwithtime._Plant AS _Plant,
  incwithtime.OrganizationalUnit AS OrganizationalUnit,
  incwithtime._OrgUnit AS _OrgUnit,
  incwithtime.EHSLocationUUID AS EHSLocationUUID,
  incwithtime._EHSLocationRoot AS _EHSLocationRoot,
  incwithtime.EHSLocationID AS EHSLocationID,
  incwithtime._CurrentEHSParentLocationID AS _CurrentEHSParentLocationID,
  incwithtime.IncidentDate AS IncidentDate,
  incwithtime._CalendarDate AS _CalendarDate,
  incwithtime.IncidentMonth AS IncidentMonth,
  incwithtime._CalendarMonth AS _CalendarMonth,
  incwithtime.IncidentYear AS IncidentYear,
  incwithtime._CalendarYear AS _CalendarYear,
  incwithtime.IncidentTimeIsUnknown AS IncidentTimeIsUnknown,
  incwithtime._IncidentTimeIsUnknown AS _IncidentTimeIsUnknown,
  incwithtime.IncidentTime AS IncidentTime,
  incwithtime.IncidentHour AS IncidentHour,
  incwithtime.IncidentWeekDay AS IncidentWeekDay,
  incwithtime._WeekDay AS _WeekDay,
  incwithtime.IncidentHasAccessRestriction AS IncidentHasAccessRestriction,
  incwithtime._IncidentHasAccessRestriction AS _IncidentHasAccessRestriction,
  incwithtime.IncidentInjuryIllnLogType AS IncidentInjuryIllnLogType,
  incwithtime._IncidentInjryIllnLogType AS _IncidentInjryIllnLogType,
  incwithtime._IncidentBasicInfo AS _IncidentBasicInfo,
  invpers.PersonInfoHasAccRestriction AS PersonInfoHasAccRestriction,
  cast(persinfo.InjuryIllnessCaseIsRecordable as ehhss_injill_case_is_recordabl) AS InjuryIllnessCaseIsRecordable,
  injury.InjuryIllnessClassification AS InjuryIllnessClassification,
  injury._InjuryIllnessClass AS _InjuryIllnessClass,
  injury.MainInjuryIllnessClassfctn AS MainInjuryIllnessClassfctn,
  injury._MainInjuryIllnessClassfctn AS _MainInjuryIllnessClassfctn,
  injury.MainInjuryIllnessType AS MainInjuryIllnessType,
  injury._InjuryIllnessType AS _InjuryIllnessType,
  injury.MainInjuryIllnessBodyPart AS MainInjuryIllnessBodyPart,
  injury._IncidentBodyPart AS _IncidentBodyPart,
  injury.MainInjuryIllnessBodySide AS MainInjuryIllnessBodySide,
  injury._IncidentBodySide AS _IncidentBodySide,
  cast( case when timedata.NmbrOfCalendarDaysAwayFromWork > 0 or timedata.CaseHasPermanentAbsences = 'X' then 1 else 0 end as abap.int4) as CaseWithWorkDaysLost AS int4asCaseWithWorkDaysLost,
  cast( case when timedata.NmbrOfRstrcdAndTransfCalDays > 0 or timedata.CaseHasPermanentRestrictions = 'X' then 1 else 0 end as abap.int4) as CaseWithRstrcnOrTransf AS int4asCaseWithRstrcnOrTransf,
  case persinfo.InjuryIllnessIsFatal when 'X' then cast(1 as abap.int4) else cast(0 as abap.int4) end as NumberOfDeathCases AS int4endasNumberOfDeathCases
FROM I_IncidentInjuredPersonInfo AS persinfo
INNER JOIN I_IncidentWithTime AS incwithtime ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN I_Indicator AS _InjuryIllnessCaseIsRecordable ON InjuryIllnessCaseIsRecordable = _InjuryIllnessCaseIsRecordable.IndicatorValue  -- association [1..1]
LEFT OUTER JOIN I_TernaryLogicalState AS _PersonInfoHasAccRestriction ON PersonInfoHasAccRestriction = _PersonInfoHasAccRestriction.TernaryLogicalState  -- association [1..1]
;