Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SELECT

Former Member
0 Likes
1,273

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.

8 REPLIES 8
Read only

Former Member
0 Likes
1,209

hi,

SELECT SINGLE bukrs FROM t001 INTO t001-bukrs
WHERE bukrs = p_co_code-low.        '<-- replace = with IN

and 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

Read only

Former Member
0 Likes
1,209

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

Read only

Former Member
0 Likes
1,209

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

Read only

Former Member
0 Likes
1,209

But these are SELECT-OPTIONS and user can enter more than one value, how to alter the select query for this.

Read only

0 Likes
1,209

U can simply ignore these warnings ...

Read only

0 Likes
1,209

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

Read only

Former Member
0 Likes
1,209

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

Read only

Former Member
0 Likes
1,209

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