P_PH_SalesPurchasesSummaryItem

DDL: P_PH_SALESPURCHASESSUMMARYITEM SQL: PPHSLSP Type: view COMPOSITE Package: GLO_FIN_IS_VAT_PH

PH Sales Purchase Summary

P_PH_SalesPurchasesSummaryItem is a Composite CDS View that provides data about "PH Sales Purchase Summary" in SAP S/4HANA. It reads from 2 data sources (I_FiscalYearPeriodForCmpnyCode, I_StRpTaxItemLog) and exposes 37 fields with key fields CompanyCode, AccountingDocument, FiscalYear, StatryRptgEntity, StatryRptCategory. It has 4 associations to related views. Part of development package GLO_FIN_IS_VAT_PH.

Data Sources (2)

SourceAliasJoin Type
I_FiscalYearPeriodForCmpnyCode FiscalYearPeriodForCmpnyCode left_outer
I_StRpTaxItemLog TaxItem from

Parameters (1)

NameTypeDefault
P_CompanyCode fis_bukrs

Associations (4)

CardinalityTargetAliasCondition
[0..1] I_CalendarDate _CalendarDate $projection.PostingDate = _CalendarDate.CalendarDate
[0..1] I_Customer_to_BusinessPartner _CustomerToBusinessPartner $projection.BusinessPartner = _CustomerToBusinessPartner.Customer
[0..1] I_Supplier_to_BusinessPartner _SupplierToBusinessPartner $projection.BusinessPartner = _SupplierToBusinessPartner.Supplier
[0..*] I_JournalEntryItemOneTimeData _OneTimeAccountBP _OneTimeAccountBP.CompanyCode = TaxItem.CompanyCode and $projection.AccountingDocument = _OneTimeAccountBP.AccountingDocument and $projection.FiscalYear = _OneTimeAccountBP.FiscalYear

Annotations (6)

NameValueLevelField
AbapCatalog.sqlViewName PPHSLSP view
VDM.viewType #COMPOSITE view
VDM.private true view
AbapCatalog.compiler.compareFilter true view
Metadata.ignorePropagatedAnnotations true view
AccessControl.authorizationCheck #NOT_REQUIRED view

Fields (37)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode I_StRpTaxItemLog CompanyCode Receiver Company Code
KEY AccountingDocument I_StRpTaxItemLog AccountingDocument Journal Entry
KEY FiscalYear I_StRpTaxItemLog FiscalYear G/L Fiscal Year
KEY StatryRptgEntity I_StRpTaxItemLog StatryRptgEntity Reporting Entity
KEY StatryRptCategory I_StRpTaxItemLog StatryRptCategory Report ID
KEY StatryRptRunID I_StRpTaxItemLog StatryRptRunID Report Run ID
KEY TaxItem I_StRpTaxItemLog TaxItem Tax Item
KEY TaxItemGroupingVersion I_StRpTaxItemLog TaxItemGroupingVersion Tax Grping Ver.
KEY TransactionTypeDetermination I_StRpTaxItemLog TransactionTypeDetermination Transaction Key
KEY TaxCode I_StRpTaxItemLog TaxCode Tax Code
KEY TaxBox I_StRpTaxItemLog TaxBox Tax.Bs.Gp.No.
KEY ValidFrom I_StRpTaxItemLog ValidFrom Vers.Valid From
KEY TaxBoxStructureType I_StRpTaxItemLog TaxBoxStructureType
KEY TaxGroup I_StRpTaxItemLog TaxGroup Tax Group
FiscalPeriod I_StRpTaxItemLog FiscalPeriod Tax period
PostingDate I_StRpTaxItemLog PostingDate Posting Date for GR
ReportingDate I_StRpTaxItemLog ReportingDate
DocumentDate I_StRpTaxItemLog DocumentDate Journal Entry Date
LastDayOfMonthDate _CalendarDate LastDayOfMonthDate Last Day of Month
TaxRate I_StRpTaxItemLog TaxRate Tax Rate
TaxType I_StRpTaxItemLog TaxType Tax Type
FiscalPeriodEndDate I_FiscalYearPeriodForCmpnyCode FiscalPeriodEndDate
GLAccount I_StRpTaxItemLog GLAccount General Ledger
BusinessPlace BusinessPlace Business place
SupplierendasBusinessPartner
TaxNumber1endendasVATRegistration
CountryendasBusinessPartnerCountry
FirstNameendasFirstName
MiddleNameendasMiddleName
LastNameendasLastName
TaxAmountInCoCodeCrcy I_StRpTaxItemLog TaxAmountInRptgCrcy Tax Rept. Crcy
AmountInReportingCurrency AmountInReportingCurrency
currency I_StRpTaxItemLog ReportingCurrency Currency
EndDateMonth
_SupplierToBusinessPartner _SupplierToBusinessPartner
_CustomerToBusinessPartner _CustomerToBusinessPartner
_OneTimeAccountBP _OneTimeAccountBP

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_PH_SalesPurchasesSummaryItem.
-- 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: PPHSLSP
-- Parameters: P_CompanyCode : fis_bukrs

