如何在OpenSQL ABAP WHERE子句中使用子字符串? [英] How do I use substring in OpenSQL ABAP WHERE clause?

查看:749
本文介绍了如何在OpenSQL ABAP WHERE子句中使用子字符串?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在OpenSQL中的表达式是:

My expression in OpenSQL is:

SELECT * FROM  J_1BNFLIN  AS B
  WHERE SUBSTRING(REFKEY , 1 , 10 )

where子句的子字符串部分不起作用。我在做什么错?

The substring portion of the where clause is not working. What am I doing wrong?

推荐答案

您可以在WHERE条件下使用LIKE。例如:

You can use LIKE in the WHERE condition. For example:

DATA: gv_refkey TYPE j_1bnflin-refkey.
gv_refkey = '123%'.
SELECT *
       INTO TABLE ...
       FROM j_1bnflin
       WHERE refkey LIKE gv_refkey.

这将选择字段refkey以'123'开头的所有条目(请注意,%为用作通配符)

This will select all entries where the field refkey starts with '123' (pls. note a % is used as wildcard)

这篇关于如何在OpenSQL ABAP WHERE子句中使用子字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