P_RU_VatSalesPurchaseLedgers1

DDL: P_RU_VATSALESPURCHASELEDGERS1 SQL: PRUVATSPLD1 Type: view CONSUMPTION

P_RU_VatSalesPurchaseLedgers1 is a Consumption CDS View in SAP S/4HANA. It reads from 1 data source (I_RU_StRpJournalEntryLog) and exposes 41 fields. It has 1 association to related views.

Data Sources (1)

SourceAliasJoin Type
I_RU_StRpJournalEntryLog Main from

Parameters (3)

NameTypeDefault
P_StatryRptgEntity srf_reporting_entity
P_StatryRptCategory srf_rep_cat_id
P_StatryRptRunID srf_report_run_id

Associations (1)

CardinalityTargetAliasCondition
[0..1] I_TaxBasisBalancesGrp _TaxBasisBalancesGrp _TaxBasisBalancesGrp.Country = 'RU' and _TaxBasisBalancesGrp.TaxItemGroupingVersion = 'PAY' and _TaxBasisBalancesGrp.TaxCode = VatSPLedgerCust.TaxCode

Annotations (5)

NameValueLevelField
VDM.private true view
VDM.viewType #CONSUMPTION view
AbapCatalog.sqlViewName PRUVATSPLD1 view
ClientHandling.algorithm #SESSION_VARIABLE view
AccessControl.authorizationCheck #NOT_REQUIRED view

Fields (41)

KeyFieldSource TableSource FieldDescription
CompanyCode AccountingDocument CompanyCode Receiver Company Code
AccountingDocument AccountingDocument AccountingDocument Journal Entry
FiscalYear AccountingDocument FiscalYear G/L Fiscal Year
PostingDate AccountingDocument PostingDate Posting Date for GR
ReverseDocument AccountingDocument ReverseDocument Reversed With
ReverseDocumentFiscalYear AccountingDocument ReverseDocumentFiscalYear Year
OriginalReferenceDocument AccountingDocument OriginalReferenceDocument Reference Key
ReferenceDocumentType AccountingDocument ReferenceDocumentType Reference Document Type
DocumentReferenceID AccountingDocument DocumentReferenceID Reference
CompanyCodeCurrency AccountingDocument CompanyCodeCurrency Local Currency
Currency AccountingDocument Currency Valuation Crcy
TaxReportingDate AccountingDocument TaxReportingDate Tax Reporting Date
BusinessTransactionType AccountingDocument BusinessTransactionType Bus.transaction
IsReversal AccountingDocument IsReversal Reversal doc.
IsReversed AccountingDocument IsReversed Reversed?
TaxCode TaxItem TaxCode Tax Code
TaxRate TaxItem TaxRate Tax Rate
TaxCodeelseendasWithoutTax
DocumentDate AccountingDocument DocumentDate Journal Entry Date
RU_VATSubScenario VatSPLedgerCust RU_VATSubScenario Subscenario
RU_VATScenario VatSPLedgerCust RU_VATScenario VAT Scenario
RU_VATReturnSection VatSPLedgerCust RU_VATReturnSection VAT Return Section
RU_VATReturnSectionType VatSPLedgerCust RU_VATReturnSectionType Section Type
RU_VATSubScenarioVersion VatSPLedgerCust RU_VATSubScenarioVersion Subscenario Version
RU_VATReturnVersion VatSPLedgerCust RU_VATReturnVersion VAT Return Version
BusinessPartnerType VatSPLedgerCust BusinessPartnerType Undefined range (can be used for patch levels)
PaymentOrderOutputType VatSPLedgerCust PaymentOrderOutputType
ImprtCstmsDeclnIsRead VatSPLedgerCust ImprtCstmsDeclnIsRead
RU_TaxBaseAmountCalcType VatSPLedgerCust RU_TaxBaseAmountCalcType
AgentType VatSPLedgerCust AgentType
RU_OrgOperationType VatSPLedgerCust RU_OrgOperationType
RU_PersonOperationType VatSPLedgerCust RU_PersonOperationType
MatlRcptDateIsRead VatSPLedgerCust MatlRcptDateIsRead
SelectedDocument TaxItem AccountingDocument Journal Entry
TaxSumHW TaxItem TaxAmountInCoCodeCrcy Tax Amount in Company Code Currency
TaxSumFW TaxItem TaxAmount Tax Amt in Rptg Crcy
IsCorrectionInvoice VatSPLedgerCust IsCorrectionInvoice
OriginalDocument I_RU_StRpJournalEntryLog SourceDocument Document
OriginalDocumentYear I_RU_StRpJournalEntryLog SourceDocumentFiscalYear Orig. Doc. Year
RevisionNumber I_RU_StRpJournalEntryLog RevisionNumber Revision Number
ActionRuleIsGenerated

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_RU_VatSalesPurchaseLedgers1.
-- 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: PRUVATSPLD1
-- Parameters: P_StatryRptgEntity : srf_reporting_entity, P_StatryRptCategory : srf_rep_cat_id, P_StatryRptRunID : srf_report_run_id

