P_POItemDwnPaytCalc1

DDL: P_POITEMDWNPAYTCALC1 SQL: PMMPOIDPCALC1 Type: view CONSUMPTION

Down Payment done Calc for PO Item

P_POItemDwnPaytCalc1 is a Consumption CDS View that provides data about "Down Payment done Calc for PO Item" in SAP S/4HANA. It reads from 2 data sources (I_PurchaseOrderItem, I_PurchaseOrderHistory) and exposes 13 fields with key fields PurchaseOrder, PurchaseOrderItem, AccountAssignmentNumber, PurchaseOrderTransactionType, MaterialDocumentYear. It has 1 association to related views.

Data Sources (2)

SourceAliasJoin Type
I_PurchaseOrderItem I_PurchaseOrderItem inner
I_PurchaseOrderHistory PurchaseOrderhistory from

Parameters (1)

NameTypeDefault
P_DisplayCurrency displaycurrency

Associations (1)

CardinalityTargetAliasCondition
[1..1] P_PODOWNPAYTBSEG _bseg I_PurchaseOrderItem.CompanyCode = _bseg.CompanyCode and PurchaseOrderhistory.MaterialDocument = _bseg.AccountingDocument and PurchaseOrderhistory.MaterialDocumentYear = _bseg.FiscalYear and PurchaseOrderhistory.MaterialDocumentItem = _bseg.MaterialDocumentItem and _bseg.FinancialAccountType = 'K'

Annotations (10)

NameValueLevelField
AbapCatalog.sqlViewName PMMPOIDPCALC1 view
VDM.private true view
VDM.viewType #CONSUMPTION view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #PRIVILEGED_ONLY view
ClientHandling.algorithm #SESSION_VARIABLE view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #L view
EndUserText.label Down Payment done Calc for PO Item view

Fields (13)

KeyFieldSource TableSource FieldDescription
KEY PurchaseOrder I_PurchaseOrderHistory PurchaseOrder Purchasing Document
KEY PurchaseOrderItem I_PurchaseOrderHistory PurchaseOrderItem Purchasing Document Item
KEY AccountAssignmentNumber I_PurchaseOrderHistory AccountAssignmentNumber Account Assgmt No.
KEY PurchaseOrderTransactionType I_PurchaseOrderHistory PurchaseOrderTransactionType Transact. Type
KEY MaterialDocumentYear I_PurchaseOrderHistory MaterialDocumentYear Material Document Year
KEY MaterialDocument I_PurchaseOrderHistory MaterialDocument Material Doc.
KEY MaterialDocumentItem
AmountInTransactionCurrency _bseg AmountInTransactionCurrency Pt Crcy Amt
DebitCreditCode DebitCreditCode Single-Character Flag
curr152endendasNetAmount
curr152endendasNetValue
curr152endendasNetAmountDocCurrency
curr152endendasNetValueDocCurrency

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_POItemDwnPaytCalc1.
-- 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: PMMPOIDPCALC1
-- Parameters: P_DisplayCurrency : displaycurrency

