P_PrepayBarterRefDocAmtDetTC
Prepayment Barter Doc Amount Details
P_PrepayBarterRefDocAmtDetTC is a Composite CDS View that provides data about "Prepayment Barter Doc Amount Details" in SAP S/4HANA. It reads from 1 data source (P_PrepayBarterRefDocTotAmtTC) and exposes 28 fields with key fields PrepaymentAgrmtWorkCenterType, PrepaymentAgrmtRefDocumentCat, PrepaymentAgrmtRefBusObject, DocNumber, DocumentItemNumber. It has 2 associations to related views.
Data Sources (1)
| Source | Alias | Join Type |
|---|---|---|
| P_PrepayBarterRefDocTotAmtTC | DocTotAmt | from |
Parameters (2)
| Name | Type | Default |
|---|---|---|
| P_Currency | waers | |
| P_Date | dats |
Associations (2)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [0..1] | I_PrepayBarterTrdgContrLinkAmt | Barter_TCDocAmt | Barter_TCDocAmt.DocNumber = $projection.PrepaymentAgrmtRefDocument and Barter_TCDocAmt.DocumentItemNumber = $projection.DocumentItemNumber -- Exchange Rates |
| [0..1] | P_PrepaymentRefDocExchangeRate | XRate | XRate.ExchangeRateType = 'M' and XRate.SourceCurrency = DocTotAmt.PrepaymentTotalAmtCrcy and XRate.TargetCurrency = $parameters.P_Currency |
Annotations (8)
| Name | Value | Level | Field |
|---|---|---|---|
| AccessControl.authorizationCheck | #NOT_REQUIRED | view | |
| VDM.private | true | view | |
| VDM.viewType | #COMPOSITE | view | |
| ObjectModel.usageType.sizeCategory | #XL | view | |
| ObjectModel.usageType.serviceQuality | #D | view | |
| ObjectModel.usageType.dataClass | #MIXED | view | |
| Metadata.ignorePropagatedAnnotations | true | view | |
| EndUserText.label | Prepayment Barter Doc Amount Details | view |
Fields (28)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | PrepaymentAgrmtWorkCenterType | P_PrepayBarterRefDocTotAmtTC | PrepaymentAgrmtWorkCenterType | |
| KEY | PrepaymentAgrmtRefDocumentCat | P_PrepayBarterRefDocTotAmtTC | PrepaymentAgrmtRefDocumentCat | |
| KEY | PrepaymentAgrmtRefBusObject | P_PrepayBarterRefDocTotAmtTC | PrepaymentAgrmtRefBusObject | Business Object Type |
| KEY | DocNumber | P_PrepayBarterRefDocTotAmtTC | DocNumber | Document Number |
| KEY | DocumentItemNumber | P_PrepayBarterRefDocTotAmtTC | DocumentItemNumber | Item |
| PrepaymentAgrmtRefDocument | P_PrepayBarterRefDocTotAmtTC | PrepaymentAgrmtRefDocument | Linking Document No. | |
| Material | P_PrepayBarterRefDocTotAmtTC | Material | Vehicle Model | |
| TrdgContrApplicationStatus | P_PrepayBarterRefDocTotAmtTC | TrdgContrApplicationStatus | ||
| Commodity | P_PrepayBarterRefDocTotAmtTC | Commodity | Commodity Code | |
| TradingContractItemQuantity | P_PrepayBarterRefDocTotAmtTC | TradingContractItemQuantity | ||
| TrdgContractItemUnitOfMeasure | P_PrepayBarterRefDocTotAmtTC | TrdgContractItemUnitOfMeasure | ||
| PurchasingDocumentItem | P_PrepayBarterRefDocTotAmtTC | PurchasingDocumentItem | Purchasing Doc. Item | |
| CompanyCode | P_PrepayBarterRefDocTotAmtTC | CompanyCode | Receiver Company Code | |
| Counterparty | P_PrepayBarterRefDocTotAmtTC | Counterparty | Supplier | |
| DocumentType | P_PrepayBarterRefDocTotAmtTC | DocumentType | Order Type | |
| PrepaymentTotalAmtCrcy | ||||
| dec232asPrepaymentTotalAmt | ||||
| PrepaymentAgreementAmount | P_PrepayBarterRefDocTotAmtTC | PrepaymentTotalAmt | ||
| PrepaymentAgreementCurrency | P_PrepayBarterRefDocTotAmtTC | PrepaymentTotalAmtCrcy | ||
| PrepaymentTotalAmtIsFixedPrice | P_PrepayBarterRefDocTotAmtTC | PrepaymentTotalAmtIsFixedPrice | ||
| curr232asPrepaymentAgrmtLinkAmount | ||||
| PrepaymentAgreement | ||||
| PrepaymentDocumentItemNumber | ||||
| char4endasExchangeRateType | ||||
| datsendasExchangeRateDate | ||||
| char4endasAlternativeExchangeRateType | ||||
| PrepaymentRequestDocNumber | ||||
| Barter_TCDocAmt | Barter_TCDocAmt |
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_PrepayBarterRefDocAmtDetTC.
-- 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.
-- Parameters: P_Currency : waers, P_Date : dats
CREATE VIEW P_PrepayBarterRefDocAmtDetTC AS
SELECT
DocTotAmt.PrepaymentAgrmtWorkCenterType AS PrepaymentAgrmtWorkCenterType,
DocTotAmt.PrepaymentAgrmtRefDocumentCat AS PrepaymentAgrmtRefDocumentCat,
DocTotAmt.PrepaymentAgrmtRefBusObject AS PrepaymentAgrmtRefBusObject,
DocTotAmt.DocNumber AS DocNumber,
DocTotAmt.DocumentItemNumber AS DocumentItemNumber,
DocTotAmt.PrepaymentAgrmtRefDocument AS PrepaymentAgrmtRefDocument,
DocTotAmt.Material AS Material,
DocTotAmt.TrdgContrApplicationStatus AS TrdgContrApplicationStatus,
DocTotAmt.Commodity AS Commodity,
DocTotAmt.TradingContractItemQuantity AS TradingContractItemQuantity,
DocTotAmt.TrdgContractItemUnitOfMeasure AS TrdgContractItemUnitOfMeasure,
DocTotAmt.PurchasingDocumentItem AS PurchasingDocumentItem,
DocTotAmt.CompanyCode AS CompanyCode,
DocTotAmt.Counterparty AS Counterparty,
DocTotAmt.DocumentType AS DocumentType,
$parameters.P_Currency AS PrepaymentTotalAmtCrcy,
cast( case when DocTotAmt.PrepaymentTotalAmtCrcy <> $parameters.P_Currency then currency_conversion(amount => curr_to_decfloat_amount(DocTotAmt.PrepaymentTotalAmt), source_currency => DocTotAmt.PrepaymentTotalAmtCrcy, target_currency => $parameters.P_Currency, exchange_rate_date => $parameters.P_Date, error_handling => 'SET_TO_NULL') when DocTotAmt.PrepaymentTotalAmtCrcy = $parameters.P_Currency then curr_to_decfloat_amount( DocTotAmt.PrepaymentTotalAmt ) else 0 end as abap.dec(23,2) ) as PrepaymentTotalAmt AS dec232asPrepaymentTotalAmt,
DocTotAmt.PrepaymentTotalAmt AS PrepaymentAgreementAmount,
DocTotAmt.PrepaymentTotalAmtCrcy AS PrepaymentAgreementCurrency,
DocTotAmt.PrepaymentTotalAmtIsFixedPrice AS PrepaymentTotalAmtIsFixedPrice,
cast(cast(coalesce(curr_to_decfloat_amount(Barter_TCDocAmt(P_Currency : $parameters.P_Currency, P_Date : $parameters.P_Date).PrepaymentAgrmtLinkAmount), 0) as abap.dec(23,2)) as abap.curr(23,2)) as PrepaymentAgrmtLinkAmount AS curr232asPrepaymentAgrmtLinkAmount,
Barter_TCDocAmt(P_Currency : $parameters.P_Currency, P_Date : $parameters.P_Date).PrepaymentAgreement AS PrepaymentAgreement,
Barter_TCDocAmt(P_Currency : $parameters.P_Currency, P_Date : $parameters.P_Date).PrepaymentDocumentItemNumber AS PrepaymentDocumentItemNumber,
case when DocTotAmt.PrepaymentTotalAmtCrcy <> $parameters.P_Currency then cast('M' as abap.char(4)) else cast(' ' as abap.char(4)) end as ExchangeRateType AS char4endasExchangeRateType,
case when DocTotAmt.PrepaymentTotalAmtCrcy <> $parameters.P_Currency then cast($parameters.P_Date as abap.dats) else cast('00000000' as abap.dats) end as ExchangeRateDate AS datsendasExchangeRateDate,
case when DocTotAmt.PrepaymentTotalAmtCrcy <> $parameters.P_Currency then XRate(P_Date : $parameters.P_Date).ExchangeRate.AlternativeExchangeRateType else cast(' ' as abap.char(4)) end as AlternativeExchangeRateType AS char4endasAlternativeExchangeRateType,
coalesce(PaymentTerms.PrepaymentRequestDocNumber, '') AS PrepaymentRequestDocNumber,
Barter_TCDocAmt
FROM P_PrepayBarterRefDocTotAmtTC AS DocTotAmt
LEFT OUTER JOIN I_PrepayBarterTrdgContrLinkAmt AS Barter_TCDocAmt ON Barter_TCDocAmt.DocNumber = PrepaymentAgrmtRefDocument AND Barter_TCDocAmt.DocumentItemNumber = DocumentItemNumber -- association [0..1]
LEFT OUTER JOIN P_PrepaymentRefDocExchangeRate AS XRate ON XRate.ExchangeRateType = 'M' AND XRate.SourceCurrency = DocTotAmt.PrepaymentTotalAmtCrcy AND XRate.TargetCurrency = $parameters.P_Currency -- association [0..1]
;
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