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 R_FunctionalLocationTP.
-- 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.
CREATE VIEW R_FunctionalLocationTP AS
SELECT
cast(I_FunctionalLocation.FunctionalLocation as tplnr_unconverted preserving type) AS FunctionalLocation,
_FunctionalLocationLabel.FunctionalLocationLabelName AS FunctionalLocationLabelName,
I_FunctionalLocation.FunctionalLocationOID AS FunctionalLocationOID,
I_FunctionalLocation._FunctionalLocationText[1:Language=$session.system_language].FunctionalLocationName AS FunctionalLocationName,
I_FunctionalLocation.FuncLocationStructure AS FuncLocationStructure,
I_FunctionalLocation.FunctionalLocationCategory AS FunctionalLocationCategory,
cast(I_FunctionalLocation.SuperiorFunctionalLocation as tplnr_unconverted preserving type) AS SuperiorFunctionalLocation,
_SupFunctionalLocationLabel.FunctionalLocationLabelName AS SuperiorFuncnlLocLabelName,
I_FunctionalLocation.FuncnlLocPosInSuperiorTechObj AS FuncnlLocPosInSuperiorTechObj,
I_FunctionalLocation.TechnicalObjectType AS TechnicalObjectType,
I_FunctionalLocation.AuthorizationGroup AS AuthorizationGroup,
I_FunctionalLocation.GrossWeight AS GrossWeight,
I_FunctionalLocation.GrossWeightUnit AS GrossWeightUnit,
I_FunctionalLocation.OperationStartDate AS OperationStartDate,
I_FunctionalLocation.InventoryNumber AS InventoryNumber,
I_FunctionalLocation.AcquisitionValue AS AcquisitionValue,
I_FunctionalLocation.Currency AS Currency,
I_FunctionalLocation.AcquisitionDate AS AcquisitionDate,
I_FunctionalLocation.AssetManufacturerName AS AssetManufacturerName,
I_FunctionalLocation.ManufacturerPartNmbr AS ManufacturerPartNmbr,
I_FunctionalLocation.ManufacturerCountry AS ManufacturerCountry,
I_FunctionalLocation.ManufacturerPartTypeName AS ManufacturerPartTypeName,
I_FunctionalLocation.ConstructionMonth AS ConstructionMonth,
I_FunctionalLocation.ConstructionYear AS ConstructionYear,
I_FunctionalLocation.ManufacturerSerialNumber AS ManufacturerSerialNumber,
I_FunctionalLocation.FunctionalLocationEndOfUseDate AS FunctionalLocationEndOfUseDate,
I_FunctionalLocation._LocationAccountAssignment.MaintenancePlant AS MaintenancePlant,
I_FunctionalLocation._LocationAccountAssignment.AssetLocation AS AssetLocation,
I_FunctionalLocation._LocationAccountAssignment.AssetRoom AS AssetRoom,
I_FunctionalLocation._LocationAccountAssignment.PlantSection AS PlantSection,
I_FunctionalLocation._LocationAccountAssignment._WorkCenter.WorkCenter AS WorkCenter,
I_FunctionalLocation._LocationAccountAssignment.WorkCenterInternalID AS WorkCenterInternalID,
I_FunctionalLocation._LocationAccountAssignment._WorkCenter.Plant AS WorkCenterPlant,
I_FunctionalLocation._LocationAccountAssignment.ABCIndicator AS ABCIndicator,
I_FunctionalLocation._LocationAccountAssignment.MaintObjectFreeDefinedAttrib AS MaintObjectFreeDefinedAttrib,
I_FunctionalLocation._LocationAccountAssignment.AddressID AS AddressID,
I_FunctionalLocation._LocationAccountAssignment._Address2.FormOfAddress AS FormOfAddress,
I_FunctionalLocation._LocationAccountAssignment._Address2.OrganizationName1 AS BusinessPartnerName1,
I_FunctionalLocation._LocationAccountAssignment._Address2.OrganizationName2 AS BusinessPartnerName2,
I_FunctionalLocation._LocationAccountAssignment._Address2.CityName AS CityName,
I_FunctionalLocation._LocationAccountAssignment._Address2.HouseNumber AS HouseNumber,
I_FunctionalLocation._LocationAccountAssignment._Address2.HouseNumberSupplementText AS HouseNumberSupplementText,
I_FunctionalLocation._LocationAccountAssignment._Address2.Building AS Building,
I_FunctionalLocation._LocationAccountAssignment._Address2.Floor AS Floor,
I_FunctionalLocation._LocationAccountAssignment._Address2.RoomNumber AS RoomNumber,
I_FunctionalLocation._LocationAccountAssignment._Address2.PostalCode AS PostalCode,
I_FunctionalLocation._LocationAccountAssignment._Address2.StreetName AS StreetName,
I_FunctionalLocation._LocationAccountAssignment._Address2.Region AS Region,
I_FunctionalLocation._LocationAccountAssignment._Address2.Country AS Country,
I_FunctionalLocation._LocationAccountAssignment._PhoneNumber.PhoneAreaCodeSubscriberNumber AS PhoneNumber,
I_FunctionalLocation._LocationAccountAssignment._FaxNumber.FaxAreaCodeSubscriberNumber AS FaxNumber,
I_FunctionalLocation._LocationAccountAssignment.CompanyCode AS CompanyCode,
I_FunctionalLocation._LocationAccountAssignment.BusinessArea AS BusinessArea,
I_FunctionalLocation._LocationAccountAssignment.MasterFixedAsset AS MasterFixedAsset,
I_FunctionalLocation._LocationAccountAssignment.FixedAsset AS FixedAsset,
I_FunctionalLocation._LocationAccountAssignment.CostCenter AS CostCenter,
I_FunctionalLocation._LocationAccountAssignment.ControllingArea AS ControllingArea,
I_FunctionalLocation._LocationAccountAssignment._WBSElementBasicData.WBSElementExternalID AS WBSElementExternalID,
I_FunctionalLocation._LocationAccountAssignment.SettlementOrder AS SettlementOrder,
I_FunctionalLocation.ConstructionMaterial AS ConstructionMaterial,
I_FunctionalLocation.MaintenancePlannerGroup AS MaintenancePlannerGroup,
I_FunctionalLocation.MaintenancePlanningPlant AS MaintenancePlanningPlant,
cast(I_FunctionalLocation._WorkCenter.Plant as wergw preserving type ) AS MainWorkCenterPlant,
cast(I_FunctionalLocation._WorkCenter.WorkCenter as gewrk preserving type) AS MainWorkCenter,
I_FunctionalLocation.WorkCenterInternalID AS MainWorkCenterInternalID,
I_FunctionalLocation.CatalogProfile AS CatalogProfile,
I_FunctionalLocation.EquipmentInstallationIsAllowed AS EquipmentInstallationIsAllowed,
I_FunctionalLocation.OnePieceOfEquipmentIsAllowed AS OnePieceOfEquipmentIsAllowed,
I_FunctionalLocation._LocationAccountAssignment.SalesOrganization AS SalesOrganization,
I_FunctionalLocation._LocationAccountAssignment.DistributionChannel AS DistributionChannel,
I_FunctionalLocation._LocationAccountAssignment.SalesOffice AS SalesOffice,
I_FunctionalLocation._LocationAccountAssignment.OrganizationDivision AS OrganizationDivision,
I_FunctionalLocation._LocationAccountAssignment.SalesGroup AS SalesGroup,
_FuncnlLocHasEquipment.FunctionalLocationHasEquipment AS FunctionalLocationHasEquipment,
_FuncLocHasSubOrdinateFuncLoc.FuncnlLocHasSubOrdinateFuncLoc AS FuncnlLocHasSubOrdinateFuncLoc,
I_FunctionalLocation.LastChangeDateTime AS LastChangeDateTime,
_FuncnlLocStatus.FuncnlLocIsMarkedForDeletion AS FuncnlLocIsMarkedForDeletion,
_FuncnlLocStatus.FuncnlLocIsDeleted AS FuncnlLocIsDeleted,
_FuncnlLocStatus.FunctionalLocationIsActive AS FunctionalLocationIsActive,
_FuncnlLocStatus.FunctionalLocationIsCreated AS FunctionalLocationIsCreated,
_FuncnlLocStatus.FuncnlLocIsDeactivated AS FuncnlLocIsDeactivated,
I_FunctionalLocation.CreatedByUser AS CreatedByUser,
I_FunctionalLocation.CreationDate AS CreationDate,
I_FunctionalLocation.LastChangedByUser AS LastChangedByUser
FROM I_FunctionalLocation
LEFT OUTER JOIN I_FunctionalLocationLabel AS _FunctionalLocationLabel ON FunctionalLocation = _FunctionalLocationLabel.FunctionalLocation -- association [0..1]
LEFT OUTER JOIN I_FunctionalLocationLabel AS _SupFunctionalLocationLabel ON SuperiorFunctionalLocation = _SupFunctionalLocationLabel.FunctionalLocation -- association [0..1]
LEFT OUTER JOIN I_FunctionalLocationStatus AS _FuncnlLocStatus ON FunctionalLocation = _FuncnlLocStatus.FunctionalLocation -- association [0..1]
LEFT OUTER JOIN P_FuncnlLocHasEquipment AS _FuncnlLocHasEquipment ON FunctionalLocation = _FuncnlLocHasEquipment.FunctionalLocation -- association [0..1]
LEFT OUTER JOIN P_FuncLocHasSubOrdinateFuncLoc AS _FuncLocHasSubOrdinateFuncLoc ON FunctionalLocation = _FuncLocHasSubOrdinateFuncLoc.FunctionalLocation -- association [0..1]
LEFT OUTER JOIN E_FunctionalLocation AS _FunctionalLocationExtension ON _FunctionalLocationExtension.FunctionalLocation = FunctionalLocation -- association [0..1]
LEFT OUTER JOIN R_FunctionalLocationPartnerTP AS _Partner ON /* condition not available in parsed metadata */ -- association [0..*]
LEFT OUTER JOIN R_FunctionalLocationLongTextTP AS _LongText ON /* condition not available in parsed metadata */ -- association [1..1]
LEFT OUTER JOIN R_FuncnlLocClfnClassTP AS _Classification ON /* condition not available in parsed metadata */ -- association [0..*]
LEFT OUTER JOIN R_FuncnlLocWrntyAssgmtTP AS _Warranty ON /* condition not available in parsed metadata */ -- association [0..*]
;