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_TrsySmltPerEndClsPosValsAbs.
-- 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: PTRSVABS
CREATE VIEW P_TrsySmltPerEndClsPosValsAbs AS
SELECT
TrsyPosSmltdValuationKeyDate,
TrsyPosSmltdValuationUUID,
TrsySubPosition,
TreasuryPosition,
PositionCurrency,
ValuationCurrency,
NominalCurrency,
QuantityInPieces,
DesignatedQuantityInPieces,
DesignatedAmountInNominalCrcy,
DesignatedOrigAmtInNominalCrcy,
NominalAmountInNominalCurrency,
OriglNominalAmtInNominalCrcy,
index_factor,
cast(PC_1001 as ftr_gen_purch_pc preserving type) AS PurchaseValueInPositionCrcy,
cast(VC_1001 as ftr_gen_purch_vc preserving type) AS PurchaseValueInValuationCrcy,
cast(PC_1002 as ftr_gen_val_ti_pc preserving type) AS SecurityValuationAmtInPosCrcy,
cast(VC_1002 as ftr_gen_val_ti_vc preserving type) AS SecurityValuationAmtInValnCrcy,
cast(PC_IDX_1002 as ftr_gen_val_ti_indx_pc preserving type) AS IdxCleanScrtyValnAmtInPosCrcy,
cast(VC_1003 as ftr_gen_val_fx_vc preserving type) AS ForeignCrcyValnAmtInValnCrcy,
cast(PC_1004 as ftr_gen_charge_pc preserving type) AS CostInPositionCurrency,
cast(VC_1004 as ftr_gen_charge_vc preserving type) AS CostInValuationCurrency,
cast(PC_1005 as ftr_gen_val_ch_ti_pc preserving type) AS SecurityCostValnAmtInPosCrcy,
cast(VC_1005 as ftr_gen_val_ch_ti_vc preserving type) AS SecurityCostValnAmtInValnCrcy,
cast(PC_IDX_1005 as ftr_gen_val_ch_ti_indx_pc preserving type) AS IndexClnScrtyCostValuationAmt,
cast(VC_1006 as ftr_gen_val_ch_fx_vc preserving type ) AS FrgnExchCostValnAmtInValnCrcy,
cast(PC_1007 as ftr_gen_amort_pc preserving type) AS AmortizationAmtInPositionCrcy,
cast(VC_1007 as ftr_gen_amort_vc preserving type) AS AmortizationAmtInValuationCrcy,
cast(PC_IDX_1007 as ftr_gen_amort_indx_pc preserving type) AS IndexCleanAmtznAmountInPosCrcy,
cast(PC_1008 as ftr_gen_disagio_pc preserving type) AS ClrdPremDiscDefrlTxCompnAmount,
cast(VC_1008 as ftr_gen_disagio_vc preserving type) AS ClrdPremDiscDefrlAmtInValnCrcy,
cast(PC_IDX_1008 as ftr_gen_disagio_indx_pc preserving type) AS IdxClnClrdPremDiscDeferralAmt,
cast(PC_1009 as ftr_gen_val_idx_pc preserving type) AS IndexValuationAmountInPosCrcy,
cast(VC_1009 as ftr_gen_val_idx_vc preserving type) AS IndexValuationAmountInValnCrcy,
cast(PC_1010 as ftr_gen_deferral_item_pv_pc preserving type) AS PurValDeferralItmAmtInPosCrcy,
cast(VC_1010 as ftr_gen_deferral_item_pv_vc preserving type) AS PurValDeferralItmAmtInValnCrcy,
cast(PC_IDX_1010 as ftr_gen_deferral_item_pv_ix_pc preserving type) AS IdxClnPurValDefrlAmtInPosCrcy,
cast(VC_1011 as ftr_gen_val_fx_amaqu_val_vc preserving type) AS FXValnAmtzdAcqnAmtInValnCrcy,
cast(PC_1012 as ftr_gen_varmar_pc preserving type) AS VariationMarginAmountInPosCrcy,
cast(VC_1012 as ftr_gen_varmar_vc preserving type) AS VariationMarginAmtInValnCrcy,
cast(PC_1013 as ftr_gen_val_ti_npl_pc preserving type) AS OCISecurityValnAmountInPosCrcy,
cast(VC_1013 as ftr_gen_val_ti_npl_vc preserving type) AS OCIScrtyValnAmountInValnCrcy,
cast(PC_IDX_1013 as ftr_gen_val_ti_npl_indx_pc preserving type) AS IdxClnOCIScrtyValnAmtInPosCrcy,
cast(VC_1014 as ftr_gen_val_fx_npl_vc preserving type) AS OCIFrgnExchValnAmtInValnCrcy,
cast(PC_1015 as ftr_gen_val_idx_npl_pc preserving type) AS OCIIndexValnAmountInPosCrcy,
cast(VC_1015 as ftr_gen_val_idx_npl_vc preserving type) AS OCIIndexValnAmountInValnCrcy,
cast(PC_1016 as ftr_gen_val_ch_ti_npl_pc preserving type) AS OCIScrtyCostValnAmtInPosCrcy,
cast(VC_1016 as ftr_gen_val_ch_ti_npl_vc preserving type) AS OCIScrtyCostValnAmtInValnCrcy,
cast(PC_IDX_1016 as ftr_gen_val_ch_ti_npl_indx_pc preserving type) AS IdxClnOCIScrtyCostValuationAmt,
cast(VC_1017 as ftr_gen_val_ch_fx_npl_vc preserving type) AS OCICostFXValnAmountInValnCrcy,
cast(PC_1018 as ftr_gen_comp_acc_interest_pc preserving type) AS AccruedInterestAmtInPosCrcy,
cast(VC_1018 as ftr_gen_comp_acc_interest_vc preserving type) AS AccruedInterestAmtInValnCrcy,
cast(AccruedInterestPnLAmtInPsC as ftr_gen_pnl_acc_interest_pc preserving type) AS AccruedInterestPnLAmtInPsC,
cast(AccruedInterestPnLAmtInVC as ftr_gen_pnl_acc_interest_vc preserving type) AS AccruedInterestPnLAmtInVC,
cast(PC_1019 as ftr_gen_amort_neg_spread_pc preserving type) AS NegttnSpreadAmtznAmtInPosCrcy,
cast(VC_1019 as ftr_gen_amort_neg_spread_vc preserving type ) AS NegttnSpreadAmtznAmtInValnCrcy,
cast(PC_IDX_1019 as ftr_gen_amort_neg_spread_ix_pc preserving type) AS IndexCleanNegttnAmtznInPosCrcy,
cast(PC_1020 as ftr_gen_repayment_pc preserving type) AS CumltvRepaymentAmountInPosCrcy,
cast(VC_1020 as ftr_gen_repayment_vc preserving type) AS CumltvRepaymentAmtInValnCrcy,
cast(PC_1021 as ftr_gen_cons_gains_ti_pc preserving type) AS CnsldtdScrtyGainAmtInPosCrcy,
cast(VC_1021 as ftr_gen_cons_gains_ti_vc preserving type) AS CnsldtdScrtyGainAmtInValnCrcy,
cast(PC_1022 as ftr_gen_cons_losses_ti_pc preserving type) AS CnsldtdScrtyLossAmtInPosCrcy,
cast(VC_1022 as ftr_gen_cons_losses_ti_vc preserving type) AS CnsldtdScrtyLossAmtInValnCrcy,
cast(VC_1023 as ftr_gen_cons_gains_fx_vc preserving type) AS CnsldtdForExGainAmtInValnCrcy,
cast(VC_1024 as ftr_gen_cons_losses_fx_vc preserving type) AS CnsldtdForExLossAmtInValnCrcy,
cast(PC_1025 as ftr_gen_vad_gain_pc preserving type) AS GainValueAdjmtAmountInPosCrcy,
cast(VC_1025 as ftr_gen_vad_gain_vc preserving type) AS GainValueAdjmtAmountInValnCrcy,
cast(PC_1026 as ftr_gen_vad_loss_pc preserving type) AS LossValueAdjmtAmountInPosCrcy,
cast(VC_1026 as ftr_gen_vad_loss_vc preserving type) AS LossValueAdjmtAmountInValnCrcy,
cast(PC_1027 as ftr_gen_orig_vad_pc preserving type) AS OriginalValueAdjmtAmtInPosCrcy,
cast(VC_1027 as ftr_gen_orig_vad_vc preserving type) AS OriginalValAdjmtAmtInValnCrcy,
cast(PC_1028 as ftr_gen_int_income_pc preserving type) AS InterestIncomeInPositionCrcy,
cast(VC_1028 as ftr_gen_int_income_vc preserving type) AS InterestIncomeInValuationCrcy,
cast(PC_1029 as ftr_gen_hamort_pc preserving type) AS HedgeAmortizationAmtInPosCrcy,
cast(VC_1029 as ftr_gen_hamort_vc preserving type) AS HedgeAmortizationAmtInValnCrcy,
cast(VC_1030 as ftr_gen_val_fx_aqu_val_vc preserving type) AS FXValnAcqnAmtInValnCrcy,
cast(VC_1098 as ftr_gen_fx_valuation_diff_vc preserving type) AS FrgnExchValnDiffAmtInValnCrcy,
cast(PC_1099 as ftr_gen_capitalization_res_pc preserving type) AS CapitalizationRsrvInPosCrcy,
cast(VC_1099 as ftr_gen_capitalization_res_vc preserving type) AS CapitalizationRsrvInValnCrcy,
cast(VC_1105 as ftr_gen_spotvalp_vc preserving type) AS PurCrcySpotValnAmtInValnCrcy,
cast(VC_1106 as ftr_gen_spotvals_vc preserving type) AS SaleCrcySpotValnAmtInValnCrcy,
cast(PC_1107 as ftr_gen_swapacc_pc preserving type) AS SwapAccrualAmountInPosCurrency,
cast(VC_1107 as ftr_gen_swapacc_vc preserving type) AS SwapAccrualAmountInValnCrcy,
cast(VC_1108 as ftr_gen_swapval_vc preserving type) AS SwapValuationAmountInValnCrcy,
cast(PC_1201 as ftr_gen_impmnt_pc preserving type) AS ImpairmentAmountInPositionCrcy,
cast(VC_1201 as ftr_gen_impmnt_vc preserving type) AS ImpairmentAmtInValuationCrcy,
cast(PC_IDX_1201 as ftr_gen_impmnt_indx_pc preserving type) AS IndexCleanImprmtAmtInPosCrcy,
cast(VC_1202 as ftr_gen_impmnt_fx_vc preserving type) AS ForeignExchImprmtAmtInValnCrcy,
cast(PC_1300 as ftr_gen_val_amt_to_classify_pc preserving type) AS TrsyClsfctnAmtInPosCrcy,
cast(VC_1300 as ftr_gen_val_amt_to_classify_vc preserving type) AS TrsyClsfctnAmtInValnCrcy,
cast(PC_1301 as ftr_gen_hadj_pc preserving type) AS HedgeAdjustmentAmountInPosCrcy,
cast(VC_1301 as ftr_gen_hadj_vc preserving type) AS HedgeAdjustmentAmtInValnCrcy,
cast(PC_1302 as ftr_gen_effctv_amt_pc preserving type) AS EffctvAmtInPosCrcy,
cast(VC_1302 as ftr_gen_effctv_amt_vc preserving type) AS EffctvAmtInValnCrcy,
cast(PC_1303 as ftr_gen_ineffctv_amt_pc preserving type) AS IneffctvAmtInPosCrcy,
cast(VC_1303 as ftr_gen_ineffctv_amt_vc preserving type) AS IneffctvAmtInValnCrcy,
cast(PC_1306 as fti_imp_loss_allow_pc preserving type) AS LossAllowanceAmountInPosCrcy,
cast(VC_1306 as fti_imp_loss_allow_vc preserving type) AS LossAllowanceAmountInValnCrcy,
cast(PC_IDX_1306 as fti_imp_loss_allow_indx_pc preserving type) AS IdxCleanLossAllwncAmtInPosCrcy,
cast(VC_1307 as fti_imp_loss_allow_fx_vc preserving type) AS FXLossAllowanceAmtInValnCrcy,
cast(VC_1308 as fti_imp_offs_loss_allow_vc preserving type) AS OffsetLossAllwncAmtInValnCrcy,
cast(PC_1308 as fti_imp_offs_loss_allow_pc preserving type) AS OffstLossAllowanceAmtInPosCrcy,
cast(PC_IDX_1308 as fti_imp_offs_la_indx_pc preserving type) AS IdxCleanOffsetLossAllowanceAmt,
cast(VC_1309 as fti_imp_offs_loss_allow_fx_vc preserving type) AS FXOffstLossAllwncAmtInValnCrcy,
cast(VC_1312 as fti_imp_oci_offs_loss_allow_vc preserving type) AS OCIOffstLossAllwncInValnCrcy,
cast(PC_1312 as fti_imp_oci_offs_loss_allow_pc preserving type) AS OCIOffstLossAllwncAmtInPosCrcy,
cast(PC_IDX_1312 as fti_imp_oci_offs_la_idx_pc preserving type) AS IdxClnOCIOffstLossAllwncAmtIn,
cast(VC_1313 as fti_imp_oci_offs_la_fx_vc preserving type) AS FXOffstOCILossAllwncInValnCrcy,
cast(PC_1314 as fti_imp_amort_adj_la_pc preserving type) AS AmtznAdjmtLossAllwncInPosCrcy,
cast(VC_1314 as fti_imp_amort_adj_la_vc preserving type) AS AmtznAdjmtLossAllwncInValnCrcy,
cast(PC_IDX_1314 as fti_imp_amo_adj_la_indx_pc preserving type) AS IdxClnAmtznAdjLossAllInPosCrcy,
cast(VC_1315 as fti_imp_amort_adj_la_fx_vc preserving type) AS FXAmtznAdjLossAllwncInValnCrcy,
cast(PC_1310 as fti_imp_contract_change_pc preserving type) AS ContractChangeAmtInPosCrcy,
cast(VC_1310 as fti_imp_contract_change_vc preserving type) AS ContractChangeAmtInValnCrcy,
cast(VC_1311 as fti_imp_contract_change_fx_vc preserving type) AS FrgnExchContrChgAmtInValnCrcy,
cast(PC_1322 as ftr_gen_effctv_costhr_pc preserving type) AS EffctvCostHdggRsrvInPosCrcy,
cast(VC_1322 as ftr_gen_effctv_costhr_vc preserving type) AS EffctvCostHdggRsrvInValnCrcy,
cast(PC_1323 as ftr_gen_ineffctv_hr_tpl_pc preserving type) AS IneffctvHdggRsrvPnLInPosCrcy,
cast(VC_1323 as ftr_gen_ineffctv_hr_tpl_vc preserving type) AS IneffctvHdggRsrvPnLInValnCrcy,
cast(PC_1324 as ftr_gen_effctv_hr_tpl_pc preserving type) AS EffctvHdggRsrvPnLInPosCrcy,
cast(VC_1324 as ftr_gen_effctv_hr_tpl_vc preserving type) AS EffctvHdggRsrvPnLInValnCrcy,
cast(PC_1333 as ftr_gen_ineffctv_costhr_tpl_pc preserving type) AS IneffctvCostHdgRsrvPnLPosCrcy,
cast(VC_1333 as ftr_gen_ineffctv_costhr_tpl_vc preserving type) AS IneffctvCostHdgRsrvPnLValnCrcy,
cast(PC_1334 as ftr_gen_effctv_costhr_tpl_pc preserving type) AS EffctvCostHdgRsrvPnLInPosCrcy,
cast(VC_1334 as ftr_gen_effctv_costhr_tpl_vc preserving type) AS EffctvCostHdgRsrvPnLInValnCrcy,
cast(PC_1343 as ftr_gen_pnl_desig_pc preserving type) AS PnLDesignatedAmtInPosCrcy,
cast(VC_1343 as ftr_gen_pnl_desig_vc preserving type) AS PnLDesignatedAmtInVC,
cast(PC_1344 as ftr_gen_pnl_non_desig_pc preserving type) AS PnLNonDesignatedAmtInPosCrcy,
cast(PC_1344 as ftr_gen_pnl_non_desig_vc preserving type) AS PnLNonDesignatedAmtInVC,
cast(PC_1345 as ftr_gen_amort_non_desig_pc preserving type) AS AmtznNonDesignatedAmtInPosCrcy,
cast(PC_1345 as ftr_gen_amort_non_desig_vc preserving type) AS AmtznNonDesignatedAmtInVC,
cast(PC_IDX_1004 as ftr_gen_charge_indx_pc preserving type) AS IndexCleanCostInPositionCrcy,
cast(PC_IDX_1020 as ftr_gen_repayment_idx_clean preserving type) AS IndexCleanRpaytAmtInPosCrcy,
cast(PC_IDX_1028 as ftr_gen_int_income_indx_pc preserving type) AS IndexCleanInterestIncInPosCrcy,
cast(PC_IDX_1029 as ftr_gen_hamort_indx_pc preserving type) AS IdxCleanHedgeAmtznAmtInPosCrcy,
cast(PC_IDX_1310 as fti_imp_contrac_change_indx_pc preserving type) AS IdxClnContrChangeAmtInPosCrcy,
cast(PC_9001 as ftr_gen_book_val_pc preserving type) AS BookValueAmtInPositionCurrency,
cast(PC_9002 as ftr_gen_book_val_ex_pc preserving type) AS CostExcldBookValueAmtInPosCrcy,
cast(PC_9003 as ftr_gen_aqu_val_pc preserving type) AS AcquisitionAmtInPositionCrcy,
cast(PC_9004 as ftr_gen_amaqu_val_pc preserving type) AS AmortizedAcqnAmountInPosCrcy,
cast(PC_9005 as fti_amort_cost_pc preserving type) AS AmortizedCostInPositionCrcy,
cast(VC_9001 as ftr_gen_book_val_vc preserving type) AS BookValueAmountInValnCurrency,
cast(VC_9002 as ftr_gen_book_val_ex_vc preserving type) AS CostExcldBookValAmtInValnCrcy,
cast(VC_9003 as ftr_gen_aqu_val_vc preserving type) AS AcquisitionAmountInValnCrcy,
cast(VC_9004 as ftr_gen_amaqu_val_vc preserving type) AS AmortizedAcqnAmountInValnCrcy,
cast(VC_9005 as fti_amort_cost_vc preserving type) AS AmortizedCostInValuationCrcy
FROM P_TrsySmltPerEndClsPosValAccu
;