Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1343466
  • 博文数量: 932
  • 博客积分: 10
  • 博客等级: 民兵
  • 技术积分: 10208
  • 用 户 组: 普通用户
  • 注册时间: 2011-07-08 12:28
文章分类

全部博文(932)

文章存档

2021年(1)

2020年(134)

2019年(792)

2018年(5)

我的朋友

分类: 架构设计与优化

2020-02-06 14:12:48

AG3, view name Zorder_Sys_Status.

This view has an association named _statushelp:

# Requirement

I would like to read the guid from host view Zorder_Sys_Status together with its associated data via association _statushelp.

(1) Since there is no existing data type which holds both host view field and associated view fields, you have to create one on your own:

(2) Use the following syntax in ABAP code:

```abap

DATA: lt_data TYPE tt_Data.

SELECT

guid,

\_STATUSHELP-STATUS_KEY AS STATUS_KEY ,

\_STATUSHELP-STATUS_TEXT AS STATUS_TEXT

FROM

ZORDER_SYS_STATUS

WHERE

ZORDER_SYS_STATUS~GUID = 'FA163E8EAB031EE6A99F824537D112A4' AND ZORDER_SYS_STATUS~STAT = 'I1002' AND \_STATUSHELP-STATUS_KEY IS NOT NULL

INTO TABLE @lt_data.

```

By the way, when the association defined in CDS view is consumed via OPEN SQL, it will be converted to LEFT OUTER JOIN, as could be observed in SQL trace:

In ST05, select your trace record, and click this button in toolbar:

阅读(676) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~