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_SettlmtMgmtDoc.
-- 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 P_SettlmtMgmtDoc AS
SELECT
wbrk.wbeln AS SettlmtMgmtDoc,
cast( wbrk.lfart as wlf_settlmt_doc_type preserving type ) AS SettlmtDocType,
cast( wbrk.lftyp as wlf_settlmt_doc_cat preserving type ) AS SettlmtDocCat,
cast( wbrk.wrart as wlf_settlmt_process_type preserving type ) AS SettlmtProcessType,
cast( wbrk.wbtyp as wlf_settlmt_process_cat preserving type ) AS SettlmtProcessCat,
wbrk.wrtyp AS LogisticsDataEntryCat,
wbrk.abart AS SettlmtCat,
wbrk.wdtyp AS SettlmtMgmtDocCat,
wbrk.wfdat AS PostingDate,
wbrk.rfbsk AS SettlmtMgmtAcctgTransfSts,
wbrk.bldat AS DocumentDate,
wbrk.xblnr AS DocumentReferenceID,
wbrk.zuonr AS AssignmentReference,
wbrk.estatus AS SettlmtApplSts,
wbrk.status_group AS SettlmtApplStsGrp,
cast( wbrk.kalsm as wlf_suplr_kalsm_d preserving type ) AS SupplierPricingProcedure,
cast( wbrk.kalsmd as wlf_cust_kalsm_d preserving type ) AS CustomerPricingProcedure,
cast( wbrk.knumv as wlf_knumv_k preserving type ) AS SupplierPricingDocument,
cast( wbrk.knumvd as wlf_knumv_d preserving type ) AS CustomerPricingDocument,
wbrk.lifre AS InvoicingParty,
wbrk.lnrzb AS PayeeParty,
wbrk.lifnr_fi AS AlternativeInvoicingParty,
wbrk.kunre AS BillToParty,
wbrk.kunrg AS PayerParty,
cast( wbrk.bukrs as wlf_suplr_bukrs preserving type ) AS CompanyCode,
cast( wbrk.bukrs_deb as wlf_bukrs_customer_regu preserving type ) AS IntercompanyCompanyCode,
case wbrk.bukrs_deb when '' then wbrk.bukrs else wbrk.bukrs_deb end as CustSettlmtCompanyCode AS bukrs_debendasCustSettlmtCompanyCode,
wbrk.ekorg AS PurchasingOrganization,
wbrk.ekgrp AS PurchasingGroup,
wbrk.vkorg AS SalesOrganization,
wbrk.vtweg AS DistributionChannel,
wbrk.spart AS Division,
wbrk.vkbur AS SalesOffice,
wbrk.vkgrp AS SalesGroup,
cast( wbrk.ernam as wlf_created_by preserving type ) AS CreatedByUser,
cast( wbrk.erdat as wlf_created_on preserving type ) AS CreationDate,
cast( wbrk.erzet as wlf_created_at preserving type ) AS CreationTime,
cast( wbrk.aedat as wlf_changed_on preserving type ) AS LastChangeDate,
wbrk.waerl AS SettlmtDocCurrency,
cast( wbrk.wkurs as wlf_ukurs_curr_no_cnext preserving type ) AS ExchangeRate,
wbrk.kurst AS ExchangeRateType,
wbrk.kufix AS ExchangeRateIsFixed,
cast( wbrk.wkurs_dat as vdm_v_exchange_rate_date preserving type ) AS ExchangeRateDate,
cast( wbrk.brtwr as wlf_brtwrk_lf preserving type ) AS SupplierTotalGrossAmount,
cast( wbrk.netwr as wlf_netwrk_lf preserving type ) AS SupplierTotalNetAmount,
cast( wbrk.mwsbk as wlf_suplr_mwsbk preserving type ) AS SupplierTotalTaxAmount,
cast( wbrk.brtwrd as wlf_brtwrd_lf preserving type ) AS CustomerTotalGrossAmount,
cast( wbrk.netwrd as wlf_netwrd_lf preserving type ) AS CustomerTotalNetAmount,
cast( wbrk.mwsbkd as wlf_cust_mwsbk preserving type ) AS CustomerTotalTaxAmount,
cast( wbrk.zterm as farp_dzterm preserving type ) AS SupplierPaymentTerms,
cast( wbrk.zbd1t as farp_dzbd1t preserving type ) AS SupplierCashDiscount1Days,
cast( wbrk.zbd2t as farp_dzbd2t preserving type ) AS SupplierCashDiscount2Days,
cast( wbrk.zbd3t as farp_dzbd3t preserving type ) AS SupplierNetPaymentDays,
cast( wbrk.zbd1p as dzbd1p_farp preserving type ) AS SupplierCashDiscount1Percent,
cast( wbrk.zbd2p as dzbd2p_farp preserving type ) AS SupplierCashDiscount2Percent,
cast( wbrk.zlsch as farp_schzw_bseg preserving type ) AS SupplierPaymentMethod,
wbrk.ztermd AS CustomerPaymentTerms,
cast( wbrk.zbd1td as wlf_cust_dzbd1t preserving type ) AS CustomerCashDiscount1Days,
cast( wbrk.zbd2td as wlf_cust_dzbd2t preserving type ) AS CustomerCashDiscount2Days,
cast( wbrk.zbd3td as wlf_cust_dzbd3t preserving type ) AS CustomerNetPaymentDays,
cast( wbrk.zbd1pd as wlf_cust_dzbd1p preserving type ) AS CustomerCashDiscount1Percent,
cast( wbrk.zbd2pd as wlf_cust_dzbd2p preserving type ) AS CustomerCashDiscount2Percent,
wbrk.zlschd AS CustomerPaymentMethod,
cast( wbrk.gskto as wlf_suplr_skfbp preserving type ) AS SuplrTotEligibleAmtForCshDisc,
cast( wbrk.gsktod as wlf_cust_skfbp preserving type ) AS CustTotEligibleAmtForCshDisc,
cast( wbrk.fksto as wlf_fksto preserving type ) AS SettlmtMgmtDocIsCancelled,
wbrk.lfaks AS CancelledSettlmtMgmtDoc,
wbrk.fksto_part AS SettlmtMgmtDocIsPrtlyRvsd,
cast ( wbrk.fksto_party as wlf_partner_reversal_cat preserving type ) AS SettlmtMgmtDocPartRvslCat,
cast( wbrk.valtg as wlf_wvaltk preserving type ) AS SupplierAdditionalValueDays,
cast( wbrk.valdt as wlf_wvaldk preserving type ) AS SupplierFixedValueDate,
cast( wbrk.valtgd as wlf_wvaltd preserving type ) AS CustomerAdditionalValueDays,
cast( wbrk.valdtd as wlf_wvaldd preserving type ) AS CustomerFixedValueDate,
cast( wbrk.txkrs as wlf_txkrs_no_cnext preserving type ) AS TaxExchangeRate,
cast( wbrk.txkrs_ic as wlf_txkrs_ic_no_cnext preserving type ) AS IntercompanyTaxExchangeRate,
cast( wbrk.landl as fac_landl preserving type ) AS SupplyingCountry,
wbrk.landtx AS TaxDepartureCountry,
wbrk.land1tx AS TaxDestinationCountry,
wbrk.xegdr AS IsEUTriangularDeal,
wbrk.landtx_bukrs AS SettlmtCoCodeTaxCountry,
wbrk.landtx_bukrs_deb AS SettlmtIntcoCoCodeTaxCountry,
cast( wbrk.stceg as wlf_suplr_stceg preserving type ) AS SupplierVATRegistration,
cast( wbrk.stcegd as wlf_cust_stceg preserving type ) AS CustomerVATRegistration,
wbrk.lzbkz AS StateCentralBankPaymentReason,
cast( wbrk.kkber as farp_kkber preserving type ) AS CreditControlArea,
cast( wbrk.cmwae as wlf_creditcontrolareacurrency preserving type ) AS CreditControlAreaCurrency,
wbrk.cm_amount AS ReleasedCreditAmount,
cast( wbrk.lfgru as wlf_wfgru_header preserving type ) AS SettlmtDocActivityReason,
cast( wbrk.kidno as farp_kidno preserving type ) AS PaymentReference,
wbrk.wpycur_p1 AS SupplierPaymentCurrency,
cast( wbrk.wkurs_p1 as wlf_wkurs_p1_no_cnext preserving type ) AS SupplierPaytCurrencyExchRate,
wbrk.wpycur_p2 AS CustomerPaymentCurrency,
cast( wbrk.wkurs_p2 as wlf_wkurs_p2_no_cnext preserving type ) AS CustomerPaytCurrencyExchRate,
wbrk.cpdk_addr AS OneTimeCustomerAddressID,
wbrk.cpdl_addr AS OneTimeSupplierAddressID,
wbrk.contract_type AS SettlmtReltdRefDocCat,
wbrk.contract AS SettlmtReltdRefDoc,
wbrk.contr_type AS CndnContrType,
wbrk.collection_type AS SettlmtDocSmmrznCat,
wbrk.coll_status AS SettlmtMgmtDocCollSts,
wbrk.is_collection AS SettlmtMgmtDocIsCollvDoc,
wbrk.coll_block AS CollSettlmtBlkgReason,
wbrk.settle_category AS SettlmtClassificationCat,
wbrk.settl_party AS SettlmtPartnerCat,
wbrk.settl_status_v AS SupplierSettlmtStatus,
wbrk.settl_status_c AS CustomerSettlmtStatus,
wbrk.settl_doctype_v AS SupplierSettlmtDocCat,
wbrk.settl_doctype_c AS CustomerSettlmtDocCat,
wbrk.settl_block_v AS SupplierSettlmtBlkgReason,
wbrk.settl_block_c AS CustomerSettlmtBlkgReason,
cast( cast( concat( '0', wbrk.monat) as abap.numc( 3 ) ) as fins_fiscalperiod preserving type ) AS FiscalPeriod,
wbrk.settle_doc AS TrdgExpnSettlmtDoc,
wbrk.doc_settled AS TrdgExpnDocSettled,
wbrk.ref_value_ref AS TrdgExpnCurrency,
wbrk.ref_value AS TrdgExpnAmount,
wbrk.settl_date_type AS SettlmtDateCat,
wbrk.act_settl_date AS ActualSettlmtDate,
wbrk.settl_date_seq_id AS SettlmtDateSequentialID,
wbrk.settlement_date AS SettlmtDate,
cast( wbrk.ref_settl_date as wb2_ref_settlement_date preserving type ) AS RefSettlmtDate,
wbrk.incomp_reason AS SettlmtMgmtDocIncmpltnsRsn,
wbrk.rfbsk_comb_sett AS CombinedSettlmtPostgSts,
wbrk.intrastat_rel AS DocIntrastatRelevance,
wbrk.intrastat_flow_d AS IntrastatDeclnGdsFlwCat,
wbrk.incov AS IncotermsVersion,
wbrk.inco1 AS IncotermsClassification,
wbrk.inco2 AS IncotermsTransferLocation,
wbrk.inco2_l AS IncotermsLocation1,
wbrk.inco3_l AS IncotermsLocation2,
wbrk.process_type AS SettlmtBusProcVar,
wbrk.use_case AS SettlmtBusProcCat,
wbrk.mndid AS SEPAMandate,
wbrk.total_menge AS TotalSettlmtQuantity,
wbrk.total_wfkme AS TotalSettlmtQuantityUnit,
wbrk.total_ntgew AS TotalSettlmtNetWeight,
wbrk.total_brgew AS TotalSettlmtGrossWeight,
wbrk.total_gewei AS TotalSettlmtWeightUnit,
wbrk.total_volum AS TotalSettlmtVolume,
wbrk.total_voleh AS TotalSettlmtVolumeUnit,
wbrk.total_anzpu AS TotalSettlmtPointsQty,
wbrk.total_punei AS TotalSettlmtPointsQtyUnit,
wbrk.pernr AS PersonWorkAgreement,
wbrk.pers_kostl AS PersonnelCostCenter,
wbrk.pers_kokrs AS PersonnelControllingArea,
wbrk.post_party AS PostingPartnerCat,
wbrk.settl_start_date AS SettlmtPeriodStartDate,
cast( wbrk.act_settl_date as wb2_settlement_end_date preserving type ) AS SettlmtPeriodEndDate,
wbrk.process_variant AS CndnContrProcVar,
wbrk.process_category AS CndnContrProcessCategory,
wbrk.jrnl_entr_crtn_dte_utc AS JournalEntryCreationDate,
wbrk.jrnl_entr_crtn_tme_utc AS JournalEntryCreationTime,
wbrk.settlmt_compn_rsn AS SettlmtCompensationReason,
wbrk.kappl AS ConditionApplication,
wbrk.deviating_settl_item AS SettlmtHasDvtgCndnContrData,
wbrk.no_text_h AS SettlmtMgmtDocHasNoTexts,
cast( wbrk.output_control_is_active as wlf_settlmt_mgmt_outp_cat preserving type ) AS SettlmtMgmtOutpCat,
wbrk.compn_variant AS SettlmtCompnVar,
wbrk.rrlcg AS SettlmtDocListType,
cast( wbrk.vkont as vkont_gfn_kk preserving type ) AS ContractAccount,
wbrk.visibility_group AS ApplElmntBehaviorGrp,
wbrk.authorization_category AS SettlmtMgmtAuthznCat,
cast( wbrk.corr_document as wlf_settlmt_mgmt_adjmt_cat preserving type ) AS SettlmtMgmtAdjmtCat,
cast( wbrk.entity_tag as wlf_change_state ) AS SettlmtMgmtDocChangeState
FROM wbrk
;