CREATE VIEW P_PH_SalesPurchasesSummaryItem AS
SELECT
  TaxItem.CompanyCode AS CompanyCode,
  TaxItem.AccountingDocument AS AccountingDocument,
  TaxItem.FiscalYear AS FiscalYear,
  TaxItem.StatryRptgEntity AS StatryRptgEntity,
  TaxItem.StatryRptCategory AS StatryRptCategory,
  TaxItem.StatryRptRunID AS StatryRptRunID,
  TaxItem.TaxItem AS TaxItem,
  TaxItem.TaxItemGroupingVersion AS TaxItemGroupingVersion,
  TaxItem.TransactionTypeDetermination AS TransactionTypeDetermination,
  TaxItem.TaxCode AS TaxCode,
  TaxItem.TaxBox AS TaxBox,
  TaxItem.ValidFrom AS ValidFrom,
  TaxItem.TaxBoxStructureType AS TaxBoxStructureType,
  TaxItem.TaxGroup AS TaxGroup,
  TaxItem.FiscalPeriod AS FiscalPeriod,
  TaxItem.PostingDate AS PostingDate,
  TaxItem.ReportingDate AS ReportingDate,
  TaxItem.DocumentDate AS DocumentDate,
  _CalendarDate.LastDayOfMonthDate AS LastDayOfMonthDate,
  TaxItem.TaxRate AS TaxRate,
  TaxItem.TaxType AS TaxType,
  FiscalYearPeriodForCmpnyCode.FiscalPeriodEndDate AS FiscalPeriodEndDate,
  TaxItem.GLAccount AS GLAccount,
  BusinessPlace,
  case when _CustomerSupplierLineItem.Customer <> '' then _CustomerSupplierLineItem.Customer when _CustomerSupplierLineItem.Supplier <> '' then _CustomerSupplierLineItem.Supplier end as BusinessPartner AS SupplierendasBusinessPartner,
  case when _CustomerSupplierLineItem.Customer <> '' then case when _OneTimeAccountBP.TaxID3 <> '' or _CustomerSupplierLineItem._Customer.TaxNumber3 <> '' then coalesce(_OneTimeAccountBP.TaxID3 ,_CustomerSupplierLineItem._Customer.TaxNumber3) else coalesce(_OneTimeAccountBP.TaxID1 ,_CustomerSupplierLineItem._Customer.TaxNumber1) end when _CustomerSupplierLineItem.Supplier <> '' then case when _OneTimeAccountBP.TaxID3 <> '' or _CustomerSupplierLineItem._Supplier.TaxNumber3 <> '' then coalesce(_OneTimeAccountBP.TaxID3, _CustomerSupplierLineItem._Supplier.TaxNumber3) else coalesce(_OneTimeAccountBP.TaxID1, _CustomerSupplierLineItem._Supplier.TaxNumber1) end end as VATRegistration AS TaxNumber1endendasVATRegistration,
  case when _CustomerSupplierLineItem.Customer <> '' then coalesce(_OneTimeAccountBP.Country, _CustomerSupplierLineItem._Customer.Country) when _CustomerSupplierLineItem.Supplier <> '' then coalesce(_OneTimeAccountBP.Country, _CustomerSupplierLineItem._Supplier.Country) end as BusinessPartnerCountry AS CountryendasBusinessPartnerCountry,
  case when _CustomerSupplierLineItem.Customer <> '' then coalesce(_OneTimeAccountBP.BusinessPartnerName1 ,_CustomerSupplierLineItem._Customer._CustomerToBusinessPartner._BusinessPartner.FirstName) when _CustomerSupplierLineItem.Supplier <> '' then coalesce(_OneTimeAccountBP.BusinessPartnerName1 ,_CustomerSupplierLineItem._Supplier._SupplierToBusinessPartner._BusinessPartner.FirstName) end as FirstName AS FirstNameendasFirstName,
  case when _CustomerSupplierLineItem.Customer <> '' then coalesce(_OneTimeAccountBP.BusinessPartnerName2 ,_CustomerSupplierLineItem._Customer._CustomerToBusinessPartner._BusinessPartner.MiddleName) when _CustomerSupplierLineItem.Supplier <> '' then coalesce(_OneTimeAccountBP.BusinessPartnerName2 ,_CustomerSupplierLineItem._Supplier._SupplierToBusinessPartner._BusinessPartner.MiddleName) end as MiddleName AS MiddleNameendasMiddleName,
  case when _CustomerSupplierLineItem.Customer <> '' then coalesce(_OneTimeAccountBP.BusinessPartnerName3 ,_CustomerSupplierLineItem._Customer._CustomerToBusinessPartner._BusinessPartner.LastName) when _CustomerSupplierLineItem.Supplier <> '' then coalesce(_OneTimeAccountBP.BusinessPartnerName3 ,_CustomerSupplierLineItem._Supplier._SupplierToBusinessPartner._BusinessPartner.LastName) end as LastName AS LastNameendasLastName,
  TaxItem.TaxAmountInRptgCrcy AS TaxAmountInCoCodeCrcy,
  AmountInReportingCurrency,
  TaxItem.ReportingCurrency AS currency,
  substring(FiscalYearPeriodForCmpnyCode.FiscalYearEndDate,5,2) AS EndDateMonth
FROM I_StRpTaxItemLog AS TaxItem
LEFT OUTER JOIN I_FiscalYearPeriodForCmpnyCode AS FiscalYearPeriodForCmpnyCode ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN I_CalendarDate AS _CalendarDate ON PostingDate = _CalendarDate.CalendarDate  -- association [0..1]
LEFT OUTER JOIN I_Customer_to_BusinessPartner AS _CustomerToBusinessPartner ON BusinessPartner = _CustomerToBusinessPartner.Customer  -- association [0..1]
LEFT OUTER JOIN I_Supplier_to_BusinessPartner AS _SupplierToBusinessPartner ON BusinessPartner = _SupplierToBusinessPartner.Supplier  -- association [0..1]
LEFT OUTER JOIN I_JournalEntryItemOneTimeData AS _OneTimeAccountBP ON _OneTimeAccountBP.CompanyCode = TaxItem.CompanyCode AND AccountingDocument = _OneTimeAccountBP.AccountingDocument AND FiscalYear = _OneTimeAccountBP.FiscalYear  -- association [0..*]
;