P_RAContractPostedAmtAggr is a Composite CDS View in SAP S/4HANA. It reads from 1 data source (P_RAContractPostedAmt) and exposes 10 fields with key field RevenueAccountingContract.
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_RAContractPostedAmtAggr.-- 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.CREATE VIEW P_RAContractPostedAmtAggr ASSELECT
aggr.RevenueAccountingContract AS RevenueAccountingContract,
CompanyCode,
sum(case aggr.RevnAcctgPostingCategory when 'RV' then aggr.RevnAcctgPostgAmtInSlsDocCrcy * (-1) else abap.curr'0.00' end) as PostedRevnInSlsDocCrcy AS 00endasPostedRevnInSlsDocCrcy,
sum(case aggr.RevnAcctgPostingCategory when 'IC' then aggr.RevnAcctgPostgAmtInSlsDocCrcy else abap.curr'0.00' end) as PostedInvoiceInSlsDocCrcy AS 00endasPostedInvoiceInSlsDocCrcy,
sum(case aggr.RevnAcctgPostingCategory when 'CL' then aggr.RevnAcctgPostgAmtInSlsDocCrcy * (-1) else abap.curr'0.00' end) as RAContrLiabilitiesAmount AS 00endasRAContrLiabilitiesAmount,
sum(case aggr.RevnAcctgPostingCategory when 'CA' then aggr.RevnAcctgPostgAmtInSlsDocCrcy else abap.curr'0.00' end) as RAContractAssetsAmount AS 00endasRAContractAssetsAmount,
sum(case aggr.RevnAcctgPostingCategory when 'UR' then aggr.RevnAcctgPostgAmtInSlsDocCrcy else abap.curr'0.00' end) as RAPostedUnbilldRblsAmount AS 00endasRAPostedUnbilldRblsAmount,
sum(case aggr.RevnAcctgPostingCategory when 'DR' then aggr.RevnAcctgPostgAmtInSlsDocCrcy * (-1) else abap.curr'0.00' end) as RADeferredRevenueInSlsDocCrcy AS 00endasRADeferredRevenueInSlsDocCrcy,
sum(case aggr.RevnAcctgPostingCategory when 'RA' then aggr.RevnAcctgPostgAmtInSlsDocCrcy else abap.curr'0.00' end) as RARblAdjustmentAmtInSlsDocCrcy AS 00endasRARblAdjustmentAmtInSlsDocCrcy,
aggr.SalesDocumentCurrency AS SalesDocumentCurrency
FROM P_RAContractPostedAmt AS aggr
;