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 P_CreditLimitRequest1.
-- 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: PCRDTLIMITREQ1
-- Parameters: P_KeyDate : sydate, P_DisplayCurrency : vdm_v_display_currency, P_ExchangeRateType : kurst_curr
CREATE VIEW P_CreditLimitRequest1 AS
SELECT
CaseUUID,
CaseID,
BusinessPartner,
CreditSegment,
CaseProcessor,
CaseCreatedBy,
CaseLastChangedBy,
CaseClosedBy,
CaseReason,
CaseType,
CaseStatusProfile,
CaseSystemStatus,
CaseStatus,
CasePriority,
CaseEscalationReason,
CaseCategory,
CreditLimitUtilizationPct,
BusinessPartnerRating,
CreditRiskClass,
CrdtMgmtBusinessPartnerGroup,
:P_KeyDate AS TodayDate,
tstmp_to_dats( CaseCreatedOn, abap_system_timezone( $session.client,'NULL' ), $session.client, 'NULL' ) AS CaseCreationDate,
tstmp_to_dats( CaseLastChangedOn, abap_system_timezone( $session.client,'NULL' ), $session.client, 'NULL' ) AS CaseLastChangeDate,
tstmp_to_dats( CaseClosedTime, abap_system_timezone( $session.client,'NULL' ), $session.client, 'NULL' ) AS CaseClosingDate,
cast( CasePlannedCloseDate as scmg_plan_end_date preserving type ) AS CasePlannedCloseDate,
:P_DisplayCurrency AS DisplayCurrency,
currency_conversion( amount => CreditLimitAmount, source_currency => CreditSegmentCurrency, target_currency => :P_DisplayCurrency, exchange_rate_date => :P_KeyDate , exchange_rate_type => :P_ExchangeRateType, error_handling => #CNV_ERROR_HANDLING.FAIL_ON_ERROR, round => #CDSBoolean.true, decimal_shift => #CDSBoolean.true, decimal_shift_back => #CDSBoolean.true ) as CreditLimitAmount AS trueasCreditLimitAmount,
currency_conversion( amount => CreditLimitRequestedAmount, source_currency => CreditSegmentCurrency, target_currency => :P_DisplayCurrency, exchange_rate_date => :P_KeyDate , exchange_rate_type => :P_ExchangeRateType, error_handling => #CNV_ERROR_HANDLING.FAIL_ON_ERROR, round => #CDSBoolean.true, decimal_shift => #CDSBoolean.true, decimal_shift_back => #CDSBoolean.true ) as CreditLimitRequestedAmount AS trueasCreditLimitRequestedAmount,
currency_conversion( amount => CreditLimitApprovedAmount, source_currency => CreditSegmentCurrency, target_currency => :P_DisplayCurrency, exchange_rate_date => :P_KeyDate , exchange_rate_type => :P_ExchangeRateType, error_handling => #CNV_ERROR_HANDLING.FAIL_ON_ERROR, round => #CDSBoolean.true, decimal_shift => #CDSBoolean.true, decimal_shift_back => #CDSBoolean.true ) as CreditLimitApprovedAmount AS trueasCreditLimitApprovedAmount,
currency_conversion( amount => ExpectedSalesAmount, source_currency => CreditSegmentCurrency, target_currency => :P_DisplayCurrency, exchange_rate_date => :P_KeyDate , exchange_rate_type => :P_ExchangeRateType, error_handling => #CNV_ERROR_HANDLING.FAIL_ON_ERROR, round => #CDSBoolean.true, decimal_shift => #CDSBoolean.true, decimal_shift_back => #CDSBoolean.true ) as ExpectedSalesAmount AS trueasExpectedSalesAmount,
currency_conversion( amount => CustomerCreditExposureAmount, source_currency => CreditSegmentCurrency, target_currency => :P_DisplayCurrency, exchange_rate_date => :P_KeyDate , exchange_rate_type => :P_ExchangeRateType, error_handling => #CNV_ERROR_HANDLING.FAIL_ON_ERROR, round => #CDSBoolean.true, decimal_shift => #CDSBoolean.true, decimal_shift_back => #CDSBoolean.true ) as CustomerCreditExposureAmount AS trueasCustomerCreditExposureAmount
FROM I_CreditLimitRequest
LEFT OUTER JOIN I_Currency AS _DisplayCurrency ON DisplayCurrency = _DisplayCurrency.Currency -- association [1..1]
;