CREATE VIEW P_RU_VatSalesPurchaseLedgers1 AS
SELECT
  AccountingDocument.CompanyCode AS CompanyCode,
  AccountingDocument.AccountingDocument AS AccountingDocument,
  AccountingDocument.FiscalYear AS FiscalYear,
  AccountingDocument.PostingDate AS PostingDate,
  AccountingDocument.ReverseDocument AS ReverseDocument,
  AccountingDocument.ReverseDocumentFiscalYear AS ReverseDocumentFiscalYear,
  AccountingDocument.OriginalReferenceDocument AS OriginalReferenceDocument,
  AccountingDocument.ReferenceDocumentType AS ReferenceDocumentType,
  AccountingDocument.DocumentReferenceID AS DocumentReferenceID,
  AccountingDocument.CompanyCodeCurrency AS CompanyCodeCurrency,
  AccountingDocument.Currency AS Currency,
  AccountingDocument.TaxReportingDate AS TaxReportingDate,
  AccountingDocument.BusinessTransactionType AS BusinessTransactionType,
  AccountingDocument.IsReversal AS IsReversal,
  AccountingDocument.IsReversed AS IsReversed,
  TaxItem.TaxCode AS TaxCode,
  TaxItem.TaxRate AS TaxRate,
  case when TaxItem.TaxRate = 0.00 or TaxItem.TaxRate is null then _TaxBasisBalancesGrp.TaxCode else '' end as WithoutTax AS TaxCodeelseendasWithoutTax,
  AccountingDocument.DocumentDate AS DocumentDate,
  VatSPLedgerCust.RU_VATSubScenario AS RU_VATSubScenario,
  VatSPLedgerCust.RU_VATScenario AS RU_VATScenario,
  VatSPLedgerCust.RU_VATReturnSection AS RU_VATReturnSection,
  VatSPLedgerCust.RU_VATReturnSectionType AS RU_VATReturnSectionType,
  VatSPLedgerCust.RU_VATSubScenarioVersion AS RU_VATSubScenarioVersion,
  VatSPLedgerCust.RU_VATReturnVersion AS RU_VATReturnVersion,
  VatSPLedgerCust.BusinessPartnerType AS BusinessPartnerType,
  VatSPLedgerCust.PaymentOrderOutputType AS PaymentOrderOutputType,
  VatSPLedgerCust.ImprtCstmsDeclnIsRead AS ImprtCstmsDeclnIsRead,
  VatSPLedgerCust.RU_TaxBaseAmountCalcType AS RU_TaxBaseAmountCalcType,
  VatSPLedgerCust.AgentType AS AgentType,
  VatSPLedgerCust.RU_OrgOperationType AS RU_OrgOperationType,
  VatSPLedgerCust.RU_PersonOperationType AS RU_PersonOperationType,
  VatSPLedgerCust.MatlRcptDateIsRead AS MatlRcptDateIsRead,
  TaxItem.AccountingDocument AS SelectedDocument,
  TaxItem.TaxAmountInCoCodeCrcy AS TaxSumHW,
  TaxItem.TaxAmount AS TaxSumFW,
  VatSPLedgerCust.IsCorrectionInvoice AS IsCorrectionInvoice,
  Main.SourceDocument AS OriginalDocument,
  Main.SourceDocumentFiscalYear AS OriginalDocumentYear,
  Main.RevisionNumber AS RevisionNumber,
  '0' AS ActionRuleIsGenerated
FROM I_RU_StRpJournalEntryLog AS Main
LEFT OUTER JOIN I_TaxBasisBalancesGrp AS _TaxBasisBalancesGrp ON _TaxBasisBalancesGrp.Country = 'RU' AND _TaxBasisBalancesGrp.TaxItemGroupingVersion = 'PAY' AND _TaxBasisBalancesGrp.TaxCode = VatSPLedgerCust.TaxCode  -- association [0..1]
;