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_CADunningNotice.
-- 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: CCADUNNOTICE
CREATE VIEW C_CADunningNotice AS
SELECT
_CADunningNotice.CAMassRunDate AS CAMassRunDate,
_CADunningNotice.CAMassRunID AS CAMassRunID,
_CADunningNotice.BusinessPartner AS BusinessPartner,
_CADunningNotice.ContractAccount AS ContractAccount,
_CADunningNotice.CADunningCounter AS CADunningCounter,
cast(concat( cast(_CADunningNotice.CAMassRunDate as date), _CADunningNotice.CAMassRunID) as abap.char(20) ) AS CADunningRunDateAndID,
CAContract,
_ProviderContract.CAProviderContractName AS CAProviderContractName,
CASubApplication,
_CADunningNotice._CASubApplication._CASubApplicationText[1:Language=$session.system_language].CASubApplicationText AS CASubApplicationText,
cast('' as vtref_semobj_kk) AS CAContractSemanticObject,
_CADunningNotice._BusinessPartner.BusinessPartnerFullName AS BusinessPartnerFullName,
_CADunningNotice._CAHeader.ContractAccountName AS ContractAccountName,
cast(concat_with_space(_BusinessPartner._CurrentDefaultAddress._AddressDefaultRepresentation.PostalCode, _BusinessPartner._CurrentDefaultAddress._AddressDefaultRepresentation.CityName, 1) as secdep_home_town_kk) as HomeTown AS CityName1assecdep_home_town_kkasHomeTown,
cast(_BusinessPartner._CurrentDefaultAddress._AddressDefaultRepresentation.Country as secdep_country_descrip_kk) AS Country,
_BusinessPartner._CurrentDefaultAddress._AddressDefaultRepresentation._Country._Text[1:Language=$session.system_language].CountryName AS CountryName,
_CADunningNotice.CAIssueDate AS CAIssueDate,
_CADunningNotice.CADunningProcedure AS CADunningProcedure,
_CADunningNotice._DunningProcedure._Text[1:Language = $session.system_language].CADunningProcedureName AS CADunningProcedureName,
_CADunningNotice.CADunningLevel AS CADunningLevel,
_CADunningNotice._DunningLevel._Text[1:Language = $session.system_language].CADunningLevelName AS CADunningLevelName,
_CADunningNotice.CADunningLevelCategory AS CADunningLevelCategory,
_CADunningNotice._DunningLevel._DunningLevelCat._Text[1:Language = $session.system_language].CADunningLevelCategoryName AS CADunningLevelCategoryName,
_CADunningNotice.CACollectionStrategy AS CACollectionStrategy,
_CADunningNotice._CollectionStrategy._Text[1:Language = $session.system_language].CACollectionStrategyName AS CACollectionStrategyName,
_CADunningNotice.CACollectionStep AS CACollectionStep,
_CADunningNotice._CollectionStep._Text[1:Language = $session.system_language].CACollectionStepName AS CACollectionStepName,
_CADunningNotice.CACollectionStepType AS CACollectionStepType,
_CADunningNotice._CollStepType._Text[1:Language = $session.system_language].CACollectionStepTypeName AS CACollectionStepTypeName,
_CADunningNotice.CADunningNoticeIsReversed AS CADunningNoticeIsReversed,
_CADunningNotice.CADunningBalance AS CADunningBalance,
_CADunningNotice.CADunningReductionAmount AS CADunningReductionAmount,
_CADunningNotice.TransactionCurrency AS TransactionCurrency,
_CADunningNotice.Division AS Division,
_CADunningNotice._Division._Text[1:Language = $session.system_language].DivisionName AS OrganizationDivisionText,
_CADunningNotice.CADunningActivityRunDate AS CADunningActivityRunDate,
concat_with_space( concat_with_space( cast(CAMassRunDate as date) , '/', 1), CAMassRunID, 1) AS CAMassRunDateAndID,
_CADunningNotice.CADunningChargesSchema AS CADunningChargesSchema,
_CADunningNotice._ChargesSchema._Text[1:Language = $session.system_language].CAChargesSchemaName AS CAChargesSchemaName,
_CADunningNotice.CADunningChargeAmount AS CADunningChargeAmount,
_CADunningNotice.CADunningInterestAmount AS CADunningInterestAmount,
_CADunningNotice.CADocumentForDunningInterest AS CADocumentForDunningInterest,
_CADunningNotice.CASuccessPercentage AS CASuccessPercentage,
cast('%' as unit) AS CAPercentageUnit,
_CADunningNotice.CADunningValuationRunDate AS CADunningValuationRunDate,
_CADunningNotice.CADunningValuationStatus AS CADunningValuationStatus,
_CADunningNotice._DunValStatus._Text[1:Language = $session.system_language].CADunningValuationStatusName AS CADunningValuationStatusName,
_CADunningNotice.CASubstituteDocumentNumber AS CASubstituteDocumentNumber,
_CADunningNotice.CASubstituteDocumentCategory AS CASubstituteDocumentCategory,
_CADunningNotice._CASubstituteDocCategory._Text[1:Language = $session.system_language].CASubstituteDocCategoryName AS CASubstituteDocCategoryName,
_CADunningNotice.CAMaximumDeferralDate AS CAMaximumDeferralDate,
_CADunningNotice._CompCode.CompanyCodeName AS CompanyCodeName,
_CADunningNotice.CACompanyCodeGroup AS CACompanyCodeGroup,
_CADunningNotice._CompCodeGroup._Text[1:Language = $session.system_language].CACompanyCodeGroupName AS CACompanyCodeGroupName,
_CADunningNotice.CALeadingContractAccount AS CALeadingContractAccount,
_CADunningNotice._CAHeaderLeading.ContractAccountName AS LeadingContractAccountName,
_CADunningNotice.CAAlternativeDunningRecipient AS CAAlternativeDunningRecipient,
_CADunningNotice._BPAltvDunRcpnt.BusinessPartnerFullName AS CAAltvDunningRecipientName,
_CADunningNotice.CAContrAcctGroupForCollMgmt AS CAContrAcctGroupForCollMgmt,
_CADunningNotice.BusinessArea AS BusinessArea,
_CADunningNotice._BusinessArea._Text[1:Language = $session.system_language].BusinessAreaName AS BusinessAreaName,
_CADunningNotice.CADunningNoticeGroup AS CADunningNoticeGroup,
_CADunningNotice._DunNoticeGroup._Text[1:Language = $session.system_language].CADunningNoticeGroupName AS CADunningNoticeGroupName,
_CADunningNotice.CAKeyDateForConsideredPayts AS CAKeyDateForConsideredPayts,
_CADunningNotice.CAPaymentFormNumber AS CAPaymentFormNumber,
_CADunningNotice.CAPaymentFormExternalNumber AS CAPaymentFormExternalNumber,
_CADunningNotice.CAPaymentTargetDate AS CAPaymentTargetDate,
_CADunningNotice.CADunningNoticeIsInfoOnly AS CADunningNoticeIsInfoOnly,
_CADunningNotice.CAIsSubmittedToCollAgency AS CAIsSubmittedToCollAgency,
_CADunningNotice.CACreditWorthinessBeforeDun AS CACreditWorthinessBeforeDun,
_CADunningNotice.CAReplacedCollectionStep AS CAReplacedCollectionStep,
_CADunningNotice._CollStepReplaced._Text[1:Language = $session.system_language].CACollectionStepName AS CAReplacedCollectionStepName,
_CADunningNotice.CACapForDunActyIsRestricted AS CACapForDunActyIsRestricted,
_CADunningNotice.CADunningNoticeMustBeReleased AS CADunningNoticeMustBeReleased,
_CADunningNotice.CALatestReleaseDate AS CALatestReleaseDate,
_CADunningNotice.CAGroupingFieldForCollMgmt AS CAGroupingFieldForCollMgmt,
_CADunningNotice.CACollectionStepOfLastDunning AS CACollectionStepOfLastDunning,
_CADunningNotice._CollStepLast._Text[1:Language = $session.system_language].CACollectionStepName AS CACollStepOfLastDunningName,
_CADunningNotice.CAReplacedCollectionStrategy AS CAReplacedCollectionStrategy,
_CADunningNotice._CollStrategyReplaced._Text[1:Language = $session.system_language].CACollectionStrategyName AS CAReplacedCollStrategyName,
_CADunningNotice.CACollectionTestSeries AS CACollectionTestSeries,
_CADunningNotice.CANextDunningDate AS CANextDunningDate,
_CADunningNotice.CAAmountForDunningCharge1 AS CAAmountForDunningCharge1,
_CADunningNotice.CATypeForDunningCharge1 AS CATypeForDunningCharge1,
_CADunningNotice._ChargeType1._Text[1:Language = $session.system_language].CAChargeTypeName AS CAChargeTypeName1,
_CADunningNotice.CADocumentForDunningCharge1 AS CADocumentForDunningCharge1,
_CADunningNotice.CAPostingCodeForDunningCharge1 AS CAPostingCodeForDunningCharge1,
_CADunningNotice.CAAmountForDunningCharge2 AS CAAmountForDunningCharge2,
_CADunningNotice.CATypeForDunningCharge2 AS CATypeForDunningCharge2,
_CADunningNotice._ChargeType2._Text[1:Language = $session.system_language].CAChargeTypeName AS CAChargeTypeName2,
_CADunningNotice.CADocumentForDunningCharge2 AS CADocumentForDunningCharge2,
_CADunningNotice.CAPostingCodeForDunningCharge2 AS CAPostingCodeForDunningCharge2,
_CADunningNotice.CAAmountForDunningCharge3 AS CAAmountForDunningCharge3,
_CADunningNotice.CATypeForDunningCharge3 AS CATypeForDunningCharge3,
_CADunningNotice._ChargeType3._Text[1:Language = $session.system_language].CAChargeTypeName AS CAChargeTypeName3,
_CADunningNotice.CADocumentForDunningCharge3 AS CADocumentForDunningCharge3,
_CADunningNotice.CAPostingCodeForDunningCharge3 AS CAPostingCodeForDunningCharge3,
_CADunningNotice.CorrespondenceKey AS CorrespondenceKey,
_CACompanyCode.CADisputeCaseProcessingIsActv AS CADisputeCaseProcessingIsActv,
_CADunningNotice._CAPartner.CAAuthorizationGroup AS CAAuthorizationGroup,
_CADunningNotice._ProviderContract.CAAuthorizationGroup AS CAProviderContractAuthznGroup,
cast('' as fkk_boole_d ) AS ReverseIsHidden
FROM I_CADunningNotice AS _CADunningNotice
LEFT OUTER JOIN C_CADunningNoticeItem AS _CADunNoticeItem ON ( CAMassRunDate = _CADunNoticeItem.CAMassRunDate AND CAMassRunID = _CADunNoticeItem.CAMassRunID AND BusinessPartner = _CADunNoticeItem.BusinessPartner AND ContractAccount = _CADunNoticeItem.ContractAccount AND CADunningCounter = _CADunNoticeItem.CADunningCounter ) OR ( CAMassRunDate = _CADunNoticeItem.CAMassRunDate AND CAMassRunID = _CADunNoticeItem.CAMassRunID AND BusinessPartner = _CADunNoticeItem.BusinessPartner AND CADunningCounter = _CADunNoticeItem.CADunningCounter AND _CADunNoticeItem.ContractAccountIsNotUnique = 'X' ) -- association [1..*]
LEFT OUTER JOIN C_CADunningNoticeDunReduction AS _DunReduction ON ( CAMassRunDate = _DunReduction.CAMassRunDate AND CAMassRunID = _DunReduction.CAMassRunID AND BusinessPartner = _DunReduction.BusinessPartner AND ContractAccount = _DunReduction.ContractAccount AND CADunningCounter = _DunReduction.CADunningCounter ) -- association [0..*]
LEFT OUTER JOIN I_CACompanyCode AS _CACompanyCode ON ( CAStandardCompanyCode = _CACompanyCode.CompanyCode ) -- association [1..1]
;