P_CN_CustomerLineItem

DDL: P_CN_CUSTOMERLINEITEM SQL: PCNCUSTLINEITEM Type: view COMPOSITE Package: GLO_FIN_CN_BAL

Customer Line Item with Account Balance

P_CN_CustomerLineItem is a Composite CDS View that provides data about "Customer Line Item with Account Balance" in SAP S/4HANA. It reads from 2 data sources (P_CN_CustAcctBal, P_CN_CustLineItemRaw) and exposes 68 fields with key fields CompanyCode, FiscalYear, AccountingDocument, LedgerGLLineItem. It has 4 associations to related views. Part of development package GLO_FIN_CN_BAL.

Data Sources (2)

SourceAliasJoin Type
P_CN_CustAcctBal P_CN_CustAcctBal inner
P_CN_CustLineItemRaw P_CN_CustLineItemRaw from

Parameters (6)

NameTypeDefault
P_CompanyCode bukrs
P_FiscalYear gjahr
P_CurrencyRole fac_crcyrole
P_ReportingFiscalPeriod fins_fiscalperiod
P_CategoryFlag wrf_catflag
P_DimensionKey dimid

Associations (4)

CardinalityTargetAliasCondition
[1..1] C_CN_FsclPerdVH _FiscalPeriodValueHelp $projection.CompanyCode = _FiscalPeriodValueHelp.CompanyCode and $projection.FiscalYear = _FiscalPeriodValueHelp.FiscalYear and $projection.FiscalPeriod = _FiscalPeriodValueHelp.FiscalPeriod
[0..*] C_CN_CrcyVH _CurrencyValueHelp $projection.CompanyCode = _CurrencyValueHelp.CompanyCode
[1..1] I_Customer _Customer $projection.Customer = _Customer.Customer
[0..1] I_GlAccountTextInCompanycode _GLAccountText $projection.CompanyCode = _GLAccountText.CompanyCode and $projection.GLAccount = _GLAccountText.GLAccount and _GLAccountText.Language = $session.system_language

Annotations (7)

NameValueLevelField
AbapCatalog.sqlViewName PCNCUSTLINEITEM view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
AccessControl.authorizationCheck #CHECK view
VDM.private true view
VDM.viewType #COMPOSITE view
ClientHandling.algorithm #SESSION_VARIABLE view

