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 I_IBCContactFacetData.
-- 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 I_IBCContactFacetData AS
SELECT
cast(cuand_ce_ic_ft_d.db_key as cuan_key_ext preserving type ) AS InteractionCntctFacetDataUUID,
cast(cuand_ce_ic_ft_d.root_key as cuan_key_ext preserving type ) AS InteractionContactUUID,
cast(cuand_ce_ic_ft_d.parent_key as cuan_key_ext preserving type ) AS InteractionContactFacetUUID,
cast(cuand_ce_ic_ft_d.id_origin as cuan_ce_origin preserving type ) AS InteractionContactOrigin,
cuand_ce_ic_ft_d.id AS InteractionContactId,
cuand_ce_ic_ft_d.name_text AS FullName,
cast(cuand_ce_ic_ft_d.name_first as cuan_name_first_ext preserving type ) AS FirstName,
cast(cuand_ce_ic_ft_d.name_last as cuan_name_last_ext preserving type ) AS LastName,
cast(cuand_ce_ic_ft_d.telnr_long as cuan_telnr_ext preserving type ) AS PhoneNumber,
cast(cuand_ce_ic_ft_d.telnr_mobile as cuan_mobile_ext preserving type ) AS MobileNumber,
cast(cuand_ce_ic_ft_d.smtp_addr as cuan_smtp_addr_ext preserving type ) AS EmailAddress,
cast(cuand_ce_ic_ft_d.street as cuan_street_ext preserving type ) AS StreetName,
cuand_ce_ic_ft_d.crea_date_time AS CreationDateTime,
cuand_ce_ic_ft_d.lchg_date_time AS LastChangeDateTime,
cast(cuand_ce_ic_ft_d.crea_uname as cuan_uname_ext preserving type ) AS CreatedByUser,
cast(cuand_ce_ic_ft_d.lchg_uname as cuan_uname_ext preserving type ) AS LastChangedByUser,
cast(cuand_ce_ic_ft_d.house_num1 as cuan_hsnm1_ext preserving type ) AS AddressHouseNumber,
cuand_ce_ic_ft_d.abtnr AS ContactPersonDepartment,
cast(cuand_ce_ic_ft_d.abtnr_ft as cuan_dprtmnt2_ext preserving type ) AS Department,
cuand_ce_ic_ft_d.pafkt AS InteractionContactFunction,
cast(cuand_ce_ic_ft_d.pafkt_ft as cuan_fnctn_ext preserving type ) AS PartnerFunctionName,
cast(cuand_ce_ic_ft_d.marital_status as cuan_marital_status_ext preserving type ) AS MaritalStatus,
cast(cuand_ce_ic_ft_d.city1 as cuan_city1_ext preserving type ) AS CityName,
cast(cuand_ce_ic_ft_d.faxnr_long as cuan_faxnr_ext preserving type ) AS InteractionContactFaxNumber,
cast(cuand_ce_ic_ft_d.title as cuan_title_ext preserving type ) AS FormOfAddress,
cuand_ce_ic_ft_d.web_uri AS WebsiteURL,
cuand_ce_ic_ft_d.image_uri AS InteractionContactImageURL,
cast('DEG' as msehiunit) AS GeoCoordinatesUnit,
cast(cuand_ce_ic_ft_d.latitude as cuan_latitude_ext preserving type ) AS Latitude,
cast(cuand_ce_ic_ft_d.longitude as cuan_longitude_ext preserving type ) AS Longitude,
cast(cuand_ce_ic_ft_d.srid as cuan_srid_ext preserving type ) AS SpatialReferenceSystem,
cuand_ce_ic_ft_d.brsch AS Industry,
cuand_ce_ic_ft_d.brsch_ft AS IndustryKeyText,
tstmp_to_dats( cuand_ce_ic_ft_d.crea_date_time, abap_system_timezone( $session.client,'NULL' ), $session.client, 'NULL' ) as CreationDate AS clientNULLasCreationDate,
tstmp_to_dats( cuand_ce_ic_ft_d.lchg_date_time, abap_system_timezone( $session.client,'NULL' ), $session.client, 'NULL' ) as LastChangeDate AS clientNULLasLastChangeDate,
cuand_ce_ic_ft_d.country AS Country,
cuand_ce_ic_ft_d.country_ft AS CountryFreeText,
cast(cuand_ce_ic_ft_d.region as cuan_region_ext preserving type ) AS AddressRegion,
cuand_ce_ic_ft_d.region_ft AS RegionFreeText,
cuand_ce_ic_ft_d.language AS LanguageCode,
cuand_ce_ic_ft_d.language_ft AS LanguageFreeText,
cast( cuand_ce_ic_ft_d.sex as cuan_cds_gender preserving type ) AS GenderCode,
cuand_ce_ic_ft_d.sex_ft AS GenderFreeText,
cast(cuand_ce_ic_ft_d.date_of_birth as cuan_birthdate_ext preserving type ) AS BirthDate,
cast(cuand_ce_ic_ft_d.postcode1 as cuan_pstcd1_ext preserving type ) AS ContactPostalCode,
cuand_ce_ic_ft_d.number_of_employees AS NrOfEmployeesOfCorpAccount,
cuand_ce_ic_ft_d.company_revenue AS CorporateAccountRevenue,
cuand_ce_ic_ft_d.company_revenue_currency AS CorporateAccountCurrency
FROM cuand_ce_ic_ft_d
LEFT OUTER JOIN E_IBCContactFacetData AS _Extension ON cuand_ce_ic_ft_d.db_key = _Extension.InteractionCntctFacetDataUUID -- association [1..1]
LEFT OUTER JOIN I_MKT_Gender AS _MKT_Gender ON GenderCode = _MKT_Gender.GenderCode -- association [0..1]
LEFT OUTER JOIN I_Region AS _MKT_Region ON Country = _MKT_Region.Country AND AddressRegion = _MKT_Region.Region -- association [0..1]
LEFT OUTER JOIN I_Country AS _MKT_Country ON Country = _MKT_Country.Country -- association [0..1]
LEFT OUTER JOIN I_MKT_Industry AS _MKT_Industry ON Industry = _MKT_Industry.Industry -- association [0..1]
LEFT OUTER JOIN I_MKT_Function AS _MKT_Function ON InteractionContactFunction = _MKT_Function.InteractionContactFunction -- association [0..1]
LEFT OUTER JOIN I_MKT_Marital AS _MKT_Marital ON MaritalStatus = _MKT_Marital.MaritalStatus -- association [0..1]
LEFT OUTER JOIN I_Language AS _Language ON LanguageCode = _Language.Language -- association [0..1]
LEFT OUTER JOIN I_MKT_Department AS _MKT_Department ON Department = _MKT_Department.Department -- association [0..1]
LEFT OUTER JOIN I_MKT_ContactTitle AS _MKT_ContactTitle ON FormOfAddress = _MKT_ContactTitle.FormOfAddress -- association [0..1]
LEFT OUTER JOIN I_IBCContact AS _Contact ON InteractionContactUUID = _Contact.InteractionContactUUID -- association [1..1]
LEFT OUTER JOIN I_IBCContactCommunicationArea AS _IBCContactCommArea ON InteractionContactUUID = _IBCContactCommArea.InteractionContactUUID -- association [0..*]
;