Deprecated
This CDS view is deprecated in S/4HANA. View all deprecated CDS views →

C_ID_StRpVATOut

DDL: C_ID_STRPVATOUT SQL: CIDSRVATOUT Type: view CONSUMPTION

ID VAT OUT Statutory Report view

C_ID_StRpVATOut is a Consumption CDS View that provides data about "ID VAT OUT Statutory Report view" in SAP S/4HANA. It reads from 2 data sources (I_AcctDocCustomer, I_AccountingDocument) and exposes 40 fields with key fields CompanyCode, FiscalYear, AccountingDocument, TaxBoxStrucValidityStartDate, TaxBoxStructureType. It has 2 associations to related views.

Data Sources (2)

SourceAliasJoin Type
I_AcctDocCustomer _AccDocCust inner
I_AccountingDocument I_AccountingDocument from

Associations (2)

CardinalityTargetAliasCondition
[0..1] I_Customer _Customer $projection.Customer = _Customer.Customer
[1..1] I_ID_StRpTaxItemGrp _TaxItem $projection.CompanyCode = _TaxItem.CompanyCode and $projection.FiscalYear = _TaxItem.FiscalYear and $projection.AccountingDocument = _TaxItem.AccountingDocument

Annotations (10)

NameValueLevelField
AbapCatalog.sqlViewName CIDSRVATOUT view
VDM.viewType #CONSUMPTION view
AbapCatalog.compiler.compareFilter true view
AccessControl.personalData.blocking #BLOCKED_DATA_INCLUDED view
AccessControl.authorizationCheck #CHECK view
ObjectModel.usageType.sizeCategory #XL view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.dataClass #MIXED view
EndUserText.label ID VAT OUT Statutory Report view view
VDM.lifecycle.status #DEPRECATED view

Fields (40)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode I_AccountingDocument CompanyCode Receiver Company Code
KEY FiscalYear I_AccountingDocument FiscalYear G/L Fiscal Year
KEY AccountingDocument I_AccountingDocument AccountingDocument Journal Entry
KEY TaxBoxStrucValidityStartDate _TaxItem TaxBoxStrucValidityStartDate
KEY TaxBoxStructureType _TaxItem TaxBoxStructureType
AccountingDocumentType AccountingDocumentType Journal Entry Type
ReferenceDocumentType ReferenceDocumentType Reference Document Type
BusinessPlace I_AcctDocCustomer BusinessPlace Business place
FiscalPeriod
DocumentDate
PostingDate PostingDate Posting Date for GR
TransactionCode TransactionCode Transaction Code
DocumentReferenceID
BillingDocument
Customer Customer Sold-to Party
VATRegistration _Customer VATRegistration VAT Registration No.
TaxNumber1
CustomerName
AddressLine1
BPTaxNumber
CustomerFullName
AddressLine2
District
Building
HouseNumber
HouseNumberSupplementText
StreetName
StreetPrefixName
AdditionalStreetPrefixName
StreetSuffixName
CityName
Region
PostalCode
CompanyCodeCurrency CompanyCodeCurrency Local Currency
TaxableAmount
TaxAmount
LuxuryTaxAmt
DownPaytTaxableAmt
DownPaymentTaxAmount
LuxuryTaxDownPaytAmt

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 C_ID_StRpVATOut.
-- 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: CIDSRVATOUT

