P_EBOrderSplitVarianceCost2 is a Composite CDS View in SAP S/4HANA. It reads from 2 data sources (I_LedgerCompanyCodeCrcyRoles, P_EBOrderSplitVarianceCost1) and exposes 4 fields with key fields CompanyCode, OrderID, OrderItem, SubLedgerAcctLineItemType.
@AbapCatalog.sqlViewName: 'PEBORDSVRCCS2'
@AbapCatalog.compiler.compareFilter: true@AbapCatalog.preserveKey: true@AccessControl.authorizationCheck: #NOT_REQUIRED@ClientHandling.algorithm: #SESSION_VARIABLE@VDM.private: true@VDM.viewType: #COMPOSITEdefineview P_EBOrderSplitVarianceCost2
withparameters
P_Ledger : fins_ledger,
P_FromFiscalYearPeriod : fins_fyearperiod,
P_ToFiscalYearPeriod : fins_fyearperiod,
P_CurrencyRole : fis_curtp
asselectfrom P_EBOrderSplitVarianceCost1( P_Ledger : :P_Ledger,
P_FromFiscalYearPeriod: :P_FromFiscalYearPeriod,
P_ToFiscalYearPeriod : :P_ToFiscalYearPeriod ) as SplitVarcCost
innerjoin I_LedgerCompanyCodeCrcyRoles as _LedgerCompanyCodeCrcyRole on _LedgerCompanyCodeCrcyRole.CompanyCode = SplitVarcCost.CompanyCode
and _LedgerCompanyCodeCrcyRole.Ledger = :P_Ledger
{
key SplitVarcCost.CompanyCode,
key OrderID,
key OrderItem,
key SubLedgerAcctLineItemType,
// Split Variance Amounts from ACDOCA
cast(
case :P_CurrencyRole
when _LedgerCompanyCodeCrcyRole.CompanyCodeCurrencyRole then AmountInCompanyCodeCurrency
when _LedgerCompanyCodeCrcyRole.GlobalCurrencyRole then AmountInGlobalCurrency
when _LedgerCompanyCodeCrcyRole.FreeDefinedCurrency1Role then AmountInFreeDefinedCurrency1
when _LedgerCompanyCodeCrcyRole.FreeDefinedCurrency2Role then AmountInFreeDefinedCurrency2
when _LedgerCompanyCodeCrcyRole.FreeDefinedCurrency3Role then AmountInFreeDefinedCurrency3
when _LedgerCompanyCodeCrcyRole.FreeDefinedCurrency4Role then AmountInFreeDefinedCurrency4
when _LedgerCompanyCodeCrcyRole.FreeDefinedCurrency5Role then AmountInFreeDefinedCurrency5
when _LedgerCompanyCodeCrcyRole.FreeDefinedCurrency6Role then AmountInFreeDefinedCurrency6
when _LedgerCompanyCodeCrcyRole.FreeDefinedCurrency7Role then AmountInFreeDefinedCurrency7
when _LedgerCompanyCodeCrcyRole.FreeDefinedCurrency8Role then AmountInFreeDefinedCurrency8
else 0
endas farp_amount_display_crcy) as AmountInDisplayCurrency
}