Fields (68)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode balance CompanyCode Receiver Company Code
KEY FiscalYear balance FiscalYear G/L Fiscal Year
KEY AccountingDocument lineitem AccountingDocument Journal Entry
KEY LedgerGLLineItem
FiscalPeriod balance FiscalPeriod Tax period
AlternativeGLAccount balance AlternativeGLAccount Group Account
AlternativeGLAccountName _AlternativeText GLAccountName Short Text
CustBalAltvGLAccountInfo balance CustBalAltvGLAccountInfo
GLAccount lineitem GLAccount General Ledger
Supplier lineitem Supplier Supplier
FinancialAccountType lineitem FinancialAccountType Fin. Account Type
Customer
SpecialGLCode lineitem SpecialGLCode Special G/L Ind
ProfitCenter lineitem ProfitCenter Profit Center
Segment lineitem Segment Segment number
BusinessArea lineitem BusinessArea Business Area
AssignmentReference lineitem AssignmentReference Assignment Reference
PostingDate lineitem PostingDate Posting Date for GR
IsCleared lineitem IsCleared Integer
DebitCreditCode lineitem DebitCreditCode Single-Character Flag
SalesOrganization lineitem SalesOrganization Sales Organization
DistributionChannel lineitem DistributionChannel RefDistCh-Cust/Mat.
OrganizationDivision lineitem OrganizationDivision Org. Division
PartnerProfitCenter lineitem PartnerProfitCenter Profit Center
AccountingDocumentType lineitem AccountingDocumentType Journal Entry Type
DocumentDate lineitem DocumentDate Journal Entry Date
AccountingDocCreatedByUser lineitem AccountingDocCreatedByUser User which created overhead document
DocumentItemText lineitem DocumentItemText Text
ClearingDate lineitem ClearingDate Clearing Date
ClearingJournalEntry lineitem ClearingJournalEntry Clrng doc.
AlternativeReferenceDocument AlternativeReferenceDocument Alternative Reference Document
AccountingDocumentHeaderText lineitem AccountingDocumentHeaderText Doc.Header Text
FiscalYearPeriod
BusinessPartner balance BusinessPartner Issuing Authority
CustomerAccountGroup balance CustomerAccountGroup Account group
CustomerVATRegistration balance CustomerVATRegistration VAT Registration No.
CustomerCountry balance CustomerCountry
CustomerCityName balance CustomerCityName
CustomerRegion balance CustomerRegion
CustomerName balance CustomerName Name of Customer
BPCustomerName balance BPCustomerName Name of Customer
CustomerSearchTerm balance CustomerSearchTerm
OrganizationBPName1 balance OrganizationBPName1 Name 1
OrganizationBPName2 balance OrganizationBPName2 Name 2
BusinessPartnerName balance BusinessPartnerName Extracted Customer Name
CustBalCustomerInfo balance Customer Sold-to Party
CustBalSupplierInfo balance Supplier Supplier
DisplayCurrency
TransactionCurrency lineitem TransactionCurrency Transaction Currency
AmountInTransactionCurrency lineitem AmountInTransactionCurrency Pt Crcy Amt
DebitAmountInTransCrcy lineitem DebitAmountInTransCrcy Debit Amt in DC
CreditAmountInTransCrcy
AmountInDisplayCurrency lineitem AmountInDisplayCurrency
DebitAmountInDisplayCrcy lineitem DebitAmountInDisplayCrcy
CreditAmountInDisplayCrcy
CustBalCarryFwdAmtInDspCrcy
CustBalStartingBalAmtInDspCrcy
CustBalEndingBalAmtInDspCrcy
CustBalDebitAmtInDspCrcy
CustBalCreditAmtInDspCrcy
CustBalYTDDebitAmtInDspCrcy
CustBalYTDCrdtAmtInDspCrcy
ProfitCenterGroup
_FiscalPeriodValueHelp _FiscalPeriodValueHelp
_CurrencyValueHelp _CurrencyValueHelp
_Customer _Customer
_Supplier lineitem _Supplier
_GLAccountText _GLAccountText

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_CN_CustomerLineItem.
-- 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: PCNCUSTLINEITEM
-- Parameters: P_CompanyCode : bukrs, P_FiscalYear : gjahr, P_CurrencyRole : fac_crcyrole, P_ReportingFiscalPeriod : fins_fiscalperiod, P_CategoryFlag : wrf_catflag, P_DimensionKey : dimid

