Skip to Content
0
Jun 25, 2020 at 06:52 PM

Issue with Currency Conversion in CDS View

381 Views Last edit Jun 25, 2020 at 06:56 PM 2 rev

Hi

Created the below CDS view for Currency conversion, however conversion happens but the column is not getting displayed in analysis for office, Whereas I can see all the other columns in A4O.

is there something am missing here ?

@AbapCatalog.sqlViewName: 'ZSQLCURRCONV'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'ZCDS_CURR_CONV'
@VDM.viewType: #BASIC
@Analytics.dataCategory: #FACT

define view ZCDS_CURR_CONV with parameters P_SALESORG : abap.char( 5 ),

@Consumption.defaultValue: 'EUR'
P_TARGET_CUR : abap.cuky( 5 )

as select from acdoca as T1 left outer join vbrk as T2
on T1.belnr = T2.belnr and T1.rbukrs = T2.bukrs
{

T1.rldnr,
T1.rbukrs,
T1.kdgrp,
T1.prctr,
@Semantics.currencyCode: true $parameters.P_TARGET_CUR as Currency,
@Semantics.amount.currencyCode: 'Currency'
@DefaultAggregation: #SUM T1.hsl as Amount ,
T1.kunnr,
T1.matnr,
T2.vbeln,
T2.fkart,
T2.fktyp,
T2.vkorg,
T2.vtweg,
T2.poper,
T2.kunrg as PAYER,
T2.kunag as SOLD_TO_PARTY,
T2.waerk,
T2.erdat,
@EndUserText.label: 'Amount in target currency'
currency_conversion( amount => T1.hsl,
source_currency => T2.waerk,
target_currency => :P_TARGET_CUR,
exchange_rate_type => 'M',
exchange_rate_date => T2.erdat,
error_handling => 'SET_TO_NULL' ) as Covnerted_Amount
}

where T1.vkorg = :P_SALESORG