‎2008 Jun 12 9:25 AM
SELECT SINGLE bukrs FROM t001 INTO t001-bukrs
WHERE bukrs IN p_co_code.
When I do extended syntax check I get a warning
In "SELECT SINGLE ...", the WHERE condition for the key field "BUKRS" does not test
for equality. Therefore, the single record you are searching for may not be
unique.
p_co_code is a SELECT-OPTIONS parameter in the code.
How can I correct this.
‎2008 Jun 12 9:27 AM
hi,
SELECT SINGLE bukrs FROM t001 INTO t001-bukrs
WHERE bukrs = p_co_code-low. '<-- replace = with INand add low or high value to p_co_code
IN is applicable for Selection-options, where in u have range of values. since u want only one record, pass only one value in where condition using EQ or = .
remove
‎2008 Jun 12 9:28 AM
hi,
declare p_co_code as shown below..also make sure t001 is declared as tables at the top ....
tables : t001.
select-options : p_co_code for t001-bukrs.Regards,
Santosh
‎2008 Jun 12 9:29 AM
Hi,
Tables: t001. ( at the top.)
SELECT SINGLE bukrs FROM t001 INTO t001-bukrs
WHERE bukrs = p_co_code.( also = )<REMOVED BY MODERATOR>
Thanks
Virkanth
Edited by: Alvaro Tejada Galindo on Jun 12, 2008 6:47 PM
‎2008 Jun 12 9:35 AM
But these are SELECT-OPTIONS and user can enter more than one value, how to alter the select query for this.
‎2008 Jun 12 9:36 AM
‎2008 Jun 12 9:43 AM
Hi,
you can give more than one value. but u r using SELECT SINGLE...if it is just for validation purpose and u want the warnign to be rectified jus give
SELECT SINGLE bukrs FROM t001 INTO t001-bukrs
WHERE bukrs IN p_co_code-low.
it will not give u any error in the program, even if u use the same select.
regards,
madhu
‎2008 Jun 12 9:49 AM
Hi,
SELECT-OPTIONS : P_CODE FOR T001-BUKRS.
SELECT SINGLE BUKRS FROM T001 INTO T001-BUKRS
WHERE BUKRS eq P_CODE-low.
Now do extended syntax check.
Regards
Adil
‎2008 Jun 12 11:04 AM
Hi,
From the code that you have pasted I understand that you need to validate all the company codes that the user enters in the selection screen. So, you will have to use
SELECT bukrs from T001
into table l_i_bukrs
where bukrs IN s_bukrs.
( s_bukrs is your select option).
In the code that you pasted the error lies in SELECt SINGLE as if the user has entered 2 company codes in select option parameter then for those 2 company codes you are trying to fetch one single record...
Please modify your code accordingly and let me know if it helps.
<REMOVED BY MODERATOR>
--Warm Regards,
Prajakta K.
Edited by: Alvaro Tejada Galindo on Jun 12, 2008 6:48 PM