P_Fiarcn_Cust_Balance

DDL: P_FIARCN_CUST_BALANCE SQL: PVFIARCNCUSTBAL Type: view CONSUMPTION Package: GLO_FIN_CN

Customer Balance

P_Fiarcn_Cust_Balance is a Consumption CDS View that provides data about "Customer Balance" in SAP S/4HANA. It reads from 1 data source (P_Fiarcn_Cust_Balance09) and exposes 53 fields with key fields CompanyCode, FiscalYear, FiscalPeriod, FiscalYearPeriod, Customer. It has 6 associations to related views. Part of development package GLO_FIN_CN.

Data Sources (1)

SourceAliasJoin Type
P_Fiarcn_Cust_Balance09 P_Fiarcn_Cust_Balance09 from

Parameters (5)

NameTypeDefault
P_CompanyCode bukrs
P_FiscalYear gjahr
P_Language sylangu
P_CurrencyRole fac_crcyrole
P_AlternativeGLAccount fiarcn_dsp_alter

Associations (6)

CardinalityTargetAliasCondition
[1..1] I_Supplier _Supplier $projection.Supplier = _Supplier.Supplier
[1..1] I_Customer _Customer $projection.Customer = _Customer.Customer
[1..1] C_CN_FsclPerdVH _FiscalPeriodValueHelp $projection.CompanyCode = _FiscalPeriodValueHelp.CompanyCode and $projection.FiscalYear = _FiscalPeriodValueHelp.FiscalYear and $projection.FiscalPeriod = _FiscalPeriodValueHelp.FiscalPeriod
[1..1] C_CN_CustVH _CustomerSearch $projection.Customer = _CustomerSearch.Customer
[1..1] P_FIARCN_ACCOUNTTEXT _AccountText $projection.CompanyCode = _AccountText.CompanyCode and $projection.GLAccount = _AccountText.GLAccount
[0..*] C_CN_CrcyVH _CurrencyValueHelp $projection.CompanyCode = _CurrencyValueHelp.CompanyCode

Annotations (6)

NameValueLevelField
AbapCatalog.sqlViewName PVFIARCNCUSTBAL 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 (53)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode CompanyCode Receiver Company Code
KEY FiscalYear FiscalYear G/L Fiscal Year
KEY FiscalPeriod FiscalPeriod Tax period
KEY FiscalYearPeriod Period/Year
KEY Customer Customer Sold-to Party
KEY BusinessPartner BusinessPartner Issuing Authority
KEY Supplier Supplier Supplier
KEY GLAccount GLAccount General Ledger
KEY AlternativeGLAccount AlternativeGLAccount Group Account
KEY SpecialGLCode SpecialGLCode Special G/L Ind
KEY BusinessArea BusinessArea Business Area
KEY ProfitCenter ProfitCenter Profit Center
KEY Segment Segment Segment number
KEY AccountingDocumentType AccountingDocumentType Journal Entry Type
KEY DisplayCurrency DisplayCurrency Display Currency
KEY TransactionCurrency TransactionCurrency Transaction Currency
CustomerName
OrganizationBPName1 _Customer OrganizationBPName1 Name 1
OrganizationBPName2 _Customer OrganizationBPName2 Name 2
CustomerAccountGroup _Customer CustomerAccountGroup Account group
CustomerVATRegistration _Customer TaxNumber5
CustomerCountry
CustomerCityName
CustomerRegion
BusinessPartnerName
CustomerSearchText _CustomerSearch CustomerSearchText
GLAccountNameendasGLAccountName
AlternativeGLAccountName GLAccountName Short Text
AssignmentReference AssignmentReference Assignment Reference
CustBalGLAccountInfo General Ledger
CustBalAltvGLAccountInfo Group Account
CustBalCustomerInfo Sold-to Party
char90endasCustBalSupplierInfo
CustBalCarryFwdAmtInDspCrcy CustBalCarryFwdAmtInDspCrcy
CustBalDebitAmtInDspCrcy CustBalDebitAmtInDspCrcy
CustBalCreditAmtInDspCrcy
CustBalYTDDebitAmtInDspCrcy CustBalYTDDebitAmtInDspCrcy
CustBalYTDCrdtAmtInDspCrcy
CustBalStartingBalAmtInDspCrcy CustBalStartingBalAmtInDspCrcy
CustBalEndingBalAmtInDspCrcy CustBalEndingBalAmtInDspCrcy
BalCarFwdAmtInTransacCrcy BalCarFwdAmtInTransacCrcy
DebitAmountInTransCrcy DebitAmountInTransCrcy Debit Amt in DC
CreditAmountInTransCrcy
AmountInTransactionCurrency
YTDDebitAmtInTransCrcy YTDDebitAmtInTransCrcy
YTDCrdtAmtInTransCrcy
YrToDteAmtInTransacCrcy
StartingBalanceAmtInTransCrcy StartingBalanceAmtInTransCrcy
EndingBalanceAmtInTransCrcy EndingBalanceAmtInTransCrcy
_FiscalPeriodValueHelp _FiscalPeriodValueHelp
_CurrencyValueHelp _CurrencyValueHelp
_Supplier _Supplier
_Customer _Customer

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_Fiarcn_Cust_Balance.
-- 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: PVFIARCNCUSTBAL
-- Parameters: P_CompanyCode : bukrs, P_FiscalYear : gjahr, P_Language : sylangu, P_CurrencyRole : fac_crcyrole, P_AlternativeGLAccount : fiarcn_dsp_alter

