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_SettlmtMgmtDocItem.
-- 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_SettlmtMgmtDocItem AS
SELECT
wbrp.wbeln AS SettlmtMgmtDoc,
wbrp.posnr AS SettlmtMgmtDocItem,
cast( wbrp.matnr as productnumber preserving type ) AS Product,
cast( wbrp.matkl as productgroup preserving type ) AS ProductGroup,
wbrp.werks AS Plant,
wbrp.bwtar AS InventoryValuationType,
cast( wbrp.mwskz as wlf_mwskz_k preserving type ) AS SupplierTaxCode,
cast( wbrp.mwsk2 as wlf_mwskz_d preserving type ) AS CustomerTaxCode,
wbrp.tax_country AS TaxCountry,
wbrp.tax_country_ic AS IntercompanyTaxCountry,
wbrp.txdat_from_k AS SuplrSettlmtTxRateValdFrmDate,
wbrp.txdat_from_d AS CustSettlmtTxRateValdFrmDate,
cast( wbrp.txjcd as fis_txjcd preserving type ) AS TaxJurisdiction,
wbrp.txjcd_ic AS IntercompanyTaxJurisdiction,
wbrp.prsdt AS PricingDate,
wbrp.menge AS SettlmtQuantity,
wbrp.wfkme AS SettlmtQuantityUnit,
wbrp.netpr AS NetPriceAmount,
wbrp.peinh AS NetPriceQuantity,
wbrp.fprme AS NetPriceQuantityUnit,
cast( wbrp.umrez as wlf_umwfz preserving type ) AS SettlmtToBaseQuantityNmrtr,
cast( wbrp.umren as wlf_umwfn preserving type ) AS SettlmtToBaseQuantityDnmntr,
cast( wbrp.fpumz as wlf_wpumz preserving type ) AS SettlmtToNetPriceQtyNmrtr,
cast( wbrp.fpumn as wlf_wpumn preserving type ) AS SettlmtToNetPriceQtyDnmntr,
wbrp.meins AS BaseUnit,
wbrp.ntgew AS ItemNetWeight,
wbrp.brgew AS ItemGrossWeight,
wbrp.gewei AS ItemWeightUnit,
wbrp.volum AS ItemVolume,
wbrp.voleh AS ItemVolumeUnit,
wbrp.punei AS ProductPurchasePointsQtyUnit,
wbrp.anzpu AS ProductPurchasePointsQty,
cast( wbrp.brtwr as wlf_brtwr_lfp preserving type ) AS SupplierItemGrossAmount,
cast( wbrp.netwr as wlf_netwr_lfp preserving type ) AS SupplierItemNetAmount,
cast( wbrp.kzwi1 as wlf_suplr_kzwi1 preserving type ) AS SupplierSubtotal1Amount,
cast( wbrp.kzwi2 as wlf_suplr_kzwi2 preserving type ) AS SupplierSubtotal2Amount,
cast( wbrp.kzwi3 as wlf_suplr_kzwi3 preserving type ) AS SupplierSubtotal3Amount,
cast( wbrp.kzwi4 as wlf_suplr_kzwi4 preserving type ) AS SupplierSubtotal4Amount,
cast( wbrp.kzwi5 as wlf_suplr_kzwi5 preserving type ) AS SupplierSubtotal5Amount,
cast( wbrp.kzwi6 as wlf_suplr_kzwi6 preserving type ) AS SupplierSubtotal6Amount,
cast( wbrp.bonba as wlf_suplr_bonba preserving type ) AS SupplierRebateBasisAmount,
wbrp.effwr AS SupplierEffectiveItemAmount,
wbrp.skfbp AS SuplrItmEligibleAmtForCshDisc,
cast( wbrp.mwsbp as wlf_suplr_mwsbp preserving type ) AS SupplierItemTaxAmount,
cast( wbrp.brtwrd as wlf_brtwrd_lfp preserving type ) AS CustomerItemGrossAmount,
cast( wbrp.netwrd as wlf_netwrd_lfp preserving type ) AS CustomerItemNetAmount,
cast( wbrp.kzwi1d as wlf_cust_kzwi1 preserving type ) AS CustomerSubtotal1Amount,
cast( wbrp.kzwi2d as wlf_cust_kzwi2 preserving type ) AS CustomerSubtotal2Amount,
cast( wbrp.kzwi3d as wlf_cust_kzwi3 preserving type ) AS CustomerSubtotal3Amount,
cast( wbrp.kzwi4d as wlf_cust_kzwi4 preserving type ) AS CustomerSubtotal4Amount,
cast( wbrp.kzwi5d as wlf_cust_kzwi5 preserving type ) AS CustomerSubtotal5Amount,
cast( wbrp.kzwi6d as wlf_cust_kzwi6 preserving type ) AS CustomerSubtotal6Amount,
cast( wbrp.bonbad as wlf_cust_bonba preserving type ) AS CustomerRebateBasisAmount,
wbrp.effwrd AS CustomerEffectiveItemAmount,
wbrp.skfbpd AS CustItmEligibleAmtForCshDisc,
cast( wbrp.mwsbpd as wlf_cust_mwsbp preserving type ) AS CustomerItemTaxAmount,
wbrp.navnw AS NonDeductibleInputTaxAmount,
cast( wbrp.kowrr as wlf_wkowrr preserving type ) AS SettlmtItmStatisticalPrpty,
wbrp.sktof AS CashDiscountIsDeductible,
cast( wbrp.ernam as wlf_created_by preserving type ) AS CreatedByUser,
cast( wbrp.erdat as wlf_created_on preserving type ) AS CreationDate,
cast( wbrp.erzet as wlf_created_at preserving type ) AS CreationTime,
cast( wbrp.gjahrv as fis_gjahr_no_conv preserving type ) AS SettlmtRefDocReltdFiscalYear,
wbrp.wbelnv AS SettlmtSourceDoc,
cast( wbrp.posnrv as wlf_settlmt_source_doc_item preserving type ) AS SettlmtSourceDocItem,
wbrp.lftypv AS SettlmtSourceDocCat,
wbrp.lfgru AS SettlmtItemActivityReason,
wbrp.arktx AS SettlmtMgmtDocItemText,
wbrp.idnlf AS SupplierProductID,
wbrp.bupla AS BusinessPlace,
wbrp.bupla_ic AS IntercompanyBusinessPlace,
wbrp.kolif AS PriorSupplier,
cast( wbrp.gsber as fis_rbusa preserving type ) AS SuplrSettlmtBusinessArea,
cast( wbrp.kokrs as fis_kokrs preserving type ) AS SuplrSettlmtControllingArea,
cast( wbrp.kostl as fis_kostl preserving type ) AS SuplrSettlmtCostCenter,
cast( wbrp.prctr as fis_prctr preserving type ) AS SuplrSettlmtProfitCenter,
cast( wbrp.ps_psp_pnr as wlf_psp_pnr_no_cnext preserving type ) AS SuplrSettlmtWBSElmntInternalID,
wbrp.gsberd AS CustSettlmtBusinessArea,
wbrp.kokrsd AS CustSettlmtControllingArea,
wbrp.kostld AS CustSettlmtCostCenter,
wbrp.prctrd AS CustSettlmtProfitCenter,
cast( wbrp.ps_psp_pnrd as wlf_ps_psp_pnr_cust_no_cnext preserving type ) AS CustSettlmtWBSElmntInternalID,
wbrp.incov_p AS IncotermsVersion,
wbrp.inco1_p AS IncotermsClassification,
wbrp.inco2_p AS IncotermsTransferLocation,
wbrp.inco2_l_p AS IncotermsLocation1,
wbrp.inco3_l_p AS IncotermsLocation2,
wbrp.charg AS Batch,
cast( wbrp.wuvprs as wlf_suplr_wuvprs preserving type ) AS SupplierPrcDetnIsIncmplt,
cast( wbrp.wuvprs as wlf_cust_wuvprs preserving type ) AS CustomerPrcDetnIsIncmplt,
wbrp.wbeln_v AS SettlmtPrecdgDoc,
cast( wbrp.posnr_v as wlf_settlmt_precdg_doc_item preserving type ) AS SettlmtPrecdgDocItem,
wbrp.ftypv_v AS SettlmtPrecdgDocCat,
wbrp.itemcat AS SettlmtMgmtDocItemCat,
cast( concat(wbrp.wbeln, wbrp.posnr) as wlf_smt_item_text_key preserving type ) AS SettlmtMgmtDocItemTextKey,
cast( wbrp.contract_type as wlf_settlmt_itm_rel_refdoc_cat preserving type ) AS SettlmtItemReltdRefDocCat,
cast( wbrp.contract as wlf_settlmt_itm_rel_refdoc preserving type ) AS SettlmtItemReltdRefDoc,
cast( wbrp.contract_item as wlf_settlmt_itm_rel_refdoc_itm preserving type ) AS SettlmtItemReltdRefDocItem,
wbrp.item_status AS SettlmtMgmtDocItemStatus,
wbrp.item_canceled AS SettlmtMgmtDocItemCancld,
cast( wbrp.aufnr as wlf_suplr_aufnr preserving type ) AS SupplierSettlementOrder,
wbrp.aufnrd AS CustomerSettlementOrder,
wbrp.settl_status_i_v AS SupplierItemSettlmtStatus,
wbrp.settl_status_i_c AS CustomerItemSettlmtStatus,
wbrp.settl_block_i_v AS SupplierItemSettlmtBlkgReason,
wbrp.settl_block_i_c AS CustomerItemSettlmtBlkgReason,
wbrp.settl_item_rel AS ItemSettlmtRelevance,
wbrp.fbuda AS ServicesRenderedDate,
cast( wbrp.sakto as fis_racct preserving type ) AS GLAccount,
cast( wbrp.gjahr as wb2_ccs_gjahr_no_cnext preserving type ) AS SettlementFiscalYear,
cast( wbrp.posnr_main as uepos preserving type ) AS HigherLevelItem,
wbrp.posnr_sub_exist AS LowerLevelItemExists,
wbrp.distrib_status AS ItemDistributionStatus,
wbrp.ref_doc_type_1 AS SettlmtRefDocType,
cast( wbrp.ref_doc_nr_1 as wlf_ref_doc_number_1 preserving type ) AS SettlmtRefDoc,
cast( wbrp.ref_doc_year_1 as wlf_ref_doc_year_no_cnext preserving type ) AS SettlmtRefDocFiscalYear,
cast( wbrp.ref_log_sys_1 as wlf_ref_log_sys_1 preserving type ) AS SettlmtRefDocLogicalSyst,
cast( wbrp.ref_company_code_1 as wlf_ref_company_code_1 preserving type ) AS SettlmtRefDocCompanyCode,
cast( wbrp.ref_item_number as wlf_ref_item_number_1 preserving type ) AS SettlmtRefDocItem,
cast( wbrp.ref_type as wlf_ref_type_1 preserving type ) AS SettlmtRefDocCat,
wbrp.ref_doc_type_2 AS SettlmtAddlRefDocType,
cast( wbrp.ref_doc_nr_2 as wlf_ref_doc_number_2n preserving type ) AS SettlmtAddlRefDoc,
cast( wbrp.ref_doc_year_2 as wlf_ref_doc_year_2_no_cnext preserving type ) AS SettlmtAddlRefDocFiscalYear,
cast( wbrp.ref_log_sys_2 as wlf_ref_log_sys_2n preserving type ) AS SettlmtAddlRefDocLogicalSyst,
cast( wbrp.ref_item_num_2 as wlf_ref_item_number_2n preserving type ) AS SettlmtAddlRefDocItem,
cast( wbrp.ref_type_2 as wlf_ref_type_2n preserving type ) AS SettlmtAddlRefDocCat,
wbrp.contr_type_i AS CndnContrType,
wbrp.process_variant_i AS CndnContrProcVar,
wbrp.settl_date_type_i AS SettlmtDateCat,
wbrp.settl_date_i AS SettlmtDate,
wbrp.settl_date_seq_id_i AS SettlmtDateSequentialID,
wbrp.act_settl_date_i AS ActualSettlmtDate,
wbrp.settl_start_date_i AS SettlmtPeriodStartDate,
cast( wbrp.act_settl_date_i as wb2_settlement_end_date preserving type ) AS SettlmtPeriodEndDate,
wbrp.ref_settl_date_i AS RefSettlmtDate,
cast( wbrp.item_intra_rel as wlf_itm_intrastat_relevant_cat preserving type ) AS ItemIntrastatRelevance,
wbrp.coll_status_i AS SettlmtMgmtDocItemCollSts,
wbrp.coll_block_i AS CollSettlmtItemBlkgReason,
wbrp.coll_rel AS ItmSettlmtDocCollRelevance,
cast( wbrp.customer as wlf_cust_settlmt_recpnt preserving type ) AS CustomerSettlmtRecipient,
wbrp.ltsnr AS SupplierSubrange,
wbrp.prodh AS ProductHierarchy,
cast( wbrp.mvgr1 as wlf_salesspcfcproductgroup1 preserving type ) AS SalesSpcfcProductGroup1,
cast( wbrp.mvgr2 as wlf_salesspcfcproductgroup2 preserving type ) AS SalesSpcfcProductGroup2,
cast( wbrp.mvgr3 as wlf_salesspcfcproductgroup3 preserving type ) AS SalesSpcfcProductGroup3,
cast( wbrp.mvgr4 as wlf_salesspcfcproductgroup4 preserving type ) AS SalesSpcfcProductGroup4,
cast( wbrp.mvgr5 as wlf_salesspcfcproductgroup5 preserving type ) AS SalesSpcfcProductGroup5,
wbrp.vkorg_i AS SettlmtItemSalesOrganization,
wbrp.vtweg_i AS SettlmtItemDistributionChannel,
wbrp.spart_i AS SettlmtItemDivision,
wbrp.provg AS ProductCommissionGroup,
cast( wbrp.kondm as pricespecificationproductgroup preserving type ) AS PriceSpecificationProductGroup,
wbrp.rebate_grp AS SalesVolumeRebateGroup,
wbrp.reference_id AS BusTransDocReferenceID,
wbrp.ref_item_id AS BusTransDocReferenceItemID,
wbrp.no_text_i AS SettlmtMgmtDocItemHasNoTexts,
wbrp.mwskz_bv AS BusinessVolumeTaxCode,
wbrp.waers_bv AS BusinessVolumeCurrency,
wbrp.txdat_from_bv AS BusVolTxRateValdFrmDate,
wbrp.kschl_settlement AS SettlementConditionType,
wbrp.dispute_case AS DisputeCaseUUID,
wbrp.weight_volume AS SettlmtItmWgtVolLvlCat,
wbrp.j_1tpbupl AS BranchCode,
wbrp.j_1tpbupl_d AS IntercompanyBranchCode,
wbrp.prodh_univ_sales_parnt_nodid AS SlsProdHierarchyParentNodeID,
cast( wbrp.entity_tag_item as wlf_change_state_item ) AS SettlmtMgmtDocItemChangeState
FROM wbrp
;