CREATE VIEW P_POItemDwnPaytCalc1 AS
SELECT
  PurchaseOrderhistory.PurchaseOrder AS PurchaseOrder,
  PurchaseOrderhistory.PurchaseOrderItem AS PurchaseOrderItem,
  PurchaseOrderhistory.AccountAssignmentNumber AS AccountAssignmentNumber,
  PurchaseOrderhistory.PurchaseOrderTransactionType AS PurchaseOrderTransactionType,
  PurchaseOrderhistory.MaterialDocumentYear AS MaterialDocumentYear,
  PurchaseOrderhistory.MaterialDocument AS MaterialDocument,
  cast(PurchaseOrderhistory.MaterialDocumentItem as abap.char( 4 )) AS MaterialDocumentItem,
  _bseg.AmountInTransactionCurrency AS AmountInTransactionCurrency,
  DebitCreditCode,
  case when PurchaseOrderTransactionType = 'A' and _bseg.ClearingAccountingDocument = ' ' and _bseg.AmountInTransactionCurrency is not initial then case when _bseg.xanet = '' then case when DebitCreditCode = 'H' then cast(currency_conversion( amount => _bseg.AmountInTransactionCurrency, source_currency => _bseg.TransactionCurrency, round => 'X', target_currency => $parameters.P_DisplayCurrency, exchange_rate_date => PostingDate, error_handling => 'SET_TO_NULL' ) as abap.curr(15,2)) else -1* cast (currency_conversion( amount => _bseg.AmountInTransactionCurrency, source_currency => _bseg.TransactionCurrency, round => 'X', target_currency => $parameters.P_DisplayCurrency, exchange_rate_date => PostingDate, error_handling => 'SET_TO_NULL' ) as abap.curr(15,2) ) end else cast(currency_conversion( amount => _bseg.GrossAmtInTransactionCurrency, source_currency => _bseg.TransactionCurrency, round => 'X', target_currency => $parameters.P_DisplayCurrency, exchange_rate_date => PostingDate, error_handling => 'SET_TO_NULL' ) as abap.curr(15,2)) end end as NetAmount AS curr152endendasNetAmount,
  case when PurchaseOrderTransactionType = '4' and _bseg.AmountInTransactionCurrency is not initial then case when _bseg.xanet = '' then cast(currency_conversion( amount => _bseg.AmountInTransactionCurrency, source_currency => _bseg.TransactionCurrency, round => 'X', target_currency => $parameters.P_DisplayCurrency, exchange_rate_date => PostingDate, error_handling => 'SET_TO_NULL' ) as abap.curr(15,2)) else cast(currency_conversion( amount => _bseg.GrossAmtInTransactionCurrency, source_currency => _bseg.TransactionCurrency, round => 'X', target_currency => $parameters.P_DisplayCurrency, exchange_rate_date => PostingDate, error_handling => 'SET_TO_NULL' ) as abap.curr(15,2)) end end as NetValue AS curr152endendasNetValue,
  case when PurchaseOrderTransactionType = 'A' and _bseg.ClearingAccountingDocument = ' ' and _bseg.AmountInTransactionCurrency is not initial then case when _bseg.xanet = '' then case when DebitCreditCode = 'H' then cast(currency_conversion( amount => _bseg.AmountInTransactionCurrency, source_currency => _bseg.TransactionCurrency, round => 'X', target_currency => I_PurchaseOrderItem.DocumentCurrency, exchange_rate_date => PostingDate, error_handling => 'SET_TO_NULL' ) as abap.curr(15,2)) else -1* cast (currency_conversion( amount => _bseg.AmountInTransactionCurrency, source_currency => _bseg.TransactionCurrency, round => 'X', target_currency => I_PurchaseOrderItem.DocumentCurrency, exchange_rate_date => PostingDate, error_handling => 'SET_TO_NULL' ) as abap.curr(15,2) ) end else cast(currency_conversion( amount => _bseg.GrossAmtInTransactionCurrency, source_currency => _bseg.TransactionCurrency, round => 'X', target_currency => I_PurchaseOrderItem.DocumentCurrency, exchange_rate_date => PostingDate, error_handling => 'SET_TO_NULL' ) as abap.curr(15,2)) end end as NetAmountDocCurrency AS curr152endendasNetAmountDocCurrency,
  case when PurchaseOrderTransactionType = '4' and _bseg.AmountInTransactionCurrency is not initial then case when _bseg.xanet = '' then cast(currency_conversion( amount => _bseg.AmountInTransactionCurrency, source_currency => _bseg.TransactionCurrency, round => 'X', target_currency => I_PurchaseOrderItem.DocumentCurrency, exchange_rate_date => PostingDate, error_handling => 'SET_TO_NULL' ) as abap.curr(15,2)) else cast(currency_conversion( amount => _bseg.GrossAmtInTransactionCurrency, source_currency => _bseg.TransactionCurrency, round => 'X', target_currency => I_PurchaseOrderItem.DocumentCurrency, exchange_rate_date => PostingDate, error_handling => 'SET_TO_NULL' ) as abap.curr(15,2)) end end as NetValueDocCurrency AS curr152endendasNetValueDocCurrency
FROM I_PurchaseOrderHistory AS PurchaseOrderhistory
INNER JOIN I_PurchaseOrderItem ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN P_PODOWNPAYTBSEG AS _bseg ON I_PurchaseOrderItem.CompanyCode = _bseg.CompanyCode AND PurchaseOrderhistory.MaterialDocument = _bseg.AccountingDocument AND PurchaseOrderhistory.MaterialDocumentYear = _bseg.FiscalYear AND PurchaseOrderhistory.MaterialDocumentItem = _bseg.MaterialDocumentItem AND _bseg.FinancialAccountType = 'K'  -- association [1..1]
;