P_RO_SAFTJournalEntryItem

DDL: P_RO_SAFTJOURNALENTRYITEM SQL: PROSAFTJRNENITM Type: view CONSUMPTION

P_RO_SAFTJournalEntryItem is a Consumption CDS View in SAP S/4HANA. It reads from 2 data sources (I_StRpJournalEntryHeaderLog, P_RO_SAFTJournalEntryItemExc) and exposes 58 fields with key fields StatryRptCategory, StatryRptgEntity, StatryRptRunID, SourceLedger, CompanyCode.

Data Sources (2)

SourceAliasJoin Type
I_StRpJournalEntryHeaderLog Log from
P_RO_SAFTJournalEntryItemExc P_RO_SAFTJournalEntryItemExc inner

Parameters (1)

NameTypeDefault
P_AlternativeGLAccountIsUsed saft_ro_alt_gl_account_flag

Annotations (11)

NameValueLevelField
AbapCatalog.sqlViewName PROSAFTJRNENITM view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
VDM.viewType #CONSUMPTION view
VDM.private true view
ObjectModel.usageType.serviceQuality #X view
ObjectModel.usageType.sizeCategory #XL view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
ClientHandling.algorithm #SESSION_VARIABLE view
AccessControl.personalData.blocking #BLOCKED_DATA_INCLUDED view
AccessControl.authorizationCheck #MANDATORY view

Fields (58)

KeyFieldSource TableSource FieldDescription
KEY StatryRptCategory I_StRpJournalEntryHeaderLog StatryRptCategory Report ID
KEY StatryRptgEntity I_StRpJournalEntryHeaderLog StatryRptgEntity Reporting Entity
KEY StatryRptRunID I_StRpJournalEntryHeaderLog StatryRptRunID Report Run ID
KEY SourceLedger Item SourceLedger Source Ledger
KEY CompanyCode Item CompanyCode Receiver Company Code
KEY FiscalYear Item FiscalYear G/L Fiscal Year
KEY AccountingDocument Item AccountingDocument Journal Entry
KEY LedgerGLLineItem Item LedgerGLLineItem Journal Entry Item
KEY Ledger Item Ledger Ledger
AccountingDocumentItem Item AccountingDocumentItem Posting View Item
FinancialAccountType Item FinancialAccountType Fin. Account Type
Customer Item Customer Sold-to Party
Supplier Item Supplier Supplier
DebitCreditCode Item DebitCreditCode Single-Character Flag
Product Item Product Product Sold
Plant Item Plant Valuation Area
TaxCode Item TaxCode Tax Code
TaxCountry Item TaxCountry Tax Ctry/Reg.
ChartOfAccounts Item ChartOfAccounts Node Class
ActiveChartOfAccounts Item ActiveChartOfAccounts
ActiveGLAccount Item ActiveGLAccount
GLAccount Item GLAccount General Ledger
GLAccountType Item GLAccountType G/L Account Type
CountryChartOfAccounts Item CountryChartOfAccounts Chart of Accts
AlternativeGLAccount Item AlternativeGLAccount Group Account
PostingDate Item PostingDate Posting Date for GR
DocumentDate Item DocumentDate Journal Entry Date
AccountingDocumentCreationDate
AccountingDocCreatedByUser
AccountingDocumentType Item AccountingDocumentType Journal Entry Type
ValueDate Item ValueDate Value Date
DocumentItemTextendasDocumentItemText
BaseUnit Item BaseUnit Unit of Measure
ControllingArea Item ControllingArea Controlling Area
ProfitCenter Item ProfitCenter Profit Center
_ProfitCenterTxt Item _ProfitCenterTxt
Segment Item Segment Segment number
_SegmentText Item _SegmentText
CostCenter Item CostCenter Cost Center
_CostCenterTxt Item _CostCenterTxt
OrderID Item OrderID Order ID
_Order Item _Order
WBSElement
WBSElementInternalID Item WBSElementInternalID WBS Internal ID
_WBSElementBasicDataText Item _WBSElementBasicDataText
TransactionTypeDetermination Item TransactionTypeDetermination Transaction Key
VATRegistrationendasCustomerTaxID5
VATRegistrationendasSupplierTaxID5
BusinessPartnerelseendasBusinessPartner
CompanyCodeCurrency Item CompanyCodeCurrency Local Currency
TransactionCurrency Item TransactionCurrency Transaction Currency
LogicalSystem Item LogicalSystem Logical System
VATRegistration
TaxType
RO_SAFTCustomerTaxType
RO_SAFTSupplierTaxType
_JournalEntry Item _JournalEntry
RO_SAFTStandardAccount Item RO_SAFTStandardAccount

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_RO_SAFTJournalEntryItem.
-- 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: PROSAFTJRNENITM
-- Parameters: P_AlternativeGLAccountIsUsed : saft_ro_alt_gl_account_flag

