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

Error in query

Former Member
0 Likes
777

Hi,

I am using following code.

  • event handler for data retrieval

select VENUM VBELN POSNR FROM VEPO into corresponding fields of table T_VEPO

WHERE VBELN = delnumber

AND POSNR = delitemnumber

order by VENUM.

endselect.

I get following error message:

Incorrect nesting: For the statement "ENDSEELCT", there is no open structure introduced by "SELECT".

Please guide me

5 REPLIES 5
Read only

former_member186741
Active Contributor
0 Likes
733

ENDSELECT IS NOT REQUIRED FOR INTO TABLE SELECTS.

Please mark the topic as closed and award the points.

Read only

0 Likes
733

select VENUM VBELN POSNR FROM VEPO into corresponding fields of table T_VEPO

WHERE VBELN = delnumber

AND POSNR = delitemnumber

order by VENUM.

<b>endselect.</b>-----> not required.

if u used FOR INTO TABLE SELECTS than end select is not required.

Read only

Former Member
0 Likes
733

As Neil has mentioned, the endselect statement is used only when selecting data from the database into a structure or work area.

In the case you have shown, you are selecting the data into an internal table and hence Endselect is not required.

Read only

Former Member
0 Likes
733

hi

good

write like this

wrong->

select VENUM VBELN POSNR FROM VEPO into corresponding fields of table T_VEPO

WHERE VBELN = delnumber

AND POSNR = delitemnumber

order by VENUM.

endselect.

right->

select VENUM VBELN POSNR FROM VEPO into corresponding fields of table T_VEPO

WHERE VBELN = delnumber

AND POSNR = delitemnumber

order by VENUM.

thanks

mrutyun

Read only

Former Member
0 Likes
733

hi

in this case endselect is not required.

if u use 'INTO table' then Endselect is required.

Naveen