显示CD中的输出值又称转换exiT值?

发布于 2025-01-23 08:17:49 字数 146 浏览 3 评论 0原文

我创建了一个CD视图,该视图从2个表中读取一些数据。 我的问题是,其中一列具有背后的转换策略 - 因此,如果我使用se16n显示数据,则显示“转换值”,但在我的CDS视图中,只显示未转换的值。

是否可以在CDS视图中显示转换值的选项?

I've created a CDS view, which reads some data from 2 tables.
My problem is, that one of the columns has a conversion policy behind - so if I display the data with SE16n, it shows the "converted value" but within my cds view only the unconverted value is shown.

Is there an option to show converted values in CDS views?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

上课铃就是安魂曲 2025-01-30 08:17:49

使用虚拟元素

它们可用于计算CD中不可用的字段。

步骤

  1. 添加一个占位符字段:cast('as as abap.char(255))作为after_conversion
  2. 添加注释@objectmodel.virtualelement:true到您的字段
  3. 添加注释@objectModel.virtualElementCalcalcultyby:'abap:< z_class>'
  4. 创建类z_class
  5. interface if_sadl_exit_calc_element_element_element_element_element_element_elemread
  6. In Method 您可以可以进行转换

在这里您可以看到一个简单的示例

Use Virtual Elements

they can be used to calculate fields that are not available in CDS.

Steps

  1. Add a placeholder field: cast( '' as abap.char(255)) AS after_conversion
  2. Add Annotation @ObjectModel.virtualElement: true to your field
  3. Add Annotation @ObjectModel.virtualElementCalculatedBy: 'ABAP:<z_class>'
  4. Create the Class Z_CLASS
  5. Use interface if_sadl_exit_calc_element_read
  6. In Method calculate you can do the conversion

Here you can see a simple example

緦唸λ蓇 2025-01-30 08:17:49

CD中没有实际不支持转换出口。但是,通过字符串转换,您可以重建转换退出。

- &gt;参见

No actually conversion exits are not supported in CDS. But with string conversions you can rebuild the conversion exits.

-> see Documentation

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文