CREATE VIEW P_RO_SAFTJournalEntryItem AS
SELECT
  Log.StatryRptCategory AS StatryRptCategory,
  Log.StatryRptgEntity AS StatryRptgEntity,
  Log.StatryRptRunID AS StatryRptRunID,
  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.FinancialAccountType AS FinancialAccountType,
  Item.Customer AS Customer,
  Item.Supplier AS Supplier,
  Item.DebitCreditCode AS DebitCreditCode,
  Item.Product AS Product,
  Item.Plant AS Plant,
  Item.TaxCode AS TaxCode,
  Item.TaxCountry AS TaxCountry,
  Item.ChartOfAccounts AS ChartOfAccounts,
  Item.ActiveChartOfAccounts AS ActiveChartOfAccounts,
  Item.ActiveGLAccount AS ActiveGLAccount,
  Item.GLAccount AS GLAccount,
  Item.GLAccountType AS GLAccountType,
  Item.CountryChartOfAccounts AS CountryChartOfAccounts,
  Item.AlternativeGLAccount AS AlternativeGLAccount,
  Item.PostingDate AS PostingDate,
  Item.DocumentDate AS DocumentDate,
  Item._JournalEntry.AccountingDocumentCreationDate AS AccountingDocumentCreationDate,
  Item._JournalEntry.AccountingDocCreatedByUser AS AccountingDocCreatedByUser,
  Item.AccountingDocumentType AS AccountingDocumentType,
  Item.ValueDate AS ValueDate,
  case Item.DocumentItemText when '' then 'N.A' else Item.DocumentItemText end as DocumentItemText AS DocumentItemTextendasDocumentItemText,
  Item.BaseUnit AS BaseUnit,
  Item.ControllingArea AS ControllingArea,
  Item.ProfitCenter AS ProfitCenter,
  Item._ProfitCenterTxt AS _ProfitCenterTxt,
  Item.Segment AS Segment,
  Item._SegmentText AS _SegmentText,
  Item.CostCenter AS CostCenter,
  Item._CostCenterTxt AS _CostCenterTxt,
  Item.OrderID AS OrderID,
  Item._Order AS _Order,
  cast(Item.WBSElement as fis_wbs_no_conv) AS WBSElement,
  Item.WBSElementInternalID AS WBSElementInternalID,
  Item._WBSElementBasicDataText AS _WBSElementBasicDataText,
  Item.TransactionTypeDetermination AS TransactionTypeDetermination,
  case when Item.FinancialAccountType <> 'D' then '0' when Item.Customer <> '' and Bseg.VATRegistration <> '' and BsegStcegCountry.IsEuropeanUnionMember = 'X' then case when BsegStcegCountry.Country = 'RO' then replace(Bseg.VATRegistration, 'RO', '00') else cast(concat('01', Bseg.VATRegistration) as bptaxnumxl) end when Item.Customer = '' or CustomerTaxType.BPTaxLongNumber = 'EXCLUDE' then '0' when CustomerTaxType.BPTaxLongNumber <> '0' then CustomerTaxType.BPTaxLongNumber else OTC.VATRegistration end as CustomerTaxID5 AS VATRegistrationendasCustomerTaxID5,
  case when Item.FinancialAccountType <> 'K' then '0' when Item.Supplier <> '' and Bseg.VATRegistration <> '' and BsegStcegCountry.IsEuropeanUnionMember = 'X' then case when BsegStcegCountry.Country = 'RO' then replace(Bseg.VATRegistration, 'RO', '00') else cast(concat('01', Bseg.VATRegistration) as bptaxnumxl) end when Item.Supplier = '' or SupplierTaxType.BPTaxLongNumber = 'EXCLUDE' then '0' when SupplierTaxType.BPTaxLongNumber <> '0' then SupplierTaxType.BPTaxLongNumber else OTS.VATRegistration end as SupplierTaxID5 AS VATRegistrationendasSupplierTaxID5,
  case when Item.Customer <> '' and Item.FinancialAccountType = 'D' then Item._Customer._CustomerToBusinessPartner._BusinessPartner.BusinessPartner when Item.Supplier <> '' and Item.FinancialAccountType = 'K' then Item._Supplier._SupplierToBusinessPartner._BusinessPartner.BusinessPartner else '' end as BusinessPartner AS BusinessPartnerelseendasBusinessPartner,
  Item.CompanyCodeCurrency AS CompanyCodeCurrency,
  Item.TransactionCurrency AS TransactionCurrency,
  Item.LogicalSystem AS LogicalSystem,
  ' ' AS VATRegistration,
  ' ' AS TaxType,
  '0' AS RO_SAFTCustomerTaxType,
  '0' AS RO_SAFTSupplierTaxType,
  Item._JournalEntry AS _JournalEntry,
  Item.RO_SAFTStandardAccount AS RO_SAFTStandardAccount
FROM I_StRpJournalEntryHeaderLog AS Log
INNER JOIN P_RO_SAFTJournalEntryItemExc ON /* join condition not captured in parsed metadata */
;