‎2007 May 09 3:21 AM
Hello,
What is the correct statement to use CP operator in SELECT statement?
This does not work:
SELECT *
INTO CORRESPONDING FIELDS OF TABLE abc
FROM /abc/abc WHERE user CP some_var.
Thanks.
‎2007 May 09 4:01 AM
Hi,
You can build a wildcard ranges and please try something like this.
r_wildcard-sign = 'I'.
r_wildcard-option = 'CP'.
r_wildcard-low = 'B*'.
append r_wildcard.
r_wildcard-sign = 'I'.
r_wildcard-option = 'CP'.
r_wildcard-low = 'B'.
append r_wildcard.
select * from mara
into table gt_mara_b
where mtart = 'YSAB'
and matnr in r_wildcard.
‎2007 May 09 3:28 AM
you'e to use LIKE for pattern searches ie
data some_var(8) value '%abcdef%'.
SELECT *
INTO CORRESPONDING FIELDS OF TABLE abc
FROM /abc/abc WHERE user LIKE some_var.
~SUresh
‎2007 May 09 4:01 AM
Hi,
You can build a wildcard ranges and please try something like this.
r_wildcard-sign = 'I'.
r_wildcard-option = 'CP'.
r_wildcard-low = 'B*'.
append r_wildcard.
r_wildcard-sign = 'I'.
r_wildcard-option = 'CP'.
r_wildcard-low = 'B'.
append r_wildcard.
select * from mara
into table gt_mara_b
where mtart = 'YSAB'
and matnr in r_wildcard.
‎2007 May 09 4:24 AM
Hi,
Use LIKE Statement.
For more information
Hi,
CP (Contains Pattern)
The logical expression
<f1> CP <f2>
is true if <f1> matches the pattern <f2>. If <f2> is of type C, you can use the following wildcards in <f2>:
for any character string: *
for any single character: +
Trailing spaces are ignored and the comparison is not case-sensitive. If the comparison is true, the system field SY-FDPOS contains the offset of <f2> in <f1> . If it is false, SY-FDPOS contains the length of <f1>.
If you want to perform a comparison on a particular character in <f2>, place the escape character # in front of it. You can use the escape character # to specify
characters in upper and lower case
the wildcard character "" (enter:#)
the wildcard character "" (enter: # )
the escape symbol itself (enter: ## )
blanks at the end of a string (enter: #___ )
Don't forget to reward if useful...