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 C_TechObjFlatVH.
-- 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: CTECHOBJFLATVH1
CREATE VIEW C_TechObjFlatVH AS
SELECT
I_TechnicalObject.TechnicalObject AS TechnicalObject,
I_TechnicalObject.TechObjIsEquipOrFuncnlLoc AS TechObjIsEquipOrFuncnlLoc,
case when I_TechnicalObject.TechObjIsEquipOrFuncnlLoc = 'EAMS_FL' then I_TechnicalObject._FunctionalLocationLabel.FunctionalLocationLabelName else I_TechnicalObject.Equipment end as TechnicalObjectName AS EquipmentendasTechnicalObjectName,
case when I_TechnicalObject.TechObjIsEquipOrFuncnlLoc = 'EAMS_FL' then I_TechnicalObject._FunctionalLocationLabel.FunctionalLocationLabelName else I_TechnicalObject.Equipment end as TechnicalObjectLabel AS EquipmentendasTechnicalObjectLabel,
I_TechnicalObject._FunctionalLocationLabel._FuncLocationLabelSearch.FunctionalLocationLabelName AS FunctionalLocationLabelName,
I_TechnicalObject._TechnicalObjectText[1: Language = $session.system_language ].TechnicalObjectDescription AS TechnicalObjectDescription,
I_TechnicalObject.SuperiorTechnicalObject AS SuperiorTechnicalObject,
I_TechnicalObject.SuperiorObjIsEquipOrFuncnlLoc AS SuperiorObjIsEquipOrFuncnlLoc,
_EquipmentSearch.Equipment AS Equipment,
I_TechnicalObject.MaintenancePlanningPlant AS Plant,
I_TechnicalObject.Equipment AS EquipmentWithLeadingZeros,
I_TechnicalObject.FunctionalLocation AS FunctionalLocation,
I_TechnicalObject._LocationAccountAssignment.ABCIndicator AS ABCIndicator,
I_TechnicalObject._LocationAccountAssignment._ABCIndicator._Text[1: Language = $session.system_language ].ABCIndicatorDesc AS ABCIndicatorDesc,
I_TechnicalObject.AuthorizationGroup AS AuthorizationGroup,
I_TechnicalObject._LocationAccountAssignment.BusinessArea AS BusinessArea,
I_TechnicalObject._LocationAccountAssignment._BusinessArea._Text[1: Language = $session.system_language ].BusinessAreaName AS BusinessAreaName,
I_TechnicalObject.CatalogProfile AS CatalogProfile,
I_TechnicalObject._LocationAccountAssignment.CompanyCode AS CompanyCode,
I_TechnicalObject._LocationAccountAssignment._CompanyCode.CompanyCodeName AS CompanyCodeName,
I_TechnicalObject._LocationAccountAssignment.ControllingArea AS ControllingArea,
I_TechnicalObject._LocationAccountAssignment._ControllingArea.ControllingAreaName AS ControllingAreaName,
I_TechnicalObject._LocationAccountAssignment.CostCenter AS CostCenter,
I_TechnicalObject._LocationAccountAssignment._CostCenter[1: ValidityEndDate = '99991231' ]._Text[1: Language = $session.system_language ].CostCenterDescription AS CostCenterDescription,
I_TechnicalObject._LocationAccountAssignment._WorkCenter.WorkCenter AS WorkCenter,
I_TechnicalObject._LocationAccountAssignment.WorkCenterInternalID AS WorkCenterInternalID,
I_TechnicalObject._LocationAccountAssignment.WorkCenterTypeCode AS WorkCenterTypeCode,
I_TechnicalObject._WorkCenter.Plant AS MainWorkCenterPlant,
I_TechnicalObject._LocationAccountAssignment._WorkCenter._Text[1: Language = $session.system_language ].WorkCenterText AS WorkCenterText,
cast( I_TechnicalObject._WorkCenter.WorkCenter as gewrk ) AS MainWorkCenter,
I_TechnicalObject.WorkCenterInternalID AS MainWorkCenterInternalID,
I_TechnicalObject.WorkCenterTypeCode AS MainWorkCenterTypeCode,
I_TechnicalObject._WorkCenter._Text[1: Language = $session.system_language ].WorkCenterText AS MainWorkCenterText,
I_TechnicalObject._LocationAccountAssignment.MaintenancePlant AS MaintenancePlant,
I_TechnicalObject._LocationAccountAssignment._MaintenancePlant.PlantName AS MaintenancePlantName,
I_TechnicalObject.AssetManufacturerName AS AssetManufacturerName,
I_TechnicalObject.ManufacturerPartTypeName AS ManufacturerPartTypeName,
I_TechnicalObject.MaintenancePlanningPlant AS MaintenancePlanningPlant,
I_TechnicalObject._MaintenancePlanningPlant.PlantName AS MaintenancePlanningPlantName,
I_TechnicalObject.MaintenancePlannerGroup AS MaintenancePlannerGroup,
I_TechnicalObject._MaintenancePlannerGroup.MaintenancePlannerGroupName AS MaintenancePlannerGroupName,
I_TechnicalObject._LocationAccountAssignment.PlantSection AS PlantSection,
I_TechnicalObject._LocationAccountAssignment._PlantSection.PlantSectionPersonRespName AS PlantSectionPersonRespName,
I_TechnicalObject._LocationAccountAssignment.AssetRoom AS AssetRoom,
I_TechnicalObject._LocationAccountAssignment.MaintObjectFreeDefinedAttrib AS MaintObjectFreeDefinedAttrib,
I_TechnicalObject.TechnicalObjectCategory AS TechnicalObjectCategory,
I_TechnicalObject._TechnicalObjectCategory._Text[1: Language = $session.system_language ].TechnicalObjectCategoryDesc AS TechnicalObjectCategoryDesc,
I_TechnicalObject.TechnicalObjectType AS TechnicalObjectType,
I_TechnicalObject.AcquisitionValue AS AcquisitionValue,
I_TechnicalObject.Currency AS Currency,
I_TechnicalObject.CreatedByUser AS CreatedByUser,
I_TechnicalObject.CreationDate AS CreationDate,
I_TechnicalObject.LastChangedByUser AS LastChangedByUser,
I_TechnicalObject.LastChangeDate AS LastChangeDate,
I_TechnicalObject._LocationAccountAssignment.Division AS Division,
I_TechnicalObject._LocationAccountAssignment._Division._Text[1: Language = $session.system_language ].DivisionName AS DivisionName,
I_TechnicalObject._LocationAccountAssignment.AssetLocation AS AssetLocation,
I_TechnicalObject._LocationAccountAssignment._Location.LocationName AS LocationName,
I_TechnicalObject._TechObjIsEquipOrFuncnlLoc._Text[1: Language = $session.system_language ].TechObjIsEquipOrFuncnlLocDesc AS TechObjIsEquipOrFuncnlLocDesc,
cast ( '' as eam_techobj_installation_loc ) AS TechObjInstallationLocation,
0 AS HierarchyNodeLevel,
cast ( 0 as eam_open_notifications ) AS NumberOfOrders,
cast ( 0 as eam_open_notifications ) AS NmbrOfOpenMaintNotifications,
I_TechnicalObject._WorkCenter._Plant.PlantName AS MainWorkCenterPlantName,
I_TechnicalObject.SuperiorTechnicalObjectLabel AS SuperiorTechnicalObjectLabel,
I_TechnicalObject._TechObjIsEquipOrFuncnlLoc AS _TechObjIsEquipOrFuncnlLoc,
I_TechnicalObject._LocationAccountAssignment._ABCIndicator AS _ABCIndicator,
I_TechnicalObject._TechnicalObjectType AS _TechnicalObjectType,
I_TechnicalObject._TechnicalObjectCategory AS _TechnicalObjectCategory,
I_TechnicalObject.MaintObjectInternalID AS MaintObjectInternalID,
I_TechnicalObject._MaintenancePlanningPlant AS _MaintenancePlanningPlant,
I_TechnicalObject._MaintenancePlanningPlant AS _MaintPlanningPlant,
I_TechnicalObject._LocationAccountAssignment._Location AS _Location,
I_TechnicalObject._LocationAccountAssignment._PlantSection AS _PlantSection,
I_TechnicalObject._LocationAccountAssignment._MaintenancePlant AS _MaintenancePlant,
I_TechnicalObject._TechnicalObjectCodeCatalog AS _TechnicalObjectCodeCatalog,
I_TechnicalObject._LocationAccountAssignment._BusinessArea AS _BusinessArea,
I_TechnicalObject._LocationAccountAssignment._CompanyCode AS _CompanyCode
FROM I_TechnicalObject
LEFT OUTER JOIN I_Equipment AS _EquipmentSearch ON EquipmentWithLeadingZeros = _EquipmentSearch.Equipment -- association [0..1]
LEFT OUTER JOIN C_PMWorkCenterVH AS _MainWorkCenterVH ON MainWorkCenter = _MainWorkCenterVH.WorkCenter AND MaintenancePlanningPlant = _MainWorkCenterVH.Plant AND _MainWorkCenterVH.WorkCenterTypeCode = 'A' -- association [0..*]
LEFT OUTER JOIN C_PMWorkCenterVH AS _WorkCenterVH ON workcenter = _WorkCenterVH.WorkCenter AND Plant = _WorkCenterVH.Plant AND _WorkCenterVH.WorkCenterTypeCode = 'A' -- association [0..*]
LEFT OUTER JOIN I_MaintPlnrGrpStdVH AS _MaintenancePlannerGroup ON MaintenancePlannerGroup = _MaintenancePlannerGroup.MaintenancePlannerGroup AND MaintenancePlanningPlant = _MaintenancePlannerGroup.MaintenancePlanningPlant -- association [0..1]
LEFT OUTER JOIN C_PMAssetLocationVH AS _AssetLocationVH ON assetlocation = _AssetLocationVH.Location AND Plant = _AssetLocationVH.Plant -- association [0..1]
LEFT OUTER JOIN C_MaintenancePlanPlantVH AS _PlanningPlantVH ON Plant = _PlanningPlantVH.MaintenancePlanningPlant -- association [0..1]
LEFT OUTER JOIN I_PlantSectionStdVH AS _PlantSectionVH ON plantsection = _PlantSectionVH.PlantSection AND maintenanceplant = _PlantSectionVH.Plant -- association [0..1]
;