P_BG_SAFTCustomer

DDL: P_BG_SAFTCUSTOMER Type: view_entity CONSUMPTION Package: GLO_FIN_IS_SAFT_BG

Customer Data for BG SAFT

P_BG_SAFTCustomer is a Consumption CDS View that provides data about "Customer Data for BG SAFT" in SAP S/4HANA. It reads from 6 data sources and exposes 40 fields with key fields SourceLedger, Ledger, CompanyCode, Customer, TaxID5. Part of development package GLO_FIN_IS_SAFT_BG.

Data Sources (6)

SourceAliasJoin Type
I_Customer Customer inner
P_BG_SAFTCUSTOMERID CustomerTaxType from
P_BG_SAFTCUSTOMERID CustomerTaxType union_all
P_BG_SAFTOneTimeCustomer otc inner
P_BG_SAFTCustAcctBal P_BG_SAFTCustAcctBal inner
P_BG_SAFTCustAcctBal P_BG_SAFTCustAcctBal inner

Parameters (4)

NameTypeDefault
P_FromPostingDate dats
P_ToPostingDate dats
P_FiscalYear gjahr
P_AlternativeGLAccountIsUsed saft_bg_alt_gl_account_flag

Annotations (7)

NameValueLevelField
AccessControl.authorizationCheck #NOT_REQUIRED view
Metadata.ignorePropagatedAnnotations true view
VDM.private true view
VDM.viewType #CONSUMPTION view
ObjectModel.usageType.serviceQuality #X view
ObjectModel.usageType.sizeCategory #S view
ObjectModel.usageType.dataClass #MIXED view

Fields (40)

KeyFieldSource TableSource FieldDescription
KEY SourceLedger Balance SourceLedger Source Ledger
KEY Ledger Balance Ledger Ledger
KEY CompanyCode Balance CompanyCode Receiver Company Code
KEY Customer
KEY TaxID5 P_BG_SAFTCUSTOMERID BPTaxLongNumber VAT Registration No.
KEY BG_SAFTStandardAccount
GLAccount Balance GLAccount General Ledger
BusinessPartner
CustomerName I_Customer BusinessPartnerName1 Name of Customer
CountryISOCode
Region Address Region Venue Region
PostalCode Address PostalCode Postal Code
CityName Address CityName Name
StreetName Address StreetName Text
HouseNumber Address HouseNumber House Number
Building Address Building Building code
StartingBalanceAmtInRptgCrcy
EndingBalanceAmtInRptgCrcy
P_FromPostingDate
P_ToPostingDate
P_FiscalYear
SourceLedger Source Ledger
KEY Ledger Balance Ledger Ledger
KEY CompanyCode Balance CompanyCode Receiver Company Code
KEY Customer
KEY TaxID5 P_BG_SAFTOneTimeCustomer VATRegistration VAT Registration No.
KEY BG_SAFTStandardAccount
GLAccount Balance GLAccount General Ledger
BusinessPartner
CustomerName P_BG_SAFTOneTimeCustomer CustomerName Name of Customer
CountryISOCode P_BG_SAFTOneTimeCustomer CountryISOCode
Region P_BG_SAFTOneTimeCustomer Region Venue Region
PostalCode P_BG_SAFTOneTimeCustomer PostalCode Postal Code
CityName P_BG_SAFTOneTimeCustomer CityName Name
StreetName P_BG_SAFTOneTimeCustomer StreetName Text
HouseNumber House Number
Building Building code
StartingBalanceAmtInRptgCrcy
EndingBalanceAmtInRptgCrcy
ReportingCurrency Balance ReportingCurrency Currency

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_BG_SAFTCustomer.
-- 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.
-- Parameters: P_FromPostingDate : dats, P_ToPostingDate : dats, P_FiscalYear : gjahr, P_AlternativeGLAccountIsUsed : saft_bg_alt_gl_account_flag

CREATE VIEW P_BG_SAFTCustomer AS
SELECT
  Balance.SourceLedger AS SourceLedger,
  Balance.Ledger AS Ledger,
  Balance.CompanyCode AS CompanyCode,
  max(Balance.Customer) AS Customer,
  CustomerTaxType.BPTaxLongNumber AS TaxID5,
  coalesce(Account.BG_SAFTStandardAccount, Balance.ActiveGLAccount) AS BG_SAFTStandardAccount,
  Balance.GLAccount AS GLAccount,
  max(Customer._CustomerToBusinessPartner._BusinessPartner.BusinessPartner) AS BusinessPartner,
  Customer.BusinessPartnerName1 AS CustomerName,
  cast( Address._Country.CountryISOCode as land1 ) AS CountryISOCode,
  Address.Region AS Region,
  Address.PostalCode AS PostalCode,
  Address.CityName AS CityName,
  Address.StreetName AS StreetName,
  Address.HouseNumber AS HouseNumber,
  Address.Building AS Building,
  sum(Balance.StartingBalanceAmtInRptgCrcy) AS StartingBalanceAmtInRptgCrcy,
  sum(Balance.EndingBalanceAmtInRptgCrcy) AS EndingBalanceAmtInRptgCrcy,
  Balance.ReportingCurrency AS P_FromPostingDate,
  P_ToPostingDate: $parameters.P_ToPostingDate AS P_ToPostingDate,
  P_FiscalYear: $parameters.P_FiscalYear AS P_FiscalYear,
  Balance.ReportingCurrency AS ReportingCurrency
FROM P_BG_SAFTCUSTOMERID AS CustomerTaxType
INNER JOIN P_BG_SAFTCustAcctBal ON /* join condition not captured in parsed metadata */
INNER JOIN I_Customer AS Customer ON /* join condition not captured in parsed metadata */
INNER JOIN P_BG_SAFTOneTimeCustomer AS otc ON /* join condition not captured in parsed metadata */
-- UNION ALL with additional select branch(es): P_BG_SAFTCUSTOMERID
;