C_StRpDocLineItemWthRefDoc
Tax Items with Reference Accounting Documents
C_StRpDocLineItemWthRefDoc is a Consumption CDS View that provides data about "Tax Items with Reference Accounting Documents" in SAP S/4HANA. It reads from 5 data sources (I_StRpBillingWithRefAcctgDoc, I_JournalEntry, I_JournalEntryItemOneTimeData, C_StRpVATReturnDocLineItem, I_TaxCode) and exposes 82 fields with key fields StatryRptgEntity, StatryRptCategory, StatryRptRunID, CompanyCode, FiscalYear. It has 4 associations to related views.
Data Sources (5)
| Source | Alias | Join Type |
|---|---|---|
| I_StRpBillingWithRefAcctgDoc | _Bill | left_outer |
| I_JournalEntry | _journalentry | left_outer |
| I_JournalEntryItemOneTimeData | _OneTimeAccountBP | left_outer |
| C_StRpVATReturnDocLineItem | C_StRpVATReturnDocLineItem | from |
| I_TaxCode | I_TaxCode | inner |
Parameters (3)
| Name | Type | Default |
|---|---|---|
| P_StatryRptgEntity | srf_reporting_entity | |
| P_StatryRptCategory | srf_rep_cat_id | |
| P_StatryRptRunID | srf_report_run_id |
Associations (4)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [0..1] | I_Supplier | _Supplier | $projection.Supplier = _Supplier.Supplier |
| [0..1] | I_Customer | _Customer | $projection.Customer = _Customer.Customer |
| [0..1] | I_Product | _Product | $projection.Material = _Product.Product |
| [0..*] | I_ProductDescription | _ProductText | $projection.Material = _ProductText.Product |
Annotations (11)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | CSRLINEITMWTHREF | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| AccessControl.authorizationCheck | #CHECK | view | |
| VDM.viewType | #CONSUMPTION | view | |
| ClientHandling.algorithm | #SESSION_VARIABLE | view | |
| ObjectModel.usageType.sizeCategory | #XL | view | |
| ObjectModel.usageType.serviceQuality | #D | view | |
| ObjectModel.usageType.dataClass | #MIXED | view | |
| AccessControl.personalData.blocking | #BLOCKED_DATA_INCLUDED | view | |
| AbapCatalog.preserveKey | true | view | |
| EndUserText.label | Tax Items with Reference Accounting Documents | view |
Fields (82)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | StatryRptgEntity | C_StRpVATReturnDocLineItem | StatryRptgEntity | Reporting Entity |
| KEY | StatryRptCategory | C_StRpVATReturnDocLineItem | StatryRptCategory | Report ID |
| KEY | StatryRptRunID | C_StRpVATReturnDocLineItem | StatryRptRunID | Report Run ID |
| KEY | CompanyCode | C_StRpVATReturnDocLineItem | CompanyCode | Receiver Company Code |
| KEY | FiscalYear | C_StRpVATReturnDocLineItem | FiscalYear | G/L Fiscal Year |
| KEY | AccountingDocument | C_StRpVATReturnDocLineItem | AccountingDocument | Journal Entry |
| KEY | AccountingDocumentItem | C_StRpVATReturnDocLineItem | AccountingDocumentItem | Posting View Item |
| KEY | DocumentItemNumber | C_StRpVATReturnDocLineItem | DocumentItemNumber | Item |
| SupplierInvoice | SupplierInvoice | |||
| SupplierInvoiceItem | SupplierInvoiceItem | |||
| BillingDocument | C_StRpVATReturnDocLineItem | BillingDocument | SD Document | |
| BillingDocumentItem | C_StRpVATReturnDocLineItem | BillingDocumentItem | Item | |
| TaxCode | C_StRpVATReturnDocLineItem | TaxCode | Tax Code | |
| TaxType | I_TaxCode | TaxType | Tax Type | |
| TaxItemGroup | TaxItemGroup | Tax doc. item number | ||
| AccountingDocumentType | C_StRpVATReturnDocLineItem | AccountingDocumentType | Journal Entry Type | |
| AccountingDocumentItemType | AccountingDocumentItemType | Line Item ID | ||
| ReferenceDocumentType | C_StRpVATReturnDocLineItem | ReferenceDocumentType | Reference Document Type | |
| TransactionTypeDetermination | TransactionTypeDetermination | Transaction Key | ||
| PostingKey | PostingKey | Posting Key | ||
| DebitCreditCodeendasDebitCreditCode | ||||
| DebitCreditCodeIsChanged | DebitCreditCodeIsChanged | |||
| GLAccount | GLAccount | General Ledger | ||
| FinancialAccountType | FinancialAccountType | Fin. Account Type | ||
| AccountType | AccountType | Accounting Type(dtl) | ||
| FiscalPeriod | C_StRpVATReturnDocLineItem | FiscalPeriod | Tax period | |
| ReportingDate | ReportingDate | |||
| PostingDate | C_StRpVATReturnDocLineItem | PostingDate | Posting Date for GR | |
| DocumentDate | C_StRpVATReturnDocLineItem | DocumentDate | Journal Entry Date | |
| DocumentCurrency | C_StRpVATReturnDocLineItem | DocumentCurrency | Document Currency | |
| CompanyCodeCurrency | C_StRpVATReturnDocLineItem | CompanyCodeCurrency | Local Currency | |
| ReportingCurrency | C_StRpVATReturnDocLineItem | ReportingCurrency | Currency | |
| CountryCurrency | C_StRpVATReturnDocLineItem | CountryCurrency | Currency | |
| AdditionalCurrency1 | C_StRpVATReturnDocLineItem | AdditionalCurrency1 | Local curr. 2 | |
| AdditionalCurrency2 | C_StRpVATReturnDocLineItem | AdditionalCurrency2 | Local curr. 3 | |
| Material | Material | Vehicle Model | ||
| DocumentItemText | DocumentItemText | Text | ||
| QuantityInActlPostg | QuantityInActlPostg | |||
| QuantityUnit | QuantityUnit | Unit of measure | ||
| TaxRate | TaxRate | Tax Rate | ||
| OriginalReferenceDocument | C_StRpVATReturnDocLineItem | OriginalReferenceDocument | Reference Key | |
| BusinessArea | BusinessArea | Business Area | ||
| Supplier | Supplier | Supplier | ||
| Customer | Customer | Sold-to Party | ||
| SupplierAccountGroup | _Supplier | SupplierAccountGroup | Account group | |
| ReportingCountry | ReportingCountry | |||
| CompanyCodeCountry | CompanyCodeCountry | Reporting Ctry/Reg. | ||
| TaxNumber1 | ||||
| TaxNumber2 | ||||
| TaxNumber3 | ||||
| BusinessPartnerName | ||||
| HouseNumber | ||||
| StreetAddressName | ||||
| CityName | ||||
| BusinessPartnerCountry | ||||
| PostalCode | ||||
| BusinessPartnerasBusinessPartner | ||||
| IsNaturalPerson | ||||
| ReverseDocument | C_StRpVATReturnDocLineItem | ReverseDocument | Reversed With | |
| ReverseDocumentFiscalYear | C_StRpVATReturnDocLineItem | ReverseDocumentFiscalYear | Year | |
| InvoiceReference | InvoiceReference | Invoice Reference | ||
| InvoiceReferenceFiscalYear | InvoiceReferenceFiscalYear | Invoice Reference Fiscal Year | ||
| ReferenceDocumentNumber | ReferenceDocumentNumber | |||
| ReferenceDocumentFiscalYear | ReferenceDocumentFiscalYear | Year Cur.Period | ||
| DistributedTaxAmountInCCrcy | DistributedTaxAmountInCCrcy | |||
| DistrdTaxBaseAmountInCCrcy | DistrdTaxBaseAmountInCCrcy | |||
| DistributedTaxAmountInTC | DistributedTaxAmountInTC | |||
| DistrdTaxBaseAmountInTransCrcy | DistrdTaxBaseAmountInTransCrcy | |||
| DistributedTaxAmtInCountryCrcy | DistributedTaxAmtInCountryCrcy | |||
| DistrdTaxBaseAmountInCntryCrcy | DistrdTaxBaseAmountInCntryCrcy | |||
| DistrdTaxAmountInAddlCrcy1 | DistrdTaxAmountInAddlCrcy1 | |||
| DistrdTaxBaseAmountInAddlCrcy1 | DistrdTaxBaseAmountInAddlCrcy1 | |||
| DistrdTaxAmountInAddlCrcy2 | DistrdTaxAmountInAddlCrcy2 | |||
| DistrdTaxBaseAmountInAddlCrcy2 | DistrdTaxBaseAmountInAddlCrcy2 | |||
| CashDiscountBaseAmount | C_StRpVATReturnDocLineItem | CashDiscountBaseAmount | Cash Dscnt Base Amt | |
| CashDiscountAmount | C_StRpVATReturnDocLineItem | CashDiscountAmount | CD Amount | |
| TaxRateValidityStartDate | C_StRpVATReturnDocLineItem | TaxRateValidityStartDate | Tax Rate Validity Start Date | |
| DocumentReferenceID | C_StRpVATReturnDocLineItem | DocumentReferenceID | Reference | |
| _Supplier | _Supplier | |||
| _Customer | _Customer | |||
| _Product | _Product | |||
| _ProductText | _ProductText |
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_StRpDocLineItemWthRefDoc.
-- 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: CSRLINEITMWTHREF
-- Parameters: P_StatryRptgEntity : srf_reporting_entity, P_StatryRptCategory : srf_rep_cat_id, P_StatryRptRunID : srf_report_run_id
CREATE VIEW C_StRpDocLineItemWthRefDoc AS
SELECT
C_StRpVATReturnDocLineItem.StatryRptgEntity AS StatryRptgEntity,
C_StRpVATReturnDocLineItem.StatryRptCategory AS StatryRptCategory,
C_StRpVATReturnDocLineItem.StatryRptRunID AS StatryRptRunID,
C_StRpVATReturnDocLineItem.CompanyCode AS CompanyCode,
C_StRpVATReturnDocLineItem.FiscalYear AS FiscalYear,
C_StRpVATReturnDocLineItem.AccountingDocument AS AccountingDocument,
C_StRpVATReturnDocLineItem.AccountingDocumentItem AS AccountingDocumentItem,
C_StRpVATReturnDocLineItem.DocumentItemNumber AS DocumentItemNumber,
SupplierInvoice,
SupplierInvoiceItem,
C_StRpVATReturnDocLineItem.BillingDocument AS BillingDocument,
C_StRpVATReturnDocLineItem.BillingDocumentItem AS BillingDocumentItem,
C_StRpVATReturnDocLineItem.TaxCode AS TaxCode,
I_TaxCode.TaxType AS TaxType,
TaxItemGroup,
C_StRpVATReturnDocLineItem.AccountingDocumentType AS AccountingDocumentType,
AccountingDocumentItemType,
C_StRpVATReturnDocLineItem.ReferenceDocumentType AS ReferenceDocumentType,
TransactionTypeDetermination,
PostingKey,
case when C_StRpVATReturnDocLineItem.DebitCreditCodeIsChanged <> '' and C_StRpVATReturnDocLineItem.DebitCreditCode = 'H' then 'S' when C_StRpVATReturnDocLineItem.DebitCreditCodeIsChanged <> '' and C_StRpVATReturnDocLineItem.DebitCreditCode = 'S' then 'H' else C_StRpVATReturnDocLineItem.DebitCreditCode end as DebitCreditCode AS DebitCreditCodeendasDebitCreditCode,
DebitCreditCodeIsChanged,
GLAccount,
FinancialAccountType,
AccountType,
C_StRpVATReturnDocLineItem.FiscalPeriod AS FiscalPeriod,
ReportingDate,
C_StRpVATReturnDocLineItem.PostingDate AS PostingDate,
C_StRpVATReturnDocLineItem.DocumentDate AS DocumentDate,
C_StRpVATReturnDocLineItem.DocumentCurrency AS DocumentCurrency,
C_StRpVATReturnDocLineItem.CompanyCodeCurrency AS CompanyCodeCurrency,
C_StRpVATReturnDocLineItem.ReportingCurrency AS ReportingCurrency,
C_StRpVATReturnDocLineItem.CountryCurrency AS CountryCurrency,
C_StRpVATReturnDocLineItem.AdditionalCurrency1 AS AdditionalCurrency1,
C_StRpVATReturnDocLineItem.AdditionalCurrency2 AS AdditionalCurrency2,
Material,
DocumentItemText,
QuantityInActlPostg,
QuantityUnit,
TaxRate,
C_StRpVATReturnDocLineItem.OriginalReferenceDocument AS OriginalReferenceDocument,
BusinessArea,
Supplier,
Customer,
_Supplier.SupplierAccountGroup AS SupplierAccountGroup,
ReportingCountry,
CompanyCodeCountry,
coalesce( _OneTimeAccountBP.TaxID1, coalesce(_Customer.TaxNumber1, _Supplier.TaxNumber1)) AS TaxNumber1,
coalesce( _OneTimeAccountBP.TaxID2, coalesce(_Customer.TaxNumber2, _Supplier.TaxNumber2)) AS TaxNumber2,
coalesce( _OneTimeAccountBP.TaxID3, coalesce(_Customer.TaxNumber3, _Supplier.TaxNumber3)) AS TaxNumber3,
coalesce( _OneTimeAccountBP.BusinessPartnerName1, coalesce(_Customer.CustomerName, _Supplier.SupplierName)) AS BusinessPartnerName,
coalesce(_Customer._AddressRepresentation.HouseNumber, _Supplier._AddressRepresentation.HouseNumber) AS HouseNumber,
coalesce( _OneTimeAccountBP.StreetAddressName, coalesce(_Customer._AddressRepresentation.StreetName, _Supplier._AddressRepresentation.StreetName)) AS StreetAddressName,
coalesce( _OneTimeAccountBP.CityName, coalesce(_Customer._AddressRepresentation.CityName, _Supplier._AddressRepresentation.CityName)) AS CityName,
coalesce( _OneTimeAccountBP.Country, coalesce(_Customer._AddressRepresentation.Country,_Supplier._AddressRepresentation.Country )) AS BusinessPartnerCountry,
coalesce( _OneTimeAccountBP.PostalCode, coalesce(_Customer._AddressRepresentation.PostalCode,_Supplier._AddressRepresentation.PostalCode )) AS PostalCode,
coalesce(_Customer._CustomerToBusinessPartner._BusinessPartner.BusinessPartner, _Supplier._SupplierToBusinessPartner._BusinessPartner.BusinessPartner ) as BusinessPartner AS BusinessPartnerasBusinessPartner,
coalesce( _OneTimeAccountBP.IsNaturalPerson , coalesce(_Customer.NFPartnerIsNaturalPerson,_Supplier.IsNaturalPerson )) AS IsNaturalPerson,
C_StRpVATReturnDocLineItem.ReverseDocument AS ReverseDocument,
C_StRpVATReturnDocLineItem.ReverseDocumentFiscalYear AS ReverseDocumentFiscalYear,
InvoiceReference,
InvoiceReferenceFiscalYear,
ReferenceDocumentNumber,
ReferenceDocumentFiscalYear,
DistributedTaxAmountInCCrcy,
DistrdTaxBaseAmountInCCrcy,
DistributedTaxAmountInTC,
DistrdTaxBaseAmountInTransCrcy,
DistributedTaxAmtInCountryCrcy,
DistrdTaxBaseAmountInCntryCrcy,
DistrdTaxAmountInAddlCrcy1,
DistrdTaxBaseAmountInAddlCrcy1,
DistrdTaxAmountInAddlCrcy2,
DistrdTaxBaseAmountInAddlCrcy2,
C_StRpVATReturnDocLineItem.CashDiscountBaseAmount AS CashDiscountBaseAmount,
C_StRpVATReturnDocLineItem.CashDiscountAmount AS CashDiscountAmount,
C_StRpVATReturnDocLineItem.TaxRateValidityStartDate AS TaxRateValidityStartDate,
C_StRpVATReturnDocLineItem.DocumentReferenceID AS DocumentReferenceID
FROM C_StRpVATReturnDocLineItem
INNER JOIN I_TaxCode ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN I_StRpBillingWithRefAcctgDoc AS _Bill ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN I_JournalEntry AS _journalentry ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN I_JournalEntryItemOneTimeData AS _OneTimeAccountBP ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN I_Supplier AS _Supplier ON Supplier = _Supplier.Supplier -- association [0..1]
LEFT OUTER JOIN I_Customer AS _Customer ON Customer = _Customer.Customer -- association [0..1]
LEFT OUTER JOIN I_Product AS _Product ON Material = _Product.Product -- association [0..1]
LEFT OUTER JOIN I_ProductDescription AS _ProductText ON Material = _ProductText.Product -- association [0..*]
;
Learn More
- VDM (Virtual Data Model) in SAP S/4HANA Explained
- Types of CDS Views: Basic, Composite, Consumption, and Transactional
- CDS View Annotations — A Complete Guide
- What Is a CDS View in SAP S/4HANA?
- SAP Tables vs CDS Views — Key Differences
- Understanding Data Lineage in SAP S/4HANA
- CDS View Field Mapping and Associations
- Understanding the SAP S/4HANA Data Model
- CDS View Extensions and Custom Fields in SAP S/4HANA
- Released APIs and Stability Contracts in SAP S/4HANA
- BSEG to ACDOCA: The Universal Journal Migration
- Business Partner Migration: KNA1/LFA1 to BUT000
- Material Document Migration: MSEG/MKPF to MATDOC
- How to Find the Right CDS View for an SAP Table
- BW Extractor to CDS View Migration Guide
- S/4HANA CDS View Deprecation: What You Need to Know
- ABAP CDS View Tutorial — From Basics to Real-World Examples
- RAP and CDS Views — Building Transactional Apps in SAP S/4HANA
- Sales Document Status Migration: VBUP/VBUK Removal in S/4HANA
- CO Tables in S/4HANA: COEP, COBK, COSS, COSP to ACDOCA