P_CN_FiapSuplrBalance01

DDL: P_CN_FIAPSUPLRBALANCE01 SQL: PCNFIAPSBBAL1 Type: view CONSUMPTION

P_CN_FiapSuplrBalance01 is a Consumption CDS View in SAP S/4HANA. It reads from 2 data sources (I_LedgerCompanyCodeCrcyRoleVH, P_CN_FiapSuplrBalance06) and exposes 21 fields with key fields CompanyCode, FiscalYear, FiscalPeriod, GLAccount, AlternativeGLAccount. It has 1 association to related views.

Data Sources (2)

SourceAliasJoin Type
I_LedgerCompanyCodeCrcyRoleVH currency inner
P_CN_FiapSuplrBalance06 P_CN_FiapSuplrBalance06 from

Parameters (3)

NameTypeDefault
P_CompanyCode bukrs
P_FiscalYear gjahr
P_CurrencyRole fac_crcyrole

Associations (1)

CardinalityTargetAliasCondition
[1..1] I_GLAccountInCompanyCode _GLAccountInCompanyCode $projection.CompanyCode = _GLAccountInCompanyCode.CompanyCode and $projection.GLAccount = _GLAccountInCompanyCode.GLAccount

Annotations (6)

NameValueLevelField
AbapCatalog.sqlViewName PCNFIAPSBBAL1 view
ClientHandling.algorithm #SESSION_VARIABLE view
VDM.private true view
VDM.viewType #CONSUMPTION view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #NOT_REQUIRED view

Fields (21)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode lineitem CompanyCode Receiver Company Code
KEY FiscalYear FiscalYear G/L Fiscal Year
KEY FiscalPeriod FiscalPeriod Tax period
KEY GLAccount GLAccount General Ledger
KEY AlternativeGLAccount _GLAccountInCompanyCode AlternativeGLAccount Group Account
KEY Supplier Supplier Supplier
KEY Customer Customer Sold-to Party
KEY SpecialGLCode SpecialGLCode Special G/L Ind
KEY ProfitCenter ProfitCenter Profit Center
KEY Segment Segment Segment number
KEY AccountingDocumentType AccountingDocumentType Journal Entry Type
KEY BusinessArea BusinessArea Business Area
KEY CompanyCodeCurrencyendasDisplayCurrency
KEY TransactionCurrency TransactionCurrency Transaction Currency
AssignmentReference lineitem AssignmentReference Assignment Reference
AmountInTransactionCurrency AmountInTransactionCurrency Pt Crcy Amt
DebitAmountInTransCrcy DebitAmountInTransCrcy Debit Amt in DC
CreditAmountInTransCrcy CreditAmountInTransCrcy Credit Amt in DC
curr232endasAmountInDisplayCurrency
curr232endasDebitAmountInDspCrcy
curr232endasCreditAmountInDspCrcy

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_FiapSuplrBalance01.
-- 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: PCNFIAPSBBAL1
-- Parameters: P_CompanyCode : bukrs, P_FiscalYear : gjahr, P_CurrencyRole : fac_crcyrole

