SELECT时经常会用到模糊查询,一般我们采用LIKE去匹配。
比如我们在找对象号中包含某个内部订单号的对象状态时,
通常会这样写:
DATA:wa_user6 TYPE aufk-user6,
wa_stat TYPE jest-stat.wa_user6 = ‘%960000000040%‘.
SELECT SINGLE stat INTO wa_stat
FROM jest
WHERE objnr LIKE wa_user6AND inact = ”.
也可以这样写:
DATA:wa_stat TYPE jest-stat.
RANGES:r_user6 FOR jest-objnr.
r_user6-sign = ‘I’.
r_user6-option = ‘CP’.
r_user6-low = ‘*’&& ‘960000000040’ && ‘*’.
APPEND r_user6.SELECT SINGLE stat INTO wa_stat
FROM jest
WHERE objnr IN r_user6AND inact = ”.
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/19528.html