P_PrepaymentCMMContractAmount

DDL: P_PREPAYMENTCMMCONTRACTAMOUNT SQL: PPMGCTRCMMAMT Type: view COMPOSITE

P_PrepaymentCMMContractAmount is a Composite CDS View in SAP S/4HANA. It reads from 5 data sources (I_PreAgrmtTradingContractStat, I_PrepayWrkCtrAllowedDocTypes, I_PreAgrmtTradingContract, I_PreAgrmtTradingContractItem, I_PrepaymentMaterial) and exposes 20 fields with key fields PrepaymentAgrmtWorkCenterType, PrepaymentAgrmtRefDocumentCat, PrepaymentAgrmtRefBusObject, DocNumber, DocumentItemNumber. It has 1 association to related views.

Data Sources (5)

SourceAliasJoin Type
I_PreAgrmtTradingContractStat ContractApplicationStatus inner
I_PrepayWrkCtrAllowedDocTypes DocTypes from
I_PreAgrmtTradingContract Document inner
I_PreAgrmtTradingContractItem DocumentItem inner
I_PrepaymentMaterial Material inner

Associations (1)

CardinalityTargetAliasCondition
[0..1] P_PrepayDocVersLogPrcgValTC CMMPrice CMMPrice.PrepaymentAgrmtRefBusObject = 'BUS2124' and CMMPrice.PrepaymentDocumentNumber = Document.TradingContract and CMMPrice.PrepaymentDocumentItemNumber = DocumentItem.TradingContractItem and Material.Commodity is not initial

Annotations (10)

NameValueLevelField
AbapCatalog.sqlViewName PPMGCTRCMMAMT view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
AccessControl.authorizationCheck #NOT_REQUIRED view
ClientHandling.algorithm #SESSION_VARIABLE view
VDM.private true view
VDM.viewType #COMPOSITE view
ObjectModel.usageType.sizeCategory #L view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.dataClass #TRANSACTIONAL view

Fields (20)

KeyFieldSource TableSource FieldDescription
KEY PrepaymentAgrmtWorkCenterType I_PrepayWrkCtrAllowedDocTypes PrepaymentAgrmtWorkCenterType Dashboard Type
KEY PrepaymentAgrmtRefDocumentCat I_PrepayWrkCtrAllowedDocTypes PrepaymentAgrmtRefDocumentCat Document Category
KEY PrepaymentAgrmtRefBusObject
KEY DocNumber I_PreAgrmtTradingContract TradingContract Trading Contract
KEY DocumentItemNumber I_PreAgrmtTradingContractItem TradingContractItem Item Number
PurchasingDocumentItem
PrepaymentAgrmtRefDocument
CompanyCode I_PreAgrmtTradingContract CompanyCode Receiver Company Code
DocumentType I_PreAgrmtTradingContract TradingContractType Contract Type
PrepaymentTotalAmt
PrepaymentTotalAmtCrcy I_PreAgrmtTradingContractItem TrdgContrTotalNetAmountCrcy
PrepaymentWrkCtrDocPricingOptn CMMPrice PrepaymentWrkCtrDocPricingOptn
Counterparty I_PreAgrmtTradingContract Counterparty Supplier
TrdgContrApplicationStatus I_PreAgrmtTradingContract TrdgContrApplicationStatus Only Copy Appr.TC
PrepaymentRefDocItmValdFromDte I_PreAgrmtTradingContractItem PrepaymentRefDocItmValdFromDte Validity Start Date
PrepaymentRefDocItmValdToDte I_PreAgrmtTradingContractItem PrepaymentRefDocItmValdToDte Validity End Date
Material I_PreAgrmtTradingContractItem Material Vehicle Model
Commodity I_PrepaymentMaterial Commodity Commodity Code
OrderQuantity I_PreAgrmtTradingContractItem TradingContractItemQuantity
OrderQuantityUnit I_PreAgrmtTradingContractItem TrdgContractItemUnitOfMeasure

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_PrepaymentCMMContractAmount.
-- 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: PPMGCTRCMMAMT

CREATE VIEW P_PrepaymentCMMContractAmount AS
SELECT
  DocTypes.PrepaymentAgrmtWorkCenterType AS PrepaymentAgrmtWorkCenterType,
  DocTypes.PrepaymentAgrmtRefDocumentCat AS PrepaymentAgrmtRefDocumentCat,
  cast( 'BUS2124' as ppmgac_e_link_bus ) AS PrepaymentAgrmtRefBusObject,
  Document.TradingContract AS DocNumber,
  DocumentItem.TradingContractItem AS DocumentItemNumber,
  cast('00000' as abap.numc(5)) AS PurchasingDocumentItem,
  lpad( Document.TradingContract, 25, '0' ) AS PrepaymentAgrmtRefDocument,
  Document.CompanyCode AS CompanyCode,
  Document.TradingContractType AS DocumentType,
  cast( CMMPrice.PrepaymentTotalAmt as abap.curr(23,2) ) AS PrepaymentTotalAmt,
  DocumentItem.TrdgContrTotalNetAmountCrcy AS PrepaymentTotalAmtCrcy,
  CMMPrice.PrepaymentWrkCtrDocPricingOptn AS PrepaymentWrkCtrDocPricingOptn,
  Document.Counterparty AS Counterparty,
  Document.TrdgContrApplicationStatus AS TrdgContrApplicationStatus,
  DocumentItem.PrepaymentRefDocItmValdFromDte AS PrepaymentRefDocItmValdFromDte,
  DocumentItem.PrepaymentRefDocItmValdToDte AS PrepaymentRefDocItmValdToDte,
  DocumentItem.Material AS Material,
  Material.Commodity AS Commodity,
  DocumentItem.TradingContractItemQuantity AS OrderQuantity,
  DocumentItem.TrdgContractItemUnitOfMeasure AS OrderQuantityUnit
FROM I_PrepayWrkCtrAllowedDocTypes AS DocTypes
INNER JOIN I_PreAgrmtTradingContract AS Document ON /* join condition not captured in parsed metadata */
INNER JOIN I_PreAgrmtTradingContractStat AS ContractApplicationStatus ON /* join condition not captured in parsed metadata */
INNER JOIN I_PreAgrmtTradingContractItem AS DocumentItem ON /* join condition not captured in parsed metadata */
INNER JOIN I_PrepaymentMaterial AS Material ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN P_PrepayDocVersLogPrcgValTC AS CMMPrice ON CMMPrice.PrepaymentAgrmtRefBusObject = 'BUS2124' AND CMMPrice.PrepaymentDocumentNumber = Document.TradingContract AND CMMPrice.PrepaymentDocumentItemNumber = DocumentItem.TradingContractItem AND Material.Commodity is not initial  -- association [0..1]
;