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_UtilsBillgOrdErrorsWithDets.
-- 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 C_UtilsBillgOrdErrorsWithDets AS
SELECT
UtilsBillingOrder.UtilitiesContract AS UtilitiesContract,
UtilsBillingOrder.UtilitiesInstallation AS UtilitiesInstallation,
UtilsBillingOrder.ScheduledUtilitiesBillingDate AS ScheduledUtilitiesBillingDate,
UtilsBillingOrder.UtilitiesBillingReason AS UtilitiesBillingReason,
cast(LatestOpenBPEMCase._BPEMCase.BPEMCase as e_clarificationcase_vdm preserving type) AS BPEMCase,
UtilsBillingOrder.ContractAccount AS ContractAccount,
cast(LatestOpenBPEMCase._BPEMCase.BPEMCaseCategory as e_clarcasecategory_vdm preserving type) AS BPEMCaseCategory,
LatestOpenBPEMCase._BPEMCase.BPEMCaseCurrentProcessor AS BPEMCaseCurrentProcessor,
LatestOpenBPEMCase._BPEMCase._User.UserDescription AS UserDescription,
cast(LatestOpenBPEMCase._BPEMCase.BPEMCasePreviousProcessor as e_clarcaseprevproc_vdm preserving type) AS BPEMCasePreviousProcessor,
LatestOpenBPEMCase._BPEMCase._PreviousUser.UserDescription AS LastChangedByUserDescription,
LatestOpenBPEMCase._BPEMCase.BPEMBusinessProcessCode AS BPEMBusinessProcessCode,
LatestOpenBPEMCase._BPEMCase.BPEMCaseForwardingReason AS BPEMCaseForwardingReason,
cast(LatestOpenBPEMCase._BPEMCase.BPEMCaseCreationDate as e_clarcasecreationdate_vdm preserving type) AS BPEMCaseCreationDate,
cast(LatestOpenBPEMCase._BPEMCase.BPEMCaseDueDate as e_clarcaseduedate_vdm preserving type) AS BPEMCaseDueDate,
cast(LatestOpenBPEMCase._BPEMCase.BPEMCaseOriginalDate as e_clarcaseorigdate_vdm preserving type) AS BPEMCaseOriginalDate,
cast(LatestOpenBPEMCase._BPEMCase.BPEMCasePriority as e_clarcasepriority_vdm preserving type) AS BPEMCasePriority,
cast(LatestOpenBPEMCase._BPEMCase.BPEMCaseStatus as e_clarcasestatus_vdm) AS BPEMCaseStatus,
UtilsBillingOrder.UtilitiesPortion AS UtilitiesPortion,
UtilsBillingOrder.ScheduledMeterReadingDate AS ScheduledMeterReadingDate,
UtilsBillingOrder.CompanyCode AS CompanyCode,
UtilsBillingOrder.Division AS Division,
UtilsBillingOrder.UtilsBillgBlockReason AS UtilsBillgBlockReason,
UtilsBillingOrder.UtilsBillgUnblockReason AS UtilsBillgUnblockReason,
UtilsBillingOrder.UtilitiesBillingClass AS UtilitiesBillingClass,
UtilsBillingOrder.BusinessPartner AS BusinessPartner,
UtilsBillingOrder._UtilitiesInstallation.UtilitiesPremise AS UtilitiesPremise,
UtilsBillingOrder.UtilitiesRateCategory AS UtilitiesRateCategory,
UtilsBillingOrder.MeterReadingUnit AS MeterReadingUnit,
UtilsBillingOrder.UtilitiesMoveInDate AS UtilitiesMoveInDate,
UtilsBillingOrder.UtilitiesMoveOutDate AS UtilitiesMoveOutDate,
UtilsBillingOrder._UtilitiesPortion.UtilsDefaultBdgtBillgCycle AS UtilsDefaultBdgtBillgCycle,
UtilsBillingOrder.UtilsContrSpcfcBdgtBillgCycle AS UtilsContrSpcfcBdgtBillgCycle,
UtilsBillingOrder.UtilitiesAccountDetnCode AS UtilitiesAccountDetnCode,
UtilsBillingOrder.UtilsBillgOutsortingReason AS UtilsBillgOutsortingReason,
UtilsBillingOrder.UtilsExternalPointOfDelivery AS UtilsExternalPointOfDelivery,
cast('' as abap.sstring( 256 )) AS UtilsPostalAddressFormatted,
UtilsBillingOrder._UtilitiesInstallation._UtilitiesPremise._UtilsTechObjLocationAddr.AddressID AS AddressID,
UtilsBillingOrder._UtilitiesInstallation._UtilitiesPremise._UtilsTechObjLocationAddr._Address2 AS _Address2,
UtilsBillingOrder.AuthorizationGroup AS AuthorizationGroup,
cast(_CalendarDate.CalendarMonth as e_schdldmnth_vdm preserving type ) AS CalendarMonth,
_CalendarDate._CalendarMonth._Text[1: Language = $session.system_language].CalendarMonthName AS CalendarMonthName,
cast(_CalendarDate.CalendarYear as e_schdldyr_vdm preserving type ) AS CalendarYear,
UtilsBillingOrder._CompanyCode AS _CompanyCode,
UtilsBillingOrder._Division AS _Division,
UtilsBillingOrder._UtilitiesBillingReason AS _UtilitiesBillingReason,
UtilsBillingOrder._UtilitiesInstallation AS _UtilitiesInstallation,
UtilsBillingOrder._UtilitiesPortion AS _UtilitiesPortion,
UtilsBillingOrder._UtilsBillgBlockReason AS _UtilsBillgBlockReason,
UtilsBillingOrder._UtilsBillgUnblockReason AS _UtilsBillgUnblockReason,
UtilsBillingOrder._UtilsBillingClass AS _UtilsBillingClass,
UtilsBillingOrder._BusinessPartner AS _BusinessPartner,
UtilsBillingOrder._ContrAcc AS _ContrAcc,
UtilsBillingOrder._UtilitiesRateCategory AS _UtilitiesRateCategory,
UtilsBillingOrder._MeterReadingUnit AS _MeterReadingUnit,
UtilsBillingOrder._UtilsContrSpcfcBdgtBillgCyc AS _UtilsContrSpcfcBdgtBillgCyc,
UtilsBillingOrder._UtilsBillgOutsortingGroup AS _UtilsBillgOutsortingGroup,
UtilsBillingOrder._UtilitiesPortion._UtilitiesBdgtBillgCyc AS _UtilitiesBdgtBillgCyc,
UtilsBillingOrder._UtilsAccountDetnCode AS _UtilsAccountDetnCode,
UtilsBillingOrder._UtilitiesInstallation._UtilitiesPremise AS _UtilitiesPremise,
LatestOpenBPEMCase._BPEMCase._BPEMBusinessProcessCode AS _BPEMBusinessProcessCode,
LatestOpenBPEMCase._BPEMCase._BPEMCaseCategory AS _BPEMCaseCategory,
LatestOpenBPEMCase._BPEMCase._BPEMCasePriority AS _BPEMCasePriority,
LatestOpenBPEMCase._BPEMCase._User AS _User,
LatestOpenBPEMCase._BPEMCase._PreviousUser AS _PreviousUser,
LatestOpenBPEMCase._BPEMCase._BPEMCaseForwardReason AS _BPEMCaseForwardReason,
_CalendarDate._CalendarYear AS _CalendarYear,
_CalendarDate._CalendarMonth AS _CalendarMonth
FROM I_UtilsBillingOrder AS UtilsBillingOrder
LEFT OUTER JOIN I_LatestOpenBPEMCase AS LatestOpenBPEMCase ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN C_BPEMCaseTP AS _BPEMCaseTP ON UtilitiesInstallation = _BPEMCaseTP.BPEMCaseMainObject AND _BPEMCaseTP.BPEMCaseMainObjectType = 'INSTLN' AND _BPEMCaseTP.BPEMBusinessProcessCode = 'EBI00001' -- association [0..*]
LEFT OUTER JOIN I_CalendarDate AS _CalendarDate ON ScheduledUtilitiesBillingDate = _CalendarDate.CalendarDate -- association [1..1]
LEFT OUTER JOIN I_OpenBPEMCaseStatusVH AS _OpenBPEMCaseStatus ON BPEMCaseStatus = _OpenBPEMCaseStatus.BPEMCaseStatus -- association [0..1]
LEFT OUTER JOIN I_ContractAccountPartner AS _ContractAccountPartner ON ContractAccount = _ContractAccountPartner.ContractAccount AND BusinessPartner = _ContractAccountPartner.BusinessPartner -- association [1..1]
;