CREATE VIEW C_ID_StRpVATOut AS
SELECT
  I_AccountingDocument.CompanyCode AS CompanyCode,
  I_AccountingDocument.FiscalYear AS FiscalYear,
  I_AccountingDocument.AccountingDocument AS AccountingDocument,
  _TaxItem.TaxBoxStrucValidityStartDate AS TaxBoxStrucValidityStartDate,
  _TaxItem.TaxBoxStructureType AS TaxBoxStructureType,
  AccountingDocumentType,
  ReferenceDocumentType,
  _AccDocCust.BusinessPlace AS BusinessPlace,
  ltrim( FiscalPeriod, '0') AS FiscalPeriod,
  concat(substring(DocumentDate, 7, 2),concat('/', concat(substring(DocumentDate, 5, 2),concat('/', substring(DocumentDate, 1, 4))))) AS DocumentDate,
  PostingDate,
  TransactionCode,
  substring(DocumentReferenceID, 4, 16) AS DocumentReferenceID,
  substring(OriginalReferenceDocument, 1, 10) AS BillingDocument,
  Customer,
  _Customer.VATRegistration AS VATRegistration,
  replace(replace( _Customer.TaxNumber1, '.', '' ),'-','') AS TaxNumber1,
  replace(_Customer.CustomerName, ',', ' ' ) AS CustomerName,
  replace(concat_with_space( concat_with_space( concat_with_space( concat_with_space(_Customer._AddressRepresentation.HouseNumber, _Customer.CityName, 1), _Customer._AddressRepresentation.Region, 1), _Customer._AddressRepresentation.PostalCode, 1), _Customer.Country,1), ',', ' ' ) AS AddressLine1,
  case when _Customer.TaxNumber1 != '' then concat(concat('"', _Customer.TaxNumber1),'"') else '' end AS BPTaxNumber,
  case when _Customer.CustomerName != '' then concat(concat('"', _Customer.CustomerName),'"') else '' end AS CustomerFullName,
  case when (_Customer._AddressRepresentation.HouseNumber = '' and _Customer.CityName = '' and _Customer._AddressRepresentation.Region = '' and _Customer._AddressRepresentation.PostalCode = '' and _Customer.Country = '') then '' else concat_with_space( concat_with_space( concat_with_space( concat_with_space(_Customer._AddressRepresentation.HouseNumber, _Customer.CityName, 1), _Customer._AddressRepresentation.Region, 1), _Customer._AddressRepresentation.PostalCode, 1), _Customer.Country,1) end AS AddressLine2,
  case when _Customer._AddressRepresentation.DistrictName != '' then concat(concat('"', _Customer._AddressRepresentation.DistrictName),'"') else '' end AS District,
  _Customer._AddressRepresentation.Building AS Building,
  case when _Customer._AddressRepresentation.HouseNumber != '' then concat(concat('"', _Customer._AddressRepresentation.HouseNumber),'"') else '' end AS HouseNumber,
  case when _Customer._AddressRepresentation.HouseNumberSupplementText != '' then concat(concat('"', _Customer._AddressRepresentation.HouseNumberSupplementText),'"') else '' end AS HouseNumberSupplementText,
  case when _Customer._AddressRepresentation.StreetName != '' then concat(concat('"', _Customer._AddressRepresentation.StreetName),'"') else '' end AS StreetName,
  case when _Customer._AddressRepresentation.StreetName != '' then concat(concat('"', _Customer._AddressRepresentation.StreetName),'"') else '' end AS StreetPrefixName,
  case when _Customer._AddressRepresentation.StreetName != '' then concat(concat('"', _Customer._AddressRepresentation.StreetName),'"') else '' end AS AdditionalStreetPrefixName,
  _Customer._AddressRepresentation.StreetName AS StreetSuffixName,
  case when _Customer._AddressRepresentation.CityName != '' then concat(concat('"', _Customer._AddressRepresentation.CityName),'"') else '' end AS CityName,
  case when _Customer._AddressRepresentation.Region != '' then concat(concat('"', _Customer._AddressRepresentation.Region),'"') else '' end AS Region,
  case when _Customer._AddressRepresentation.PostalCode != '' then concat(concat('"', _Customer._AddressRepresentation.PostalCode),'"') else '' end AS PostalCode,
  CompanyCodeCurrency,
  abs(_TaxItem.TaxableAmount) AS TaxableAmount,
  abs(_TaxItem.TaxAmount) AS TaxAmount,
  abs(_TaxItem.LuxuryTaxAmt) AS LuxuryTaxAmt,
  abs(_TaxItem.DownPaytTaxableAmt) AS DownPaytTaxableAmt,
  abs(_TaxItem.DownPaymentTaxAmount) AS DownPaymentTaxAmount,
  abs(_TaxItem.LuxuryTaxDownPaytAmt) AS LuxuryTaxDownPaytAmt
FROM I_AccountingDocument
INNER JOIN I_AcctDocCustomer AS _AccDocCust ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN I_Customer AS _Customer ON Customer = _Customer.Customer  -- association [0..1]
LEFT OUTER JOIN I_ID_StRpTaxItemGrp AS _TaxItem ON CompanyCode = _TaxItem.CompanyCode AND FiscalYear = _TaxItem.FiscalYear AND AccountingDocument = _TaxItem.AccountingDocument  -- association [1..1]
;