P_FIARCN_CUST_BALANCE07

DDL: P_FIARCN_CUST_BALANCE07 SQL: PVFIARCNCUSTBAL7 Type: view CONSUMPTION

P_FIARCN_CUST_BALANCE07 is a Consumption CDS View in SAP S/4HANA. It reads from 2 data sources (P_FIARCN_CUST_BALANCE04, P_FIARCN_TOTAL_PERIODS) and exposes 42 fields with key fields CompanyCode, FiscalYear, FiscalPeriod, GLAccount, AlternativeGLAccount. It has 5 associations to related views.

Data Sources (2)

SourceAliasJoin Type
P_FIARCN_CUST_BALANCE04 P_FIARCN_CUST_BALANCE04 from
P_FIARCN_TOTAL_PERIODS P_FIARCN_TOTAL_PERIODS inner

Parameters (4)

NameTypeDefault
P_CompanyCode bukrs
P_FiscalYear gjahr
P_Language sylangu
P_CurrencyRole fac_crcyrole

Associations (5)

CardinalityTargetAliasCondition
[1..1] I_Customer _Customer $projection.Customer = _Customer.Customer
[1..1] I_CustomerCompany _CustomerCompany $projection.Customer = _CustomerCompany.Customer and $projection.CompanyCode = _CustomerCompany.CompanyCode
[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
[1..1] P_CN_AlternativeGLAccountText _AlternativeGLAccountText $projection.CompanyCode = _AlternativeGLAccountText.CompanyCode and $projection.AlternativeGLAccount = _AlternativeGLAccountText.GLAccount and _AlternativeGLAccountText.Language = $session.system_language

Annotations (6)

NameValueLevelField
AbapCatalog.sqlViewName PVFIARCNCUSTBAL7 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 (42)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode Period CompanyCode Receiver Company Code
KEY FiscalYear Period FiscalYear G/L Fiscal Year
KEY FiscalPeriod Period FiscalPeriod Tax period
KEY GLAccount GLAccount General Ledger
KEY AlternativeGLAccount AlternativeGLAccount Group Account
KEY BusinessPartner
KEY Customer Bal Customer Sold-to Party
KEY Supplier Supplier Supplier
KEY SpecialGLCode SpecialGLCode Special G/L Ind
KEY ProfitCenter ProfitCenter Profit Center
KEY Segment Segment Segment number
KEY BusinessArea BusinessArea Business Area
KEY AccountingDocumentType AccountingDocumentType Journal Entry Type
KEY DisplayCurrency DisplayCurrency Display Currency
KEY TransactionCurrency TransactionCurrency Transaction Currency
AssignmentReference AssignmentReference Assignment Reference
CustomerName _Customer CustomerName Name of Customer
BPCustomerName _Customer BPCustomerName Name of Customer
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
GLAccountName
AlternativeGLAccountName _AlternativeGLAccountText GLAccountName Short Text
curr232endasBalCarFwdAmtInDspCrcy
curr232endasStartingBalAmtInDspCrcy
curr232endasEndingBalAmtInDspCrcy
curr232endasDebitAmountInDspCrcy
curr232endasCreditAmountInDspCrcy
curr232endasYTDDebitAmtInDspCrcy
curr232endasYTDCrdtAmtInDspCrcy
curr232endasBalCarFwdAmtInTransacCrcy
curr232endasDebitAmountInTransCrcy
curr232endasCreditAmountInTransCrcy
curr232endasEndingBalanceAmtInTransCrcy
curr232endasYTDDebitAmtInTransCrcy
curr232endasYTDCrdtAmtInTransCrcy

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_BALANCE07.
-- 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: PVFIARCNCUSTBAL7
-- Parameters: P_CompanyCode : bukrs, P_FiscalYear : gjahr, P_Language : sylangu, P_CurrencyRole : fac_crcyrole

CREATE VIEW P_FIARCN_CUST_BALANCE07 AS
SELECT
  Period.CompanyCode AS CompanyCode,
  Period.FiscalYear AS FiscalYear,
  Period.FiscalPeriod AS FiscalPeriod,
  GLAccount,
  AlternativeGLAccount,
  _Customer._CustomerToBusinessPartner._BusinessPartner.BusinessPartner AS BusinessPartner,
  Bal.Customer AS Customer,
  Supplier,
  SpecialGLCode,
  ProfitCenter,
  Segment,
  BusinessArea,
  AccountingDocumentType,
  DisplayCurrency,
  TransactionCurrency,
  AssignmentReference,
  _Customer.CustomerName AS CustomerName,
  _Customer.BPCustomerName AS BPCustomerName,
  _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,
  _AccountText(P_Language: :P_Language).GLAccountName AS GLAccountName,
  _AlternativeGLAccountText.GLAccountName AS AlternativeGLAccountName,
  case when Bal.FiscalPeriod = '000' then AmountInDisplayCurrency else cast(0 as abap.curr( 23, 2 )) end as BalCarFwdAmtInDspCrcy AS curr232endasBalCarFwdAmtInDspCrcy,
  case when Bal.FiscalPeriod < Period.FiscalPeriod then AmountInDisplayCurrency else cast(0 as abap.curr( 23, 2 )) end as StartingBalAmtInDspCrcy AS curr232endasStartingBalAmtInDspCrcy,
  case when Bal.FiscalPeriod <= Period.FiscalPeriod then AmountInDisplayCurrency else cast(0 as abap.curr( 23, 2 )) end as EndingBalAmtInDspCrcy AS curr232endasEndingBalAmtInDspCrcy,
  case when Bal.FiscalPeriod = Period.FiscalPeriod then DebitAmountInDspCrcy else cast(0 as abap.curr( 23, 2 )) end as DebitAmountInDspCrcy AS curr232endasDebitAmountInDspCrcy,
  case when Bal.FiscalPeriod = Period.FiscalPeriod then CreditAmountInDspCrcy else cast(0 as abap.curr( 23, 2 )) end as CreditAmountInDspCrcy AS curr232endasCreditAmountInDspCrcy,
  case when Bal.FiscalPeriod > '000' and Bal.FiscalPeriod <= Period.FiscalPeriod then DebitAmountInDspCrcy else cast(0 as abap.curr( 23, 2 )) end as YTDDebitAmtInDspCrcy AS curr232endasYTDDebitAmtInDspCrcy,
  case when Bal.FiscalPeriod > '000' and Bal.FiscalPeriod <= Period.FiscalPeriod then CreditAmountInDspCrcy else cast(0 as abap.curr( 23, 2 )) end as YTDCrdtAmtInDspCrcy AS curr232endasYTDCrdtAmtInDspCrcy,
  case when Bal.FiscalPeriod = '000' then AmountInTransactionCurrency else cast(0 as abap.curr( 23, 2 )) end as BalCarFwdAmtInTransacCrcy AS curr232endasBalCarFwdAmtInTransacCrcy,
  case when Bal.FiscalPeriod = Period.FiscalPeriod then DebitAmountInTransCrcy else cast(0 as abap.curr( 23, 2 )) end as DebitAmountInTransCrcy AS curr232endasDebitAmountInTransCrcy,
  case when Bal.FiscalPeriod = Period.FiscalPeriod then CreditAmountInTransCrcy else cast(0 as abap.curr( 23, 2 )) end as CreditAmountInTransCrcy AS curr232endasCreditAmountInTransCrcy,
  case when Bal.FiscalPeriod <= Period.FiscalPeriod then AmountInTransactionCurrency else cast(0 as abap.curr( 23, 2 )) end as EndingBalanceAmtInTransCrcy AS curr232endasEndingBalanceAmtInTransCrcy,
  case when Bal.FiscalPeriod > '000' and Bal.FiscalPeriod <= Period.FiscalPeriod then DebitAmountInTransCrcy else cast(0 as abap.curr( 23, 2 )) end as YTDDebitAmtInTransCrcy AS curr232endasYTDDebitAmtInTransCrcy,
  case when Bal.FiscalPeriod > '000' and Bal.FiscalPeriod <= Period.FiscalPeriod then CreditAmountInTransCrcy else cast(0 as abap.curr( 23, 2 )) end as YTDCrdtAmtInTransCrcy AS curr232endasYTDCrdtAmtInTransCrcy
FROM P_FIARCN_CUST_BALANCE04
INNER JOIN P_FIARCN_TOTAL_PERIODS ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN I_Customer AS _Customer ON Customer = _Customer.Customer  -- association [1..1]
LEFT OUTER JOIN I_CustomerCompany AS _CustomerCompany ON Customer = _CustomerCompany.Customer AND CompanyCode = _CustomerCompany.CompanyCode  -- 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 P_CN_AlternativeGLAccountText AS _AlternativeGLAccountText ON CompanyCode = _AlternativeGLAccountText.CompanyCode AND AlternativeGLAccount = _AlternativeGLAccountText.GLAccount AND _AlternativeGLAccountText.Language = $session.system_language  -- association [1..1]
;