‎2009 May 12 10:05 AM
Dear Friends
this is my small select statement for search healp
SELECT DISTINCT VBELN
FROM LIKP
INTO TABLE IT_VBELN.
but i want to select only begins with 80 values
i tried with as follows
SELECT DISTINCT VBELN
FROM LIKP
INTO TABLE IT_VBELN
WHERE VBELN LIKE '80%'.
but its not working
let me please solve to this matter
Thanks in advanced
Hope my question is clear for you
‎2009 May 12 10:11 AM
I guess it does not work because of the conversion exit on VBELN. Pls. check if the values in VBELN are shorter than 10 characters. If yes, it means there are leading zeros before the '80'
‎2009 May 12 10:07 AM
What is not working? Syntax error? Not returning the expected values?
You don't need DISTINCT, as VBELN is the unique key of LIKP, try to remove this first.
Thomas
‎2009 May 12 10:11 AM
Hi:
use like
SELECT VBELN
FROM LIKP
INTO corresponding fields of TABLE IT_VBELN
WHERE VBELN LIKE '80%'.
have a look
[Using Like |http://help.sap.com/saphelp_nw04/helpdata/EN/fc/eb3a1f358411d1829f0000e829fbfe/content.htm]
‎2009 May 12 10:11 AM
I guess it does not work because of the conversion exit on VBELN. Pls. check if the values in VBELN are shorter than 10 characters. If yes, it means there are leading zeros before the '80'
‎2009 May 12 10:13 AM
<off-topic>Hi Eric, good to see you back around here ;)</off-topic>
‎2009 May 12 10:16 AM
just jumped in but let me finish:
If the above is correct than you can try the following: if the VBELN numbers are always n character long, than there will be 10 - n zeros before the 80 (for example: 8 long VBELN will look like: 0080...). in this case you can use;
SELECT vbeln
FROM likp
WHERE vbeln LIKE '0080%'.if the the VBELN numbers can have different lengths, than you have to mention each possibilitiy in the WHERE:
SELECT vbeln
FROM likp
WHERE vbeln LIKE '0080%'
OR vbeln LIKE '00080%'
OR vbeln LIKE '000080%'.
‎2009 May 12 10:56 AM