基于变量的select field和where condition

引述

本文主要讲述怎么在open sql中选择字段怎么使用变量以及where条件怎么接变量

代码实例

"定义where条件的变量
data: lv_cond type string.

"定义select 字段的内表,可以将select的字段放到变量中,但是不能超过72个字符
"如果超过,需要用内表来接收
data:it_col type table of char70,
     is_col like line of it_col.
data: it_tab type table of but000.

is_col = 'PARTNER PARTNER_GUID'.
append is_col to it_col.
is_col = 'BU_GROUP CRDAT'.
append is_col to it_col.

lv_cond = 'BU_GROUP = ''Z1'''.

select (it_col) into corresponding fields of table it_tab
  from but000
  where (lv_cond).
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容