CREATE VIEW P_Fiarcn_Cust_Balance AS
SELECT
  CompanyCode,
  FiscalYear,
  FiscalPeriod,
  cast( FiscalYearPeriod as fiscalyearperiod ) AS FiscalYearPeriod,
  Customer,
  BusinessPartner,
  Supplier,
  GLAccount,
  AlternativeGLAccount,
  SpecialGLCode,
  BusinessArea,
  ProfitCenter,
  Segment,
  AccountingDocumentType,
  DisplayCurrency,
  TransactionCurrency,
  '' AS CustomerName,
  _Customer.OrganizationBPName1 AS OrganizationBPName1,
  _Customer.OrganizationBPName2 AS OrganizationBPName2,
  _Customer.CustomerAccountGroup AS CustomerAccountGroup,
  _Customer.TaxNumber5 AS CustomerVATRegistration,
  _Customer._AddressRepresentation.Country AS CustomerCountry,
  _Customer._AddressRepresentation.CityName AS CustomerCityName,
  _Customer._AddressRepresentation.Region AS CustomerRegion,
  _Customer._CustomerToBusinessPartner._BusinessPartner.BusinessPartnerName AS BusinessPartnerName,
  _CustomerSearch.CustomerSearchText AS CustomerSearchText,
  case $parameters.P_AlternativeGLAccount when 'X' then GLAccountName else _AccountText(P_Language: :P_Language).GLAccountName end as GLAccountName AS GLAccountNameendasGLAccountName,
  GLAccountName AS AlternativeGLAccountName,
  AssignmentReference,
  cast( CustBalGLAccountInfo as fiarcn_glaccountdesc ) AS CustBalGLAccountInfo,
  cast( CustBalAltvGLAccountInfo as fiarcn_glaccountdesc ) AS CustBalAltvGLAccountInfo,
  cast( CustBalCustomerInfo as fiarcn_customer ) AS CustBalCustomerInfo,
  case when Supplier <> '' then concat( concat(Supplier,' ('), concat(_Supplier._SupplierToBusinessPartner._BusinessPartner.BusinessPartnerName,')') ) else cast ('' as abap.char(90)) end as CustBalSupplierInfo AS char90endasCustBalSupplierInfo,
  CustBalCarryFwdAmtInDspCrcy,
  CustBalDebitAmtInDspCrcy,
  -CustBalCreditAmtInDspCrcy AS CustBalCreditAmtInDspCrcy,
  CustBalYTDDebitAmtInDspCrcy,
  -CustBalYTDCrdtAmtInDspCrcy AS CustBalYTDCrdtAmtInDspCrcy,
  CustBalStartingBalAmtInDspCrcy,
  CustBalEndingBalAmtInDspCrcy,
  BalCarFwdAmtInTransacCrcy,
  DebitAmountInTransCrcy,
  -CreditAmountInTransCrcy AS CreditAmountInTransCrcy,
  DebitAmountInTransCrcy + CreditAmountInTransCrcy AS AmountInTransactionCurrency,
  YTDDebitAmtInTransCrcy,
  -YTDCrdtAmtInTransCrcy AS YTDCrdtAmtInTransCrcy,
  YTDDebitAmtInTransCrcy + YTDCrdtAmtInTransCrcy AS YrToDteAmtInTransacCrcy,
  StartingBalanceAmtInTransCrcy,
  EndingBalanceAmtInTransCrcy
FROM P_Fiarcn_Cust_Balance09
LEFT OUTER JOIN I_Supplier AS _Supplier ON Supplier = _Supplier.Supplier  -- association [1..1]
LEFT OUTER JOIN I_Customer AS _Customer ON Customer = _Customer.Customer  -- association [1..1]
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_CustVH AS _CustomerSearch ON Customer = _CustomerSearch.Customer  -- association [1..1]
LEFT OUTER JOIN P_FIARCN_ACCOUNTTEXT AS _AccountText ON CompanyCode = _AccountText.CompanyCode AND GLAccount = _AccountText.GLAccount  -- association [1..1]
LEFT OUTER JOIN C_CN_CrcyVH AS _CurrencyValueHelp ON CompanyCode = _CurrencyValueHelp.CompanyCode  -- association [0..*]
;