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 Statement without INTO

Former Member
27,179

Hi,

I notice some standard programs are using select statement without the INTO clause. Why is it possible? Following is an example I found:

SELECT SINGLE *

FROM DFKKKO

WHERE OPBEL = i_dfkkcoh-data1.

{/code}

1 ACCEPTED SOLUTION
Read only

Former Member
9,984

Hi,

Where ever you find selects without the INTO clause, they must have declared a TABLES statement.

For Eg,


TABLES: DFKKKO.

SELECT SINGLE *
FROM DFKKKO
WHERE OPBEL = i_dfkkcoh-data1.

The tables statement generates a workarea similar to the structure of DFKKKO and will store the result into it directly without the need for specifying the INTO clause

Regards,

Vikranth

3 REPLIES 3
Read only

Former Member
0 Likes
9,984

Hi,

If the report or program already has DFKKKO declared in tables section.

e.g.:- tables DFKKKO.

Then explicit into clause is not required.

It will select the data into workarea.

SELECT SINGLE *

FROM DFKKKO

WHERE OPBEL = i_dfkkcoh-data1.

Read only

Former Member
9,985

Hi,

Where ever you find selects without the INTO clause, they must have declared a TABLES statement.

For Eg,


TABLES: DFKKKO.

SELECT SINGLE *
FROM DFKKKO
WHERE OPBEL = i_dfkkcoh-data1.

The tables statement generates a workarea similar to the structure of DFKKKO and will store the result into it directly without the need for specifying the INTO clause

Regards,

Vikranth

Read only

Former Member
0 Likes
9,984

It's possible in Native SQl.

Native sql is written using the statement EXEC.