P_BG_SAFTPAYMENTITEM

DDL: P_BG_SAFTPAYMENTITEM Type: view_entity CONSUMPTION

P_BG_SAFTPAYMENTITEM is a Consumption CDS View in SAP S/4HANA. It reads from 4 data sources (I_JournalEntry, I_OperationalAcctgDocItem, I_JournalEntryItem, I_BG_SAFTPaymentMethod) and exposes 21 fields with key fields SourceLedger, CompanyCode, FiscalYear, AccountingDocument, LedgerGLLineItem.

Data Sources (4)

SourceAliasJoin Type
I_JournalEntry Bkpf inner
I_OperationalAcctgDocItem Bseg inner
I_JournalEntryItem Item from
I_BG_SAFTPaymentMethod PaymentMethod inner

Parameters (1)

NameTypeDefault
P_AlternativeGLAccountIsUsed saft_bg_alt_gl_account_flag

Annotations (7)

NameValueLevelField
VDM.viewType #CONSUMPTION view
VDM.private true view
ObjectModel.usageType.serviceQuality #X view
ObjectModel.usageType.sizeCategory #XL view
ObjectModel.usageType.dataClass #MIXED view
AccessControl.personalData.blocking #NOT_REQUIRED view
AccessControl.authorizationCheck #NOT_REQUIRED view

Fields (21)

KeyFieldSource TableSource FieldDescription
KEY SourceLedger I_JournalEntryItem SourceLedger Source Ledger
KEY CompanyCode I_JournalEntryItem CompanyCode Receiver Company Code
KEY FiscalYear I_JournalEntryItem FiscalYear G/L Fiscal Year
KEY AccountingDocument I_JournalEntryItem AccountingDocument Journal Entry
KEY LedgerGLLineItem I_JournalEntryItem LedgerGLLineItem Journal Entry Item
KEY Ledger I_JournalEntryItem Ledger Ledger
AccountingDocumentItem I_JournalEntryItem AccountingDocumentItem Posting View Item
Customer I_JournalEntryItem Customer Sold-to Party
Supplier I_JournalEntryItem Supplier Supplier
DebitCreditCode I_JournalEntryItem DebitCreditCode Single-Character Flag
FinancialAccountType I_JournalEntryItem FinancialAccountType Fin. Account Type
GLAccountendasActiveGLAccount
PostingDate I_JournalEntryItem PostingDate Posting Date for GR
DocumentDate I_JournalEntryItem DocumentDate Journal Entry Date
AccountingDocCreatedByUser I_JournalEntryItem AccountingDocCreatedByUser User which created overhead document
AccountingDocumentType I_JournalEntryItem AccountingDocumentType Journal Entry Type
CompanyCodeCurrency I_JournalEntryItem CompanyCodeCurrency Local Currency
TransactionCurrency I_JournalEntryItem TransactionCurrency Transaction Currency
BG_SAFTPaymentMethod I_BG_SAFTPaymentMethod BG_SAFTPaymentMethod Payment Method
TaxReportingDate I_JournalEntry TaxReportingDate Tax Reporting Date
ExchangeRate

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_SAFTPAYMENTITEM.
-- 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_AlternativeGLAccountIsUsed : saft_bg_alt_gl_account_flag

CREATE VIEW P_BG_SAFTPAYMENTITEM AS
SELECT
  Item.SourceLedger AS SourceLedger,
  Item.CompanyCode AS CompanyCode,
  Item.FiscalYear AS FiscalYear,
  Item.AccountingDocument AS AccountingDocument,
  Item.LedgerGLLineItem AS LedgerGLLineItem,
  Item.Ledger AS Ledger,
  Item.AccountingDocumentItem AS AccountingDocumentItem,
  Item.Customer AS Customer,
  Item.Supplier AS Supplier,
  Item.DebitCreditCode AS DebitCreditCode,
  Item.FinancialAccountType AS FinancialAccountType,
  case when $parameters.P_AlternativeGLAccountIsUsed = 'X' then Item.AlternativeGLAccount else Item.GLAccount end as ActiveGLAccount AS GLAccountendasActiveGLAccount,
  Item.PostingDate AS PostingDate,
  Item.DocumentDate AS DocumentDate,
  Item.AccountingDocCreatedByUser AS AccountingDocCreatedByUser,
  Item.AccountingDocumentType AS AccountingDocumentType,
  Item.CompanyCodeCurrency AS CompanyCodeCurrency,
  Item.TransactionCurrency AS TransactionCurrency,
  PaymentMethod.BG_SAFTPaymentMethod AS BG_SAFTPaymentMethod,
  Bkpf.TaxReportingDate AS TaxReportingDate,
  cast (Bkpf.ExchangeRate as bgsaft_exchange_rate) AS ExchangeRate
FROM I_JournalEntryItem AS Item
INNER JOIN I_OperationalAcctgDocItem AS Bseg ON /* join condition not captured in parsed metadata */
INNER JOIN I_JournalEntry AS Bkpf ON /* join condition not captured in parsed metadata */
INNER JOIN I_BG_SAFTPaymentMethod AS PaymentMethod ON /* join condition not captured in parsed metadata */
;