@AbapCatalog.viewEnhancementCategory: [ #NONE ]
@AccessControl.authorizationCheck: #NOT_REQUIRED
@Consumption.dbHints: [ 'AGGR_TARGET(''ACDOCA'')' ]
//@EndUserText.label: 'GL Account Line Item Component Breakdown'
@Metadata.ignorePropagatedAnnotations: true
@ObjectModel.usageType: { serviceQuality: #C, sizeCategory: #XXL, dataClass: #TRANSACTIONAL }
@VDM.private: true
@VDM.viewType: #BASIC
define view entity P_GLAcctLineItemCompBreakdown
as select from I_GLAccountLineItemRawData as li
left outer to many join I_CompBrkdwnMethodAssgmt as mtd
on (li.SourceLedger = mtd.Ledger or mtd.Ledger = '++')
and (li.CompanyCode = mtd.CompanyCode or mtd.CompanyCode = '++++')
and li.PostingDate >= mtd.ValidityStartDate
and li.PostingDate <= mtd.ValidityEndDate
left outer to many join R_ComponentBreakdown as cb
on
mtd.ComponentBreakdownMethod = cb.ComponentBreakdownMethod
and li.SourceLedger = cb.Ledger
and li.ComponentBreakdown = cb.ComponentBreakdown
and li.CompanyCode = cb.CompanyCode // needed for filter pushdown
{
key li.SourceLedger,
key li.CompanyCode,
key li.FiscalYear,
key li.AccountingDocument,
key li.LedgerGLLineItem,
key li.ComponentBreakdown,
key mtd.ComponentBreakdownMethod as ComponentBreakdownMethod,
key cb.ComponentBreakdownComponent as ComponentBreakdownComponent,
mtd.ComponentBreakdownMethodType,
mtd._ComponentBreakdownMethod.CostBreakdownStructure,
coalesce(cb.CostBreakdownComponent, '') as CostBreakdownComponent,
mtd._ComponentBreakdownMethod.QuantityBreakdownStructure,
coalesce(cb.QuantityBreakdownComponent, '') as QuantityBreakdownComponent,
li.LedgerFiscalYear,
li.ChartOfAccounts,
li.ControllingArea,
li.FiscalPeriod,
li.FiscalYearPeriod,
li.PostingDate,
li.FiscalYearVariant,
li.AccountingDocumentType,
li.ReferenceDocument,
li.ReferenceDocumentType,
li.BusinessTransactionCategory,
li.BusinessTransactionType,
li.SubLedgerAcctLineItemType,
li.GLAccount,
li.FinancialAccountType,
li.PurchasingDocument,
li.PurchasingDocumentItem,
li.Plant,
li.Product,
li.CostEstimate,
li.InventoryValuationType,
li.ValuationArea,
cast(li.ControllingDebitCreditCode as fis_co_belkz_no_conv preserving type) as ControllingDebitCreditCode,
li.ControllingObjectDebitType,
li.AccountAssignmentType,
li.AccountAssignment,
li.PartnerAccountAssignmentType,
li.CostCenter,
li.CostCtrActivityType,
li.OriginCostCenter,
li.OriginCostCtrActivityType,
li.OrderID,
li.OrderItem,
li.OrderCategory,
li.WBSElementInternalID,
li.WBSElement,
li.ProjectInternalID,
li.Project,
li.ServiceDocumentType,
li.ServiceDocument,
li.ServiceDocumentItem,
li.CostOriginGroup,
li.BusinessArea,
li.FunctionalArea,
li.Segment,
li.SalesDocument,
li.SalesDocumentItem,
li.SalesOrganization,
li.SalesDistrict,
li.ShipToParty,
li.BillToParty,
li.DistributionChannel,
li.OrganizationDivision,
li.ProfitCenter,
li.SoldProduct,
li.SoldProductGroup,
li.Customer,
li.CustomerGroup,
// basic formula for calculation of scaled amounts or quantities
// scaling always happens for both total and fixed values
// scaled amount is set to target amount from ACDOCA in case of no breakdown exists or Scale Type T
// scaled amount is 0 in case of scale type Q as these are only used for quantity breakdown
// scaled amount = factor * ComponentPartialSumAmount - factor * (ComponentPartialSumAmount - Amount)
// factor = (Target Amount from ACCDOCA/ Scale Base Amount) in case of Scale Type A
// factor = (Target Amount in TransactionCurrency from ACCDOCA/ Scale Base Amount in TransactionCurrency) in case of Scale Type F
// factor = (ScaleNumerator from ACCDOCA / ScaleDenominator) in case of Scale Type ' '
// scaled quantity is set to 0 in case a breakdown is not given or for scale types A,F and T as these are used only for cost breakdowns
// scaled quantity = factor * quantity - factor * (quantity_ps - quantity)
// factor = (ScaleNumerator from ACCDOCA / ScaleDenominator) in case of Scale Type ' '
// factor = (target amt in cc crcy from ACCDOCA/ base amt in cc crcy) in case of Scale Type Q (factor is applied to all components)
cast(coalesce(cb.ComponentBreakdownQuantityUnit, cast('' as fucb_quantity_unit)) as fucb_quantity_unit preserving type)
as ComponentBreakdownQuantityUnit,
@Aggregation.default: #SUM
@Semantics.quantity.unitOfMeasure: 'ComponentBreakdownQuantityUnit'
case
when cb.ComponentBreakdown is null
or cb.ComponentBreakdownScaleType = 'A'
or cb.ComponentBreakdownScaleType = 'F'
or cb.ComponentBreakdownScaleType = 'T'
or cb.ComponentBreakdownQuantity = 0
then cast(0 as fucb_quantity)
when cb.ComponentBreakdownScaleType = 'Q'
then cast(round(cast(li.AmountInCompanyCodeCurrency as fucb_amount_dec23_2) / cb.ScaleBaseAmountInCoCodeCrcy * cb.CompBrkdwnPartialSumQuantity, 3)
- round(cast(li.AmountInCompanyCodeCurrency as fucb_amount_dec23_2) / cb.ScaleBaseAmountInCoCodeCrcy * (cb.CompBrkdwnPartialSumQuantity - cb.ComponentBreakdownQuantity), 3)
as fucb_quantity)
else
cast(round(cb.CompBrkdwnPartialSumQuantity / cb.CompBreakdownScaleDenominator * li.CompBreakdownScaleNumerator, 3)
- round((cb.CompBrkdwnPartialSumQuantity - cb.ComponentBreakdownQuantity) / cb.CompBreakdownScaleDenominator * li.CompBreakdownScaleNumerator, 3)
as fucb_quantity)
end as ComponentBreakdownQuantity,
@Aggregation.default: #SUM
@Semantics.quantity.unitOfMeasure: 'ComponentBreakdownQuantityUnit'
case
when cb.ComponentBreakdown is null
or cb.ComponentBreakdownScaleType = 'A'
or cb.ComponentBreakdownScaleType = 'F'
or cb.ComponentBreakdownScaleType = 'T'
or cb.ComponentBreakdownQuantity = 0
then cast(0 as fucb_fixed_quantity)
when cb.ComponentBreakdownScaleType = 'Q'
then cast(round(cast(li.AmountInCompanyCodeCurrency as fucb_amount_dec23_2) / cb.ScaleBaseAmountInCoCodeCrcy * cb.CompBrkdwnPartialSumFixedQty, 3)
- round(cast(li.AmountInCompanyCodeCurrency as fucb_amount_dec23_2) / cb.ScaleBaseAmountInCoCodeCrcy * (cb.CompBrkdwnPartialSumFixedQty - cb.CompBreakdownFixedQuantity), 3)
as fucb_fixed_quantity)
else
cast(round(li.CompBreakdownScaleNumerator / cb.CompBreakdownScaleDenominator * cb.CompBrkdwnPartialSumFixedQty, 3)
- round(li.CompBreakdownScaleNumerator / cb.CompBreakdownScaleDenominator * (cb.CompBrkdwnPartialSumFixedQty - cb.CompBreakdownFixedQuantity), 3)
as fucb_fixed_quantity)
end as CompBreakdownFixedQuantity,
cast(li.CompanyCodeCurrency as fis_hwaer preserving type) as CompanyCodeCurrency,
@Aggregation.default: #SUM
@Semantics.amount.currencyCode: 'CompanyCodeCurrency'
case
when cb.ComponentBreakdown is null or cb.ComponentBreakdownScaleType = 'T'
then li.AmountInCompanyCodeCurrency
when cb.ComponentBreakdownScaleType = 'Q'
then cast(0 as fis_hsl)
when cb.ComponentBreakdownScaleType = 'A'
then cast(round(cast(li.AmountInCompanyCodeCurrency as fucb_amount_dec23_2) / cb.ScaleBaseAmountInCoCodeCrcy * cb.PrtlSumAmountInCoCodeCrcy, 2)
- round(cast(li.AmountInCompanyCodeCurrency as fucb_amount_dec23_2) / cb.ScaleBaseAmountInCoCodeCrcy * (cb.PrtlSumAmountInCoCodeCrcy - cb.AmountInCompanyCodeCurrency), 2)
as fis_hsl)
when cb.ComponentBreakdownScaleType = 'F'
then cast(round(cast(li.AmountInCompanyCodeCurrency as fucb_amount_dec23_2) / cb.ScaleBaseAmountInTransCrcy * cb.PrtlSumAmountInTransCrcy, 2)
- round(cast(li.AmountInCompanyCodeCurrency as fucb_amount_dec23_2) / cb.ScaleBaseAmountInTransCrcy * (cb.PrtlSumAmountInTransCrcy - cb.AmountInTransactionCurrency), 2)
as fis_hsl)
else
cast(round(li.CompBreakdownScaleNumerator / cb.CompBreakdownScaleDenominator * cb.PrtlSumAmountInCoCodeCrcy, 2)
- round(li.CompBreakdownScaleNumerator / cb.CompBreakdownScaleDenominator * (cb.PrtlSumAmountInCoCodeCrcy - cb.AmountInCompanyCodeCurrency), 2)
as fis_hsl)
end as AmountInCompanyCodeCurrency,
@Aggregation.default: #SUM
@Semantics.amount.currencyCode: 'CompanyCodeCurrency'
case
when cb.ComponentBreakdown is null or cb.ComponentBreakdownScaleType = 'T'
then li.FixedAmountInCoCodeCrcy
when cb.ComponentBreakdownScaleType = 'Q'
then cast(0 as fis_hfsl)
when cb.ComponentBreakdownScaleType = 'A'
then cast(round(cast(li.AmountInCompanyCodeCurrency as fucb_amount_dec23_2) / cb.ScaleBaseAmountInCoCodeCrcy * cb.PrtlSumFxdAmountInCoCodeCrcy, 2)
- round(cast(li.AmountInCompanyCodeCurrency as fucb_amount_dec23_2) / cb.ScaleBaseAmountInCoCodeCrcy * (cb.PrtlSumFxdAmountInCoCodeCrcy - cb.FixedAmountInCoCodeCrcy), 2)
as fis_hfsl)
when cb.ComponentBreakdownScaleType = 'F'
then cast(round(cast(li.AmountInCompanyCodeCurrency as fucb_amount_dec23_2) / cb.ScaleBaseAmountInTransCrcy * cb.PrtlSumFxdAmountInTransCrcy, 2)
- round(cast(li.AmountInCompanyCodeCurrency as fucb_amount_dec23_2) / cb.ScaleBaseAmountInTransCrcy * (cb.PrtlSumFxdAmountInTransCrcy - cb.FixedAmountInTransCrcy), 2)
as fis_hfsl)
else
cast(round(li.CompBreakdownScaleNumerator / cb.CompBreakdownScaleDenominator * cb.PrtlSumFxdAmountInCoCodeCrcy, 2)
- round(li.CompBreakdownScaleNumerator / cb.CompBreakdownScaleDenominator * (cb.PrtlSumFxdAmountInCoCodeCrcy - cb.FixedAmountInCoCodeCrcy), 2)
as fis_hfsl)
end as FixedAmountInCoCodeCrcy,
cast(li.GlobalCurrency as fis_rkcur preserving type) as GlobalCurrency,
@Aggregation.default: #SUM
@Semantics.amount.currencyCode: 'GlobalCurrency'
case
when cb.ComponentBreakdown is null or cb.ComponentBreakdownScaleType = 'T'
then li.AmountInGlobalCurrency
when cb.ComponentBreakdownScaleType = 'Q'
then cast(0 as fis_ksl)
when cb.ComponentBreakdownScaleType = 'A'
then cast(round(cast(li.AmountInGlobalCurrency as fucb_amount_dec23_2) / cb.ScaleBaseAmountInGlobalCrcy * cb.PrtlSumAmountInGlobalCrcy, 2)
- round(cast(li.AmountInGlobalCurrency as fucb_amount_dec23_2) / cb.ScaleBaseAmountInGlobalCrcy * (cb.PrtlSumAmountInGlobalCrcy - cb.AmountInGlobalCurrency), 2)
as fis_ksl)
when cb.ComponentBreakdownScaleType = 'F'
then cast(round(cast(li.AmountInGlobalCurrency as fucb_amount_dec23_2) / cb.ScaleBaseAmountInTransCrcy * cb.PrtlSumAmountInTransCrcy, 2)
- round(cast(li.AmountInGlobalCurrency as fucb_amount_dec23_2) / cb.ScaleBaseAmountInTransCrcy * (cb.PrtlSumAmountInTransCrcy - cb.AmountInTransactionCurrency), 2)
as fis_ksl)
else
cast(round(li.CompBreakdownScaleNumerator / cb.CompBreakdownScaleDenominator * cb.PrtlSumAmountInGlobalCrcy, 2)
- round(li.CompBreakdownScaleNumerator / cb.CompBreakdownScaleDenominator * (cb.PrtlSumAmountInGlobalCrcy - cb.AmountInGlobalCurrency), 2)
as fis_ksl)
end as AmountInGlobalCurrency,
@Aggregation.default: #SUM
@Semantics.amount.currencyCode: 'GlobalCurrency'
case
when cb.ComponentBreakdown is null or cb.ComponentBreakdownScaleType = 'T'
then li.FixedAmountInGlobalCrcy
when cb.ComponentBreakdownScaleType = 'Q'
then cast(0 as fis_kfsl)
when cb.ComponentBreakdownScaleType = 'A'
then cast(round(cast(li.AmountInGlobalCurrency as fucb_amount_dec23_2) / cb.ScaleBaseAmountInGlobalCrcy * cb.PrtlSumFxdAmountInGlobalCrcy, 2)
- round(cast(li.AmountInGlobalCurrency as fucb_amount_dec23_2) / cb.ScaleBaseAmountInGlobalCrcy * (cb.PrtlSumFxdAmountInGlobalCrcy - cb.FixedAmountInGlobalCrcy), 2)
as fis_kfsl)
when cb.ComponentBreakdownScaleType = 'F'
then cast(round(cast(li.AmountInGlobalCurrency as fucb_amount_dec23_2) / cb.ScaleBaseAmountInTransCrcy * cb.PrtlSumFxdAmountInTransCrcy, 2)
- round(cast(li.AmountInGlobalCurrency as fucb_amount_dec23_2) / cb.ScaleBaseAmountInTransCrcy * (cb.PrtlSumFxdAmountInTransCrcy - cb.FixedAmountInTransCrcy), 2)
as fis_kfsl)
else
cast(round(cb.PrtlSumFxdAmountInGlobalCrcy / cb.CompBreakdownScaleDenominator * li.CompBreakdownScaleNumerator, 2)
- round((cb.PrtlSumFxdAmountInGlobalCrcy - cb.FixedAmountInGlobalCrcy) / cb.CompBreakdownScaleDenominator * li.CompBreakdownScaleNumerator, 2)
as fis_kfsl)
end as FixedAmountInGlobalCrcy,
li.FunctionalCurrency as FunctionalCurrency,
@Aggregation.default: #SUM
@Semantics.amount.currencyCode: 'FunctionalCurrency'
case
when cb.ComponentBreakdown is null or cb.ComponentBreakdownScaleType = 'T'
then li.AmountInFunctionalCurrency
when cb.ComponentBreakdownScaleType = 'Q'
then cast(0 as fis_vfccur12)
when cb.ComponentBreakdownScaleType = 'A' and cb.ScaleBaseAmountInFuncnlCrcy = 0
then cast(0 as fis_vfccur12)
when cb.ComponentBreakdownScaleType = 'A'
then cast(round(cast(li.AmountInFunctionalCurrency as fucb_amount_dec23_2) / cb.ScaleBaseAmountInFuncnlCrcy * cb.PrtlSumAmountInFuncnlCrcy, 2)
- round(cast(li.AmountInFunctionalCurrency as fucb_amount_dec23_2) / cb.ScaleBaseAmountInFuncnlCrcy * (cb.PrtlSumAmountInFuncnlCrcy - cb.AmountInFunctionalCurrency), 2)
as fis_vfccur12)
when cb.ComponentBreakdownScaleType = 'F'
then cast(round(cast(li.AmountInFunctionalCurrency as fucb_amount_dec23_2) / cb.ScaleBaseAmountInTransCrcy * cb.PrtlSumAmountInTransCrcy, 2)
- round(cast(li.AmountInFunctionalCurrency as fucb_amount_dec23_2) / cb.ScaleBaseAmountInTransCrcy * (cb.PrtlSumAmountInTransCrcy - cb.AmountInTransactionCurrency), 2)
as fis_vfccur12)
else
cast(round(li.CompBreakdownScaleNumerator / cb.CompBreakdownScaleDenominator * cb.PrtlSumAmountInFuncnlCrcy, 2)
- round(li.CompBreakdownScaleNumerator / cb.CompBreakdownScaleDenominator * (cb.PrtlSumAmountInFuncnlCrcy - cb.AmountInFunctionalCurrency), 2)
as fis_vfccur12)
end as AmountInFunctionalCurrency,
@Aggregation.default: #SUM
@Semantics.amount.currencyCode: 'FunctionalCurrency'
case
when cb.ComponentBreakdown is null or cb.ComponentBreakdownScaleType = 'T'
then
case
when li.AmountInGlobalCurrency <> 0
// FixedAmountInFuncnlCrcy not defined in I_GLACCOUNTLINEITEMRAWDATA
then cast(round(cast(li.AmountInFunctionalCurrency as fucb_amount_dec23_2) /
cast(li.AmountInGlobalCurrency as fucb_amount_dec23_2) * cast(li.FixedAmountInGlobalCrcy as fucb_amount_dec23_2), 2)
as fucb_vfccur12_fix)
else cast(0 as fucb_vfccur12_fix)
end
when cb.ComponentBreakdownScaleType = 'Q'
then cast(0 as fucb_vfccur12_fix)
when cb.ComponentBreakdownScaleType = 'A' and cb.ScaleBaseAmountInFuncnlCrcy = 0
then cast(0 as fucb_vfccur12_fix)
when cb.ComponentBreakdownScaleType = 'A'
then cast(round(cast(li.AmountInFunctionalCurrency as fucb_amount_dec23_2) / cb.ScaleBaseAmountInFuncnlCrcy * cb.PrtlSumFxdAmountInFuncnlCrcy, 2)
- round(cast(li.AmountInFunctionalCurrency as fucb_amount_dec23_2) / cb.ScaleBaseAmountInFuncnlCrcy * (cb.PrtlSumFxdAmountInFuncnlCrcy - cb.FixedAmountInFuncnlCrcy), 2)
as fucb_vfccur12_fix)
when cb.ComponentBreakdownScaleType = 'F'
then cast(round(cast(li.AmountInFunctionalCurrency as fucb_amount_dec23_2) / cb.ScaleBaseAmountInTransCrcy * cb.PrtlSumFxdAmountInTransCrcy, 2)
- round(cast(li.AmountInFunctionalCurrency as fucb_amount_dec23_2) / cb.ScaleBaseAmountInTransCrcy * (cb.PrtlSumFxdAmountInTransCrcy - cb.FixedAmountInTransCrcy), 2)
as fucb_vfccur12_fix)
else
cast(round(cb.PrtlSumFxdAmountInFuncnlCrcy / cb.CompBreakdownScaleDenominator * li.CompBreakdownScaleNumerator, 2)
- round((cb.PrtlSumFxdAmountInFuncnlCrcy - cb.FixedAmountInFuncnlCrcy) / cb.CompBreakdownScaleDenominator * li.CompBreakdownScaleNumerator, 2)
as fucb_vfccur12_fix)
end as FixedAmountInFuncnlCrcy,
cast(li.FreeDefinedCurrency1 as fis_rocur preserving type) as FreeDefinedCurrency1,
@Aggregation.default: #SUM
@Semantics.amount.currencyCode: 'FreeDefinedCurrency1'
case
when cb.ComponentBreakdown is null or cb.ComponentBreakdownScaleType = 'T'
then li.AmountInFreeDefinedCurrency1
when cb.ComponentBreakdownScaleType = 'Q'
then cast(0 as fis_osl)
when cb.ComponentBreakdownScaleType = 'A' and cb.ScaleBaseAmountInFDCrcy1 = 0
then cast(0 as fis_osl)
when cb.ComponentBreakdownScaleType = 'A'
then cast(round(cast(li.AmountInFreeDefinedCurrency1 as fucb_amount_dec23_2) / cb.ScaleBaseAmountInFDCrcy1 * cb.PrtlSumAmountInFDCrcy1, 2)
- round(cast(li.AmountInFreeDefinedCurrency1 as fucb_amount_dec23_2) / cb.ScaleBaseAmountInFDCrcy1 * (cb.PrtlSumAmountInFDCrcy1 - cb.AmountInFreeDefinedCurrency1), 2)
as fis_osl)
when cb.ComponentBreakdownScaleType = 'F'
then cast(round(cast(li.AmountInFreeDefinedCurrency1 as fucb_amount_dec23_2) / cb.ScaleBaseAmountInTransCrcy * cb.PrtlSumAmountInTransCrcy, 2)
- round(cast(li.AmountInFreeDefinedCurrency1 as fucb_amount_dec23_2) / cb.ScaleBaseAmountInTransCrcy * (cb.PrtlSumAmountInTransCrcy - cb.AmountInTransactionCurrency), 2)
as fis_osl)
else
cast(round(li.CompBreakdownScaleNumerator / cb.CompBreakdownScaleDenominator * cb.PrtlSumAmountInFDCrcy1, 2)
- round(li.CompBreakdownScaleNumerator / cb.CompBreakdownScaleDenominator * (cb.PrtlSumAmountInFDCrcy1 - cb.AmountInFreeDefinedCurrency1), 2)
as fis_osl)
end as AmountInFreeDefinedCurrency1,
@Aggregation.default: #SUM
@Semantics.amount.currencyCode: 'FreeDefinedCurrency1'
case
when cb.ComponentBreakdown is null or cb.ComponentBreakdownScaleType = 'T'
then
case
when li.AmountInGlobalCurrency <> 0
// FixedAmountInFDCrcy1 not defined in I_GLACCOUNTLINEITEMRAWDATA
then cast(round(cast(li.AmountInFreeDefinedCurrency1 as fucb_amount_dec23_2) /
cast(li.AmountInGlobalCurrency as fucb_amount_dec23_2) * cast(li.FixedAmountInGlobalCrcy as fucb_amount_dec23_2), 2)
as fucb_vocur12_fix)
else cast(0 as fucb_vocur12_fix)
end
when cb.ComponentBreakdownScaleType = 'Q'
then cast(0 as fucb_vocur12_fix)
when cb.ComponentBreakdownScaleType = 'A' and cb.ScaleBaseAmountInFDCrcy1 = 0
then cast(0 as fucb_vocur12_fix)
when cb.ComponentBreakdownScaleType = 'A'
then cast(round(cast(li.AmountInFreeDefinedCurrency1 as fucb_amount_dec23_2) / cb.ScaleBaseAmountInFDCrcy1 * cb.PrtlSumFxdAmountInFDCrcy1, 2)
- round(cast(li.AmountInFreeDefinedCurrency1 as fucb_amount_dec23_2) / cb.ScaleBaseAmountInFDCrcy1 * (cb.PrtlSumFxdAmountInFDCrcy1 - cb.FixedAmountInFDCrcy1), 2)
as fucb_vocur12_fix)
when cb.ComponentBreakdownScaleType = 'F'
then cast(round(cast(li.AmountInFreeDefinedCurrency1 as fucb_amount_dec23_2) / cb.ScaleBaseAmountInTransCrcy * cb.PrtlSumFxdAmountInTransCrcy, 2)
- round(cast(li.AmountInFreeDefinedCurrency1 as fucb_amount_dec23_2) / cb.ScaleBaseAmountInTransCrcy * (cb.PrtlSumFxdAmountInTransCrcy - cb.FixedAmountInTransCrcy), 2)
as fucb_vocur12_fix)
else
cast(round(cb.PrtlSumFxdAmountInFDCrcy1 / cb.CompBreakdownScaleDenominator * li.CompBreakdownScaleNumerator, 2)
- round((cb.PrtlSumFxdAmountInFDCrcy1 - cb.FixedAmountInFDCrcy1) / cb.CompBreakdownScaleDenominator * li.CompBreakdownScaleNumerator, 2)
as fucb_vocur12_fix)
end as FixedAmountInFDCrcy1,
// Associations
mtd._ComponentBreakdownMethod
}
where not (mtd.ComponentBreakdownMethodType = 'QTYBD' and cb.ComponentBreakdown is null)