P_CN_CustomerLineItem
P_CN_CustomerLineItem is a Composite CDS View 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 5 associations to related views.
Data Sources (2)
| Source | Alias | Join Type |
|---|---|---|
| P_CN_CustAcctBal | P_CN_CustAcctBal | inner |
| P_CN_CustLineItemRaw | P_CN_CustLineItemRaw | from |
Parameters (6)
| Name | Type | Default |
|---|---|---|
| P_CompanyCode | bukrs | |
| P_FiscalYear | gjahr | |
| P_CurrencyRole | fac_crcyrole | |
| P_ReportingFiscalPeriod | fins_fiscalperiod | |
| P_CategoryFlag | wrf_catflag | |
| P_DimensionKey | dimid |
Associations (5)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [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 |
| [1..1] | I_Supplier | _Supplier | $projection.Supplier = _Supplier.Supplier |
| [0..1] | I_GlAccountTextInCompanycode | _GLAccountText | $projection.CompanyCode = _GLAccountText.CompanyCode and $projection.GLAccount = _GLAccountText.GLAccount and _GLAccountText.Language = $session.system_language |
Annotations (7)
| Name | Value | Level | Field |
|---|---|---|---|
| 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)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| 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 | _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
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_Supplier AS _Supplier ON Supplier = _Supplier.Supplier -- 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]
;
Learn More
- VDM (Virtual Data Model) in SAP S/4HANA Explained
- Types of CDS Views: Basic, Composite, Consumption, and Transactional
- CDS View Annotations — A Complete Guide
- What Is a CDS View in SAP S/4HANA?
- SAP Tables vs CDS Views — Key Differences
- Understanding Data Lineage in SAP S/4HANA
- CDS View Field Mapping and Associations
- Understanding the SAP S/4HANA Data Model
- CDS View Extensions and Custom Fields in SAP S/4HANA
- Released APIs and Stability Contracts in SAP S/4HANA
- BSEG to ACDOCA: The Universal Journal Migration
- Business Partner Migration: KNA1/LFA1 to BUT000
- Material Document Migration: MSEG/MKPF to MATDOC
- How to Find the Right CDS View for an SAP Table
- BW Extractor to CDS View Migration Guide
- S/4HANA CDS View Deprecation: What You Need to Know
- ABAP CDS View Tutorial — From Basics to Real-World Examples
- RAP and CDS Views — Building Transactional Apps in SAP S/4HANA
- Sales Document Status Migration: VBUP/VBUK Removal in S/4HANA
- CO Tables in S/4HANA: COEP, COBK, COSS, COSP to ACDOCA