P_EBWIP_ProductionCost2 is a Composite CDS View in SAP S/4HANA. It reads from 2 data sources (I_LedgerCompanyCodeCrcyRoles, P_EBWIP_ProductionCost1) and exposes 3 fields with key fields CompanyCode, OrderID, OrderItem.
@AbapCatalog.sqlViewName: 'PEBWIPPRODC2'
@AbapCatalog.compiler.compareFilter: true@AbapCatalog.preserveKey:true@AccessControl.authorizationCheck: #NOT_REQUIRED@ClientHandling.algorithm: #SESSION_VARIABLE@VDM.viewType: #COMPOSITE@VDM.private: truedefineview P_EBWIP_ProductionCost2
withparameters@Environment.systemField: #SYSTEM_DATE
P_KeyDate : datum,
P_Ledger : fins_ledger,
P_CurrencyRole : fis_curtp
asselectfrom P_EBWIP_ProductionCost1( P_KeyDate : :P_KeyDate,
P_Ledger : :P_Ledger ) as _ProductionCost
innerjoin I_LedgerCompanyCodeCrcyRoles as _LedgerCompanyCodeCrcyRole on _LedgerCompanyCodeCrcyRole.CompanyCode = _ProductionCost.CompanyCode
and _LedgerCompanyCodeCrcyRole.Ledger = :P_Ledger
{
key _ProductionCost.CompanyCode,
key OrderID,
key OrderItem,
// Produced Amount from ACDOCA by Currency Role
cast(
case :P_CurrencyRole
when CompanyCodeCurrencyRole then AmountInCompanyCodeCurrency
when GlobalCurrencyRole then AmountInGlobalCurrency
when FreeDefinedCurrency1Role then AmountInFreeDefinedCurrency1
when FreeDefinedCurrency2Role then AmountInFreeDefinedCurrency2
when FreeDefinedCurrency3Role then AmountInFreeDefinedCurrency3
when FreeDefinedCurrency4Role then AmountInFreeDefinedCurrency4
when FreeDefinedCurrency5Role then AmountInFreeDefinedCurrency5
when FreeDefinedCurrency6Role then AmountInFreeDefinedCurrency6
when FreeDefinedCurrency7Role then AmountInFreeDefinedCurrency7
when FreeDefinedCurrency8Role then AmountInFreeDefinedCurrency8
else 0
endas farp_amount_display_crcy) as AmountInDisplayCurrency
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_LEDGERCOMPANYCODECRCYROLES",
"P_EBWIP_PRODUCTIONCOST1"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/