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 issue

Former Member
0 Likes
982

hi friends,

can any body tell me how this select work in which we can not give any INTO clause

SELECT * FROM COEP WHERE WTGBTR > 0 AND

KSTAR <> ' ' AND OBJNR BETWEEN 'OR000000000000'

AND 'OR999999999999'

AND OBJNR = WAUFNUM ORDER BY OBJNR.

Thanks for answers

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
937

Hi ,

Check whether you have a statement like Tables COEP in your code. With this statement a field string of type COEP is created. So the selected record with select statement gets stored in this.

Regards,

Swapna.

9 REPLIES 9
Read only

Former Member
0 Likes
937

Hi

Its necessary to use INTO clause.

Regards

Aditya

Read only

Former Member
0 Likes
937

Hi,

This will not work.

It will not retrive any data and give sy-subrc 4 or syntax error too.

Regards

Ricky

Read only

Former Member
0 Likes
938

Hi ,

Check whether you have a statement like Tables COEP in your code. With this statement a field string of type COEP is created. So the selected record with select statement gets stored in this.

Regards,

Swapna.

Read only

0 Likes
937

kidly can u tell me about field string.

Read only

0 Likes
937

A work area is created with Tables COEP.

Read only

Former Member
0 Likes
937

Hi,

1. BE SURE THAT table COEP exists in DATABASE.

2. If it does exist -> Create a table of type COEP

DATA: tb_coep TYPE STANDARD TABLE OF coep.

2. SELECT *

FROM coep

INTO CORRESPONDING FIELDS OF TABLE tb_coep

WHERE conditions.

Hope this helps,

Alex.

ps: i;m not sure this will work because i see that table COEP does not have a FLAT structure...

Read only

Former Member
0 Likes
937

SELECT * FROM COEP WHERE WTGBTR > 0 AND

KSTAR ' ' AND OBJNR BETWEEN 'OR000000000000'

AND 'OR999999999999'

AND OBJNR = WAUFNUM ORDER BY OBJNR.

>ENDSELECT. " is necessary or use SELECT SINGLE *

For this Select to run Successfully, there can be 2 conditions:

1) It is a nested select statement.

> Select * from tab1 into itab1 where exists(select * from tab2 where ...).

>"For select in brackets, Use of INTO is forbidden.

2) You have declared a Work Area of type COEP using Tables statement:

> Tables: COEP. " This declares a Work area of type COEP having name COEP

Read only

Former Member
0 Likes
937

Hi,

This select will work only if you have defined the work are using the tables statment

 TABLES COEP 

then you wont need a into clause.

However you will need to give a

ENDSELECT 

as well to make it work.


tables COEP.

SELECT * FROM COEP WHERE WTGBTR > 0 AND
KSTAR ' ' AND OBJNR BETWEEN 'OR000000000000'
AND 'OR999999999999'
AND OBJNR = WAUFNUM ORDER BY OBJNR.
ENDSELECT.

regards,

Advait

Read only

Former Member
0 Likes
937

This select will not work because into clause in not specified. Into clause should be specified