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 - endselect issue..

Former Member
0 Likes
1,273

hi,

in my code i am having some select, select single and select count(*) statements. during syntax check it gives me the error saying nesting of select is not proper and that i need to include an endselect.

whats wrong !!

i just have single line select statements and no block of code to be executed, if so i wouldhave put a select and endselect.

pl advise. thks

1 ACCEPTED SOLUTION
Read only

JozsefSzikszai
Active Contributor
0 Likes
1,202

copy your code here...

venkatesh appikonda:

"select single must have endselect ."

unfortunately this is wrong...

10 REPLIES 10
Read only

Former Member
0 Likes
1,202

select single must have endselect .

Read only

ThomasZloch
Active Contributor
0 Likes
1,202

A SELECT without SINGLE or aggregate function like COUNT (*) or INTO TABLE addition usually requires an ENDSELECT.

Thomas

Read only

JozsefSzikszai
Active Contributor
0 Likes
1,203

copy your code here...

venkatesh appikonda:

"select single must have endselect ."

unfortunately this is wrong...

Read only

0 Likes
1,202

Thanks Eric, here is my select related code..this is in the user exit save_document_prepare of MV45AfZZ.

SELECT LAND1 INTO L_LAND1 FROM KNA1 WHERE KUNNR = XVBAK-KUNNR.

SELECT COUNT(*) INTO L_LINES FROM Zcusttable WHERE ALAND = L_ALAND AND LAND1 = L_LAND1.

SELECT SINGLE TDIIX INTO L_TDIIX FROM TVLK WHERE LFART = L_LFARV.

Read only

0 Likes
1,202

SELECT SINGLE LAND1 INTO L_LAND1 FROM KNA1 WHERE KUNNR = XVBAK-KUNNR.

Read only

0 Likes
1,202

SELECT SINGLE LAND1 INTO L_LAND1 FROM KNA1 WHERE KUNNR = XVBAK-KUNNR.

pls. correct (in bold)

you select only one record (KUNNR is the only key field in KNA1)

Read only

0 Likes
1,202

I did read your mind, friend

Going home now.

Cheers

Thomas

Read only

0 Likes
1,202

or I did yours

dann bis Morgen

Read only

0 Likes
1,202

please try to include single after select.

SELECT Single LAND1 INTO L_LAND1 FROM KNA1 WHERE KUNNR = XVBAK-KUNNR.

HOpe this solves ur issue.

Shreekant

Read only

Former Member
0 Likes
1,202

Hi Friend,

Please change :

SELECT LAND1 INTO L_LAND1 FROM KNA1 WHERE KUNNR = XVBAK-KUNNR.

as

SELECT SINGLE LAND1 INTO L_LAND1 FROM KNA1 WHERE KUNNR = XVBAK-KUNNR.

Check this link. I think this might help you.

http://www.sapbrainsonline.com/sapinfo/tutorial.php?artid=414

Hope this helps you.

Regards,

Chandra Sekhar