SQL函数 | 语法 | 作用 | 执行逻辑 | 返回类型 | CDS???View Entities | ABAP???SQL |
---|---|---|---|---|---|---|
LIKE_REGEXPR | LIKE_REGEXPR( ????? ?????PCRE = pcre, ????? ?????VALUE = sql_exp1[, ????? ?????CASE_SENSITIVE = case]) | 检查字符串是否包含任何 PCRE命中 | 检查sql_exp是否包含任何???PCRE命中,是则返回1,否则返回0。默认情况下,搜索是区分大小写的,但可以使用参数case-sensitive???覆盖这一点。 | INT4 | 支持 | |
OCCURRENCES_REGEXPR | OCCURRENCES???_REGEXPR( ????? ?????PCRE = pcre, ????? ?????VALUE = sql_exp1[, ????? ?????CASE_SENSITIVE = case]) | 计数并返回所有出现的 PCRE命中 | 对sql_exp中 PCRE命中 的所有出现次数进行计数,并返回出现次数。默认情况下,搜索是区分大小写的,但可以使用参数case-sensitive 覆盖这一点。 | INT4 | 支持 | |
REPLACE_REGEXPR | REPLACE_REGEXPR( ????? ?????PCRE = pcre, ????? ?????VALUE = sql_exp1, ????? ?????WITH = sql_exp2, ????? ?????OCCURRENCE => occ][, ????? ?????CASE_SENSITIVE => case]) | 将字符串中的 PCRE命中 替换为另一个指定的字符串 | 将sql_exp1中的???PCRE命中 替换为sql_exp2中指定的字符串。OCCURRENCE是可选的,它决定了要替换的pcre的出现次数。默认情况下,搜索是区分大小写的,但可以使用参数case-sensitive 覆盖这一点。 | SSTRING | 支持 | 支持 |
SELECT *
FROM marc
WHERE LIKE_REGEXPR( PCRE = '[0-9]{4}',VALUE = werks,CASE_SENSITIVE = ' ' ) = 1
into TABLE @DATA(lt_marc).
SELECT *
FROM t001w
WHERE occurrences_regexpr( pcre = '[0]{1}',value = werks,case_sensitive = ' ' ) = 3
INTO TABLE @DATA(lt_marc).
define view entity ZI_MAINTAINEDPLANTVIEW_VH
as select from ZI_MAINTAINEDPLANTVIEW as t1
cross join ZI_MD_SUBTYPE_VH as t2
{
@Consumption.filter.hidden:true
key t1.Matnr,
@ObjectModel.text.element: [ 'name1' ]
key t1.Werks,
t1.Extended,
@Semantics.text: true
t1.Name1,
t2.SubType
}
where
t1.Matnr <> ''
and(
t2.SubType = 'Z001_003'
or t2.SubType = 'Z002_003'
or t2.SubType = 'Z002_003'
or(
t2.SubType = 'Z004_003'
and(
'####' = replace_regexpr(pcre => '[0-9]{1}', value => t1.Werks, with => '#', result_length => 4)
or(
left(t1.Werks,3) = 'V00'
)
)
)
or(
(
t2.SubType = 'Z005_003'
or t2.SubType = 'Z006_003'
)
and(
'####' <> replace_regexpr(pcre => '[0-9]{1}', value => t1.Werks, with => '#', result_length => 4)
)
)
)