P_BG_SAFTCustomer
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)
| Source | Alias | Join 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)
| Name | Type | Default |
|---|---|---|
| P_FromPostingDate | dats | |
| P_ToPostingDate | dats | |
| P_FiscalYear | gjahr | |
| P_AlternativeGLAccountIsUsed | saft_bg_alt_gl_account_flag |
Annotations (7)
| Name | Value | Level | Field |
|---|---|---|---|
| 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)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| 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
;
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