CREATE VIEW P_CN_FiapSuplrBalance01 AS
SELECT
  lineitem.CompanyCode AS CompanyCode,
  FiscalYear,
  FiscalPeriod,
  GLAccount,
  _GLAccountInCompanyCode.AlternativeGLAccount AS AlternativeGLAccount,
  Supplier,
  Customer,
  SpecialGLCode,
  ProfitCenter,
  Segment,
  AccountingDocumentType,
  BusinessArea,
  case $parameters.P_CurrencyRole when currency.CompanyCodeCurrencyRole then case when lineitem.CompanyCodeCurrency <> '' then lineitem.CompanyCodeCurrency else currency.CompanyCodeCurrency end when currency.GlobalCurrencyRole then case when lineitem.GlobalCurrency <> '' then lineitem.GlobalCurrency else currency.GlobalCurrency end when currency.FreeDefinedCurrency1Role then case when lineitem.FreeDefinedCurrency1 <> '' then lineitem.FreeDefinedCurrency1 else currency.FreeDefinedCurrency1 end when currency.FreeDefinedCurrency2Role then case when lineitem.FreeDefinedCurrency2 <> '' then lineitem.FreeDefinedCurrency2 else currency.FreeDefinedCurrency2 end when currency.FreeDefinedCurrency3Role then case when lineitem.FreeDefinedCurrency3 <> '' then lineitem.FreeDefinedCurrency3 else currency.FreeDefinedCurrency3 end when currency.FreeDefinedCurrency4Role then case when lineitem.FreeDefinedCurrency4 <> '' then lineitem.FreeDefinedCurrency4 else currency.FreeDefinedCurrency4 end when currency.FreeDefinedCurrency5Role then case when lineitem.FreeDefinedCurrency5 <> '' then lineitem.FreeDefinedCurrency5 else currency.FreeDefinedCurrency5 end when currency.FreeDefinedCurrency6Role then case when lineitem.FreeDefinedCurrency6 <> '' then lineitem.FreeDefinedCurrency6 else currency.FreeDefinedCurrency6 end when currency.FreeDefinedCurrency7Role then case when lineitem.FreeDefinedCurrency7 <> '' then lineitem.FreeDefinedCurrency7 else currency.FreeDefinedCurrency7 end when currency.FreeDefinedCurrency8Role then case when lineitem.FreeDefinedCurrency8 <> '' then lineitem.FreeDefinedCurrency8 else currency.FreeDefinedCurrency8 end else lineitem.CompanyCodeCurrency end as DisplayCurrency AS CompanyCodeCurrencyendasDisplayCurrency,
  TransactionCurrency,
  lineitem.AssignmentReference AS AssignmentReference,
  AmountInTransactionCurrency,
  DebitAmountInTransCrcy,
  CreditAmountInTransCrcy,
  case :P_CurrencyRole when currency.CompanyCodeCurrencyRole then AmountInCompanyCodeCurrency when currency.GlobalCurrencyRole then AmountInGlobalCurrency when currency.FreeDefinedCurrency1Role then AmountInFreeDefinedCurrency1 when currency.FreeDefinedCurrency2Role then AmountInFreeDefinedCurrency2 when currency.FreeDefinedCurrency3Role then AmountInFreeDefinedCurrency3 when currency.FreeDefinedCurrency4Role then AmountInFreeDefinedCurrency4 when currency.FreeDefinedCurrency5Role then AmountInFreeDefinedCurrency5 when currency.FreeDefinedCurrency6Role then AmountInFreeDefinedCurrency6 when currency.FreeDefinedCurrency7Role then AmountInFreeDefinedCurrency7 when currency.FreeDefinedCurrency8Role then AmountInFreeDefinedCurrency8 else cast ( 0 as abap.curr(23,2) ) end as AmountInDisplayCurrency AS curr232endasAmountInDisplayCurrency,
  case :P_CurrencyRole when currency.CompanyCodeCurrencyRole then DebitAmountInCoCodeCrcy when currency.GlobalCurrencyRole then DebitAmountInGlobalCrcy when currency.FreeDefinedCurrency1Role then DebitAmountInFreeDefinedCrcy1 when currency.FreeDefinedCurrency2Role then DebitAmountInFreeDefinedCrcy2 when currency.FreeDefinedCurrency3Role then DebitAmountInFreeDefinedCrcy3 when currency.FreeDefinedCurrency4Role then DebitAmountInFreeDefinedCrcy4 when currency.FreeDefinedCurrency5Role then DebitAmountInFreeDefinedCrcy5 when currency.FreeDefinedCurrency6Role then DebitAmountInFreeDefinedCrcy6 when currency.FreeDefinedCurrency7Role then DebitAmountInFreeDefinedCrcy7 when currency.FreeDefinedCurrency8Role then DebitAmountInFreeDefinedCrcy8 else cast ( 0 as abap.curr(23,2) ) end as DebitAmountInDspCrcy AS curr232endasDebitAmountInDspCrcy,
  case :P_CurrencyRole when currency.CompanyCodeCurrencyRole then CreditAmountInCoCodeCrcy when currency.GlobalCurrencyRole then CreditAmountInGlobalCrcy when currency.FreeDefinedCurrency1Role then CreditAmountInFreeDefinedCrcy1 when currency.FreeDefinedCurrency2Role then CreditAmountInFreeDefinedCrcy2 when currency.FreeDefinedCurrency3Role then CreditAmountInFreeDefinedCrcy3 when currency.FreeDefinedCurrency4Role then CreditAmountInFreeDefinedCrcy4 when currency.FreeDefinedCurrency5Role then CreditAmountInFreeDefinedCrcy5 when currency.FreeDefinedCurrency6Role then CreditAmountInFreeDefinedCrcy6 when currency.FreeDefinedCurrency7Role then CreditAmountInFreeDefinedCrcy7 when currency.FreeDefinedCurrency8Role then CreditAmountInFreeDefinedCrcy8 else cast ( 0 as abap.curr(23,2) ) end as CreditAmountInDspCrcy AS curr232endasCreditAmountInDspCrcy
FROM P_CN_FiapSuplrBalance06
INNER JOIN I_LedgerCompanyCodeCrcyRoleVH AS currency ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN I_GLAccountInCompanyCode AS _GLAccountInCompanyCode ON CompanyCode = _GLAccountInCompanyCode.CompanyCode AND GLAccount = _GLAccountInCompanyCode.GLAccount  -- association [1..1]
;