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_AnalyzeAccrualPosting.
-- 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_AnalyzeAccrualPosting AS
SELECT
cast(acdoca.rldnr as fins_ledger_pers preserving type) AS SourceLedger,
cast(acdoca.rbukrs as fis_bukrs preserving type) AS CompanyCode,
cast(acdoca.gjahr as fis_gjahr preserving type) AS FiscalYear,
cast(acdoca.belnr as fis_belnr preserving type) AS AccountingDocument,
cast(acdoca.docln as fis_docln preserving type) AS LedgerGLLineItem,
cast(finsc_ledger_rep.rldnr as fis_rldnr preserving type) AS Ledger,
cast(acdoca.blart as fis_blart preserving type) AS AccountingDocumentType,
cast(acdoca.usnam as fis_usnam preserving type) AS AccountingDocCreatedByUser,
cast(acdoca.hsl as fis_hsl preserving type) AS AmountInCompanyCodeCurrency,
cast(acdoca.wsl as fis_wsl preserving type) AS AmountInTransactionCurrency,
acdoca.bttype AS BusinessTransactionType,
cast(acdoca.rhcur as fis_hwaer preserving type) AS CompanyCodeCurrency,
acdoca.ksl AS AmountInGlobalCurrency,
acdoca.rkcur AS GlobalCurrency,
acdoca.osl AS AmountInFreeDefinedCurrency1,
acdoca.rocur AS FreeDefinedCurrency1,
cast(acdoca.rwcur as fis_rwcur preserving type) AS TransactionCurrency,
acdoca.bukrs_sender AS SenderCompanyCode,
cast(acdoca.poper as fins_fiscalperiod preserving type) AS FiscalPeriod,
cast(acdoca.bldat as fis_bldat preserving type) AS DocumentDate,
cast(acdoca.bstat as fis_bstat preserving type) AS AccountingDocumentCategory,
cast(acdoca.awtyp as fis_awtyp preserving type) AS ReferenceDocumentType,
acdoca.awref AS ReferenceDocument,
acdoca.xreversing AS IsReversal,
acdoca.xreversed AS IsReversed,
acdoca.awref_rev AS ReversalReferenceDocument,
cast( acdoca.uspob as fis_uspob preserving type) AS OriginSenderObject,
acdoca.acrobjtype AS AccrualObjectType,
acdoca.acrlogsys AS AccrualObjectLogicalSystem,
cast(acdoca.acrobj_id as fac_ace_postg_obj_id) AS AccrualObject,
cast(acdoca.acrsobj_id as fac_ace_postg_ref_subkey) AS AccrualSubobject,
acdoca.acritmtype AS AccrualItemType,
cast(acdoca.racct as fis_racct preserving type) AS GLAccount,
cast(acdoca.rcntr as fis_kostl) AS CostCenter,
cast(acdoca.prctr as fis_prctr preserving type) AS ProfitCenter,
cast(acdoca.bschl as fis_bschl preserving type) AS PostingKey,
acdoca.slalittype AS SubLedgerAcctLineItemType,
acdoca.awitgrp AS ReferenceDocumentItemGroup,
cast(acdoca.fiscyearper as fis_jahrper_conv ) AS FiscalYearPeriod,
acdoca.periv AS FiscalYearVariant,
acdoca.rfarea AS FunctionalArea,
cast( acdoca.timestamp as fis_chng_tstamp preserving type ) AS LastChangeDateTime,
cast( acdoca.timestamp as fis_crea_tstamp preserving type ) AS CreationDateTime,
cast( cast(substring( cast(acdoca.timestamp as abap.char(30)) , 1 , 8) as abap.dats(8)) as fis_cpdat ) AS CreationDate,
acdoca.lokkt AS AlternativeGLAccount,
acdoca.ktop2 AS CountryChartOfAccounts,
cast(acdoca.ebeln as fis_ebeln) AS PurchasingDocument,
acdoca.ebelp AS PurchasingDocumentItem,
cast (acdoca.matnr as productnumber) AS Product,
acdoca.werks AS Plant,
acdoca.mwskz AS TaxCode,
acdoca.xopvw AS IsOpenItemManaged,
acdoca.augdt AS ClearingDate,
acdoca.augbl AS ClearingAccountingDocument,
acdoca.auggj AS ClearingDocFiscalYear,
acdoca.zekkn AS AccountAssignmentNumber,
acdoca.sgtxt AS DocumentItemText,
acdoca.accas AS AccountAssignment,
acdoca.accasty AS AccountAssignmentType,
acdoca.kdauf AS SalesOrder,
acdoca.kdpos AS SalesOrderItem,
acdoca.hkgrp AS CostOriginGroup,
acdoca.aufnr AS OrderID,
acdoca.autyp AS OrderCategory,
cast( acdoca.ps_pspid as fis_project ) AS Project,
cast( acdoca.ps_prj_pnr as fis_projectint_no_conv ) AS ProjectInternalID,
cast( acdoca.ps_posid as /cpd/plan_item_id ) AS WorkPackage,
acdoca.nplnr AS ProjectNetwork,
acdoca.nplnr_vorgn AS RelatedNetworkActivity,
acdoca.service_doc_id AS ServiceDocument,
acdoca.service_doc_type AS ServiceDocumentType,
acdoca.prznr AS BusinessProcess,
acdoca.kstrg AS CostObject,
acdoca.acrvaldat AS AccrualValueDate,
acdoca.kokrs AS ControllingArea,
cast(acdoca.zuonr as fis_zuonr) AS AssignmentReference,
cast(acdoca.koart as farp_koart preserving type) AS FinancialAccountType,
cast(acdoca.rbusa as fis_rbusa preserving type) AS BusinessArea,
acdoca.segment AS Segment,
cast(acdoca.lifnr as md_supplier preserving type) AS Supplier,
cast(acdoca.kunnr as kunnr preserving type) AS Customer,
acdoca.glaccount_type AS GLAccountType,
cast(acdoca.gkont as fis_gkont preserving type) AS OffsettingAccount,
acdoca.ktopl AS ChartOfAccounts,
acdoca.docnr_ld AS JrnlEntrShiftedFYConsecutiveID,
cast (_AccrSpcfcConfignSlalittype.FinancialAccrualTransacType as fac_ace_postg_ttype ) AS FinancialAccrualTransacType,
acdoca.rmvct AS FinancialTransactionType,
_FinancialTransactionType._Text[1: Language = $session.system_language].FinancialTransactionTypeName AS FinancialTransactionTypeName,
_AccrSpcfcConfignSlalittype.FinancialAccrTransacTypeName AS FinancialAccrTransacTypeName,
cast(_AccrSpcfcConfignSlalittype.GLAccountLineItemIsAccrual as fac_ace_xaccr_ref) AS GLAccountLineItemIsAccrual
FROM acdoca
INNER JOIN finsc_ledger_rep ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN P_AccrSpcfcConfignSlalittype AS _AccrSpcfcConfignSlalittype ON SubLedgerAcctLineItemType = _AccrSpcfcConfignSlalittype.SubLedgerAcctLineItemType -- association [0..1]
LEFT OUTER JOIN I_FinancialTransactionType AS _FinancialTransactionType ON FinancialTransactionType = _FinancialTransactionType.FinancialTransactionType -- association [0..1]
;