当前位置:网站首页>How to use the current conversion function in SAP CDs view
How to use the current conversion function in SAP CDs view
2022-06-28 18:19:00 【Hua Weiyun】
function CURRENCY_CONVERSION To pass to the formal parameter amount To perform currency conversion . The data type of the result CURR Have and pass to amount The actual parameters of the same technical properties .
Currency conversion is based on database tables TCUR System specific logins saved in client Rules are enforced , This database table is stored in SFIB Development kit . These rules can use transaction codes OB08 Editing .
The transformation is performed on the database , This means that part of the calculation is done using the ABAP Different rounding rules . No matter what conversion , Can not expect to get and use the standard Function Module The same result for currency conversion , Because these latter are usually less accurate , And rounding the intermediate result accordingly .
Here is a concrete example .
for example , I developed a CDS view, And automatically generates a Fiori Elements application , The monetary unit shown in it is Euro :

I expect to use CDS view Currency conversion function ,currency conversion, Convert the units of these amounts into US dollars .
You can use this file The conversion function mentioned in .
Use the following highlighted code :

@AbapCatalog.sqlViewName: 'ZCTRAVELJERRY'@AbapCatalog.compiler.compareFilter: true@AbapCatalog.preserveKey: true@AccessControl.authorizationCheck: #CHECK@EndUserText.label: 'Consumption view from /DMO/I_TRAVEL_U'@Metadata.allowExtensions: true@Search.searchable: truedefine view Z_C_TRAVEL_DATA_JERRY as select from /DMO/I_Travel_U association [1..1] to /DMO/I_Agency as _Agency on $projection.AgencyID = _Agency.AgencyIDassociation [1..1] to /DMO/I_Customer as _Customer on $projection.CustomerID = _Customer.CustomerID{ key TravelID, @ObjectModel.text.association: '_Agency' AgencyID, CustomerID, concat_with_space(_Customer.Title, _Customer.LastName, 1) as Addressee, BeginDate, EndDate, BookingFee, TotalPrice, CurrencyCode, currency_conversion( amount => TotalPrice, source_currency => CurrencyCode, round => 'X', target_currency => cast('USD' as abap.cuky( 5 )), exchange_rate_date => cast('20200429' as abap.dats), error_handling => 'SET_TO_NULL' ) as PriceInUSD, @Search.defaultSearchElement: true @Search.fuzzinessThreshold: 0.90 Memo, Status, LastChangedAt, /* Associations */ _Agency, _Booking, _Currency, _Customer} The final effect :
The conversion effect is as follows : Blue is the original Euro unit , The red one is through currency_conversion New value after conversion :

边栏推荐
- 国内怎么就做不出 IDEA 那样的产品?
- EasyExcel 学习笔记
- Analysis of response parsing process of SAP ui5 batch request
- Kubernetes visual interface dashboard
- Applet graduation project reservation based on wechat housekeeping service applet graduation project opening report function reference
- 架构自治服务:构建数据驱动的架构洞察
- 2022 chemical automation control instrument test simulation 100 questions simulation test platform operation
- 杂记:数据库go,begin,end,for,after,instead of
- kubernetes可视化界面dashboard
- 请问大智慧上开户安全吗
猜你喜欢

win10用cmake3.22与vs2019编译curl库源码并调用

Redis principle - hash

Small program graduation project based on wechat agricultural and sideline products agricultural products mall small program graduation project opening report function reference

2022 operation of simulated examination platform of hoisting machinery command examination question bank

Idea of capturing mobile terminal variant combination

Industrial digitalization and new generation digitalization system design platform -- Lecture

Applet graduation project is based on wechat property maintenance application property applet graduation project opening report function reference

Architecture autonomy service: building data-driven architecture insight

Ten MySQL locks, one article will give you full analysis

杂记:数据库go,begin,end,for,after,instead of
随机推荐
节点基础~节点层级
Go all out to unreal
Node foundation ~ node level
2022 practice questions and mock examination of Shandong Province safety officer C certificate examination
6 - Dictionary
Apifox 介绍
架构自治服务:构建数据驱动的架构洞察
WSUS client access server exception error -0x8024401f "suggestions collection"
如何制作CSR(Certificate Signing Request)文件?
Kubeadm create kubernetes cluster
Go 降序排序 取 Top N
Currency circle earthquake: earned 1million last year and lost 5million this year
Ask the bosses why the number type of Oracle CDC becomes a string when printed out. How can it be converted back?
Use PEGA to develop a simple RPA program
How to open a futures account? Where is it safer to open an account?
Ask flynk SQL cdc Can you synchronize multiple tables and then sink them into one table? Synchronized tables can be accessed through a joi
剑指 Offer 11. 旋转数组的最小数字
请问大智慧上开户安全吗
问下 flink sql cdc. 能同步多张表然后sink到一份表中么 同步的表通过 joi
How to create a CSR (certificate signing request) file?