CREATE VIEW P_CN_CustomerLineItem AS
SELECT
  balance.CompanyCode AS CompanyCode,
  balance.FiscalYear AS FiscalYear,
  lineitem.AccountingDocument AS AccountingDocument,
  cast(lineitem.LedgerGLLineItem as glo_item_num) AS LedgerGLLineItem,
  balance.FiscalPeriod AS FiscalPeriod,
  balance.AlternativeGLAccount AS AlternativeGLAccount,
  _AlternativeText.GLAccountName AS AlternativeGLAccountName,
  balance.CustBalAltvGLAccountInfo AS CustBalAltvGLAccountInfo,
  lineitem.GLAccount AS GLAccount,
  lineitem.Supplier AS Supplier,
  lineitem.FinancialAccountType AS FinancialAccountType,
  cast(lineitem.Customer as kunnr) AS Customer,
  lineitem.SpecialGLCode AS SpecialGLCode,
  lineitem.ProfitCenter AS ProfitCenter,
  lineitem.Segment AS Segment,
  lineitem.BusinessArea AS BusinessArea,
  lineitem.AssignmentReference AS AssignmentReference,
  lineitem.PostingDate AS PostingDate,
  lineitem.IsCleared AS IsCleared,
  lineitem.DebitCreditCode AS DebitCreditCode,
  lineitem.SalesOrganization AS SalesOrganization,
  lineitem.DistributionChannel AS DistributionChannel,
  lineitem.OrganizationDivision AS OrganizationDivision,
  lineitem.PartnerProfitCenter AS PartnerProfitCenter,
  lineitem.AccountingDocumentType AS AccountingDocumentType,
  lineitem.DocumentDate AS DocumentDate,
  lineitem.AccountingDocCreatedByUser AS AccountingDocCreatedByUser,
  lineitem.DocumentItemText AS DocumentItemText,
  lineitem.ClearingDate AS ClearingDate,
  lineitem.ClearingJournalEntry AS ClearingJournalEntry,
  AlternativeReferenceDocument,
  lineitem.AccountingDocumentHeaderText AS AccountingDocumentHeaderText,
  cast (balance.FiscalYearPeriod as fiscalyearperiod ) AS FiscalYearPeriod,
  balance.BusinessPartner AS BusinessPartner,
  balance.CustomerAccountGroup AS CustomerAccountGroup,
  balance.CustomerVATRegistration AS CustomerVATRegistration,
  balance.CustomerCountry AS CustomerCountry,
  balance.CustomerCityName AS CustomerCityName,
  balance.CustomerRegion AS CustomerRegion,
  balance.CustomerName AS CustomerName,
  balance.BPCustomerName AS BPCustomerName,
  balance.CustomerSearchTerm AS CustomerSearchTerm,
  balance.OrganizationBPName1 AS OrganizationBPName1,
  balance.OrganizationBPName2 AS OrganizationBPName2,
  balance.BusinessPartnerName AS BusinessPartnerName,
  balance.Customer AS CustBalCustomerInfo,
  balance.Supplier AS CustBalSupplierInfo,
  cast( lineitem.DisplayCurrency as fiarcn_crcy_dsp ) AS DisplayCurrency,
  lineitem.TransactionCurrency AS TransactionCurrency,
  lineitem.AmountInTransactionCurrency AS AmountInTransactionCurrency,
  lineitem.DebitAmountInTransCrcy AS DebitAmountInTransCrcy,
  -lineitem.CreditAmountInTransCrcy AS CreditAmountInTransCrcy,
  lineitem.AmountInDisplayCurrency AS AmountInDisplayCurrency,
  lineitem.DebitAmountInDisplayCrcy AS DebitAmountInDisplayCrcy,
  -lineitem.CreditAmountInDisplayCrcy AS CreditAmountInDisplayCrcy,
  cast(balance.BalCarFwdAmtInDspCrcy as fiarcn_cfd_dsp) AS CustBalCarryFwdAmtInDspCrcy,
  cast(balance.StartingBalAmtInDspCrcy as fiarcn_start_bal_dsp) AS CustBalStartingBalAmtInDspCrcy,
  cast(balance.EndingBalAmtInDspCrcy as fiarcn_end_bal_dsp) AS CustBalEndingBalAmtInDspCrcy,
  cast( balance.DebitAmountInDspCrcy as fiarcn_dr_dsp ) AS CustBalDebitAmtInDspCrcy,
  cast( -balance.CreditAmountInDspCrcy as fiarcn_cr_dsp ) AS CustBalCreditAmtInDspCrcy,
  cast( balance.YTDDebitAmtInDspCrcy as fiarcn_ytd_dr_dsp ) AS CustBalYTDDebitAmtInDspCrcy,
  cast( -balance.YTDCrdtAmtInDspCrcy as fiarcn_ytd_cr_dsp ) AS CustBalYTDCrdtAmtInDspCrcy,
  cast(' ' as setnamenew) AS ProfitCenterGroup,
  lineitem._Supplier AS _Supplier
FROM P_CN_CustLineItemRaw
INNER JOIN P_CN_CustAcctBal ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN C_CN_FsclPerdVH AS _FiscalPeriodValueHelp ON CompanyCode = _FiscalPeriodValueHelp.CompanyCode AND FiscalYear = _FiscalPeriodValueHelp.FiscalYear AND FiscalPeriod = _FiscalPeriodValueHelp.FiscalPeriod  -- association [1..1]
LEFT OUTER JOIN C_CN_CrcyVH AS _CurrencyValueHelp ON CompanyCode = _CurrencyValueHelp.CompanyCode  -- association [0..*]
LEFT OUTER JOIN I_Customer AS _Customer ON Customer = _Customer.Customer  -- association [1..1]
LEFT OUTER JOIN I_GlAccountTextInCompanycode AS _GLAccountText ON CompanyCode = _GLAccountText.CompanyCode AND GLAccount = _GLAccountText.GLAccount AND _GLAccountText.Language = $session.system_language  -- association [0..1]
;