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_AccrualLineItem.
-- 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: PACELINEITM
CREATE VIEW P_AccrualLineItem 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(blart as fis_blart preserving type) AS AccountingDocumentType,
cast(usnam as fis_usnam preserving type) AS AccountingDocCreatedByUser,
cast(budat as fis_budat preserving type) AS PostingDate,
cast(hsl as fis_hsl preserving type) AS AmountInCompanyCodeCurrency,
cast(wsl as fis_wsl preserving type) AS AmountInTransactionCurrency,
bttype AS BusinessTransactionType,
cast(rhcur as fis_hwaer preserving type) AS CompanyCodeCurrency,
ksl AS AmountInGlobalCurrency,
rkcur AS GlobalCurrency,
osl AS AmountInFreeDefinedCurrency1,
rocur AS FreeDefinedCurrency1,
_CurrencyRoles.GlobalCurrencyRole AS GlobalCurrencyRole,
_CurrencyRoles.FreeDefinedCurrency1Role AS FreeDefinedCurrency1Role,
cast( _CurrencyRoles._GlobalCurrencyRole._Text[1: Language = $session.system_language].CurrencyRoleName as fis_gc_currole_name) AS GlobalCurrencyRoleName,
cast( _CurrencyRoles._FreeDefinedCurrency1Role._Text[1: Language = $session.system_language].CurrencyRoleName as fis_fdc1_currole_name ) AS FreeDefinedCurrency1RoleName,
cast( cast(substring( cast(timestamp as abap.char(30)) , 1 , 8) as abap.dats(8)) as fis_cpdat ) AS CreationDate,
cast(rwcur as fis_rwcur preserving type) AS TransactionCurrency,
bukrs_sender AS SenderCompanyCode,
cast(poper as fins_fiscalperiod preserving type) AS FiscalPeriod,
cast(bldat as fis_bldat preserving type) AS DocumentDate,
cast(bstat as fis_bstat preserving type) AS AccountingDocumentCategory,
cast(awtyp as fis_awtyp preserving type) AS ReferenceDocumentType,
awref AS ReferenceDocument,
xreversing AS IsReversal,
xreversed AS IsReversed,
awref_rev AS ReversalReferenceDocument,
cast( uspob as fis_uspob preserving type) AS OriginSenderObject,
acrobjtype AS AccrualObjectType,
acrlogsys AS AccrualObjectLogicalSystem,
cast(acrobj_id as fac_ace_postg_obj_id) AS AccrualObject,
cast(acrsobj_id as fac_ace_postg_ref_subkey) AS AccrualSubobject,
acritmtype AS AccrualItemType,
cast(racct as fis_racct preserving type) AS GLAccount,
cast(rcntr as fis_kostl preserving type) AS CostCenter,
cast(prctr as fis_prctr preserving type) AS ProfitCenter,
cast(bschl as fis_bschl preserving type) AS PostingKey,
slalittype AS SubLedgerAcctLineItemType,
awitgrp AS ReferenceDocumentItemGroup,
cast (_AccrSpcfcConfignSlalittype.FinancialAccrualTransacType as fac_ace_postg_ttype ) AS FinancialAccrualTransacType,
_AccrSpcfcConfignSlalittype.FinancialAccrTransacTypeName AS FinancialAccrTransacTypeName,
cast(_AccrSpcfcConfignSlalittype.GLAccountLineItemIsAccrual as fac_ace_xaccr_ref) AS GLAccountLineItemIsAccrual,
cast(fiscyearper as fis_jahrper_conv ) AS FiscalYearPeriod,
periv AS FiscalYearVariant,
rfarea AS FunctionalArea,
cast( timestamp as fis_chng_tstamp preserving type ) AS LastChangeDateTime,
cast( timestamp as fis_crea_tstamp preserving type ) AS CreationDateTime,
lokkt AS AlternativeGLAccount,
ktop2 AS CountryChartOfAccounts,
cast(ebeln as fis_ebeln) AS PurchasingDocument,
ebelp AS PurchasingDocumentItem,
cast (matnr as productnumber) AS Product,
werks AS Plant,
mwskz AS TaxCode,
xopvw AS IsOpenItemManaged,
augdt AS ClearingDate,
augbl AS ClearingAccountingDocument,
auggj AS ClearingDocFiscalYear,
zekkn AS AccountAssignmentNumber,
sgtxt AS DocumentItemText,
accas AS AccountAssignment,
accasty AS AccountAssignmentType,
kdauf AS SalesOrder,
kdpos AS SalesOrderItem,
cast(kdauf as vbeln_va preserving type) AS SalesDocument,
cast(kdpos as posnr_va preserving type) AS SalesDocumentItem,
hkgrp AS CostOriginGroup,
aufnr AS OrderID,
autyp AS OrderCategory,
cast( ps_psp_pnr as fis_wbsint_no_conv ) AS WBSElementInternalID,
cast( ps_pspid as fis_project ) AS Project,
cast( ps_prj_pnr as fis_projectint_no_conv ) AS ProjectInternalID,
cast( ps_posid as /cpd/plan_item_id ) AS WorkPackage,
nplnr AS ProjectNetwork,
nplnr_vorgn AS RelatedNetworkActivity,
service_doc_id AS ServiceDocument,
service_doc_type AS ServiceDocumentType,
prznr AS BusinessProcess,
kstrg AS CostObject,
acrvaldat AS AccrualValueDate,
kokrs AS ControllingArea,
cast(koart as farp_koart preserving type) AS FinancialAccountType,
cast(rbusa as fis_rbusa preserving type) AS BusinessArea,
Segment,
cast(lifnr as md_supplier preserving type) AS Supplier,
cast(kunnr as kunnr preserving type) AS Customer,
glaccount_type AS GLAccountType,
cast(gkont as fis_gkont preserving type) AS OffsettingAccount,
_CurrentProfitCenter.ProfitCtrResponsibleUser AS ProfitCtrResponsibleUser,
_GLAccountInCompanyCode.AuthorizationGroup AS GLAccountAuthorizationGroup,
_Supplier.AuthorizationGroup AS SupplierFinsAuthorizationGrp,
_Customer.AuthorizationGroup AS CustomerFinsAuthorizationGrp,
_Supplier._SupplierAccountGroup.SupplierAccountGroup AS SupplierAccountGroup,
_Customer.CustomerAccountGroup AS CustomerAccountGroup,
_AccountingDocumentType.AuthorizationGroup AS AcctgDocTypeAuthorizationGroup,
_LedgerText.LedgerName AS LedgerName
FROM acdoca
INNER JOIN finsc_ledger_rep ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN I_GLAccountInCompanyCode AS _GLAccountInCompanyCode ON CompanyCode = _GLAccountInCompanyCode.CompanyCode AND GLAccount = _GLAccountInCompanyCode.GLAccount -- association [0..1]
LEFT OUTER JOIN I_Supplier AS _Supplier ON Supplier = _Supplier.Supplier -- association [0..1]
LEFT OUTER JOIN I_Customer AS _Customer ON Customer = _Customer.Customer -- association [0..1]
LEFT OUTER JOIN I_AccountingDocumentType AS _AccountingDocumentType ON AccountingDocumentType = _AccountingDocumentType.AccountingDocumentType -- association [0..1]
LEFT OUTER JOIN P_AccrSpcfcConfignSlalittype AS _AccrSpcfcConfignSlalittype ON SubLedgerAcctLineItemType = _AccrSpcfcConfignSlalittype.SubLedgerAcctLineItemType -- association [0..1]
LEFT OUTER JOIN I_CurrentProfitCenter AS _CurrentProfitCenter ON ControllingArea = _CurrentProfitCenter.ControllingArea AND ProfitCenter = _CurrentProfitCenter.ProfitCenter -- association [0..1]
LEFT OUTER JOIN I_LedgerCompanyCodeCrcyRoles AS _CurrencyRoles ON CompanyCode = _CurrencyRoles.CompanyCode AND SourceLedger = _CurrencyRoles.Ledger -- association [0..1]
LEFT OUTER JOIN I_LedgerText AS _LedgerText ON _LedgerText.Ledger = SourceLedger AND _LedgerText.Language = $session.system_language -- association [0..1]
;