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

Former Member
0 Likes
1,297

hi,

without using the INTO clause how to write a select statement.

i tried like

tables: ekpo.

select ebeln ebelp from ekpo where ebeln = user given ebeln.

but it gives an error message that i have to use into clause.

Is there any other way to go wright with the above select statement.

Regards,

Phyrose.

9 REPLIES 9
Read only

Former Member
0 Likes
1,264

hi camila,

U r writing Abap code for fetching ebeln and ebelp from ekpo.

Then u have to store it in an internal table.

U cannot go ahead without using INTO clause.

select ebeln ebelp from ekpo into itab where ebeln = user given ebeln.

<b>

Pls reward if helpful.</b>

Read only

Former Member
0 Likes
1,264

Hi ,

Use single in this query n check and use the table which is defined into tables as in INTO.

give point if helpfull.

Message was edited by:

vikrant shukla1

Read only

former_member404244
Active Contributor
0 Likes
1,264

Hi,

u have to do like this..

tables: ekpo.

select single * from ekpo where ebeln = user given ebeln.

reward points if u find useful..

Regards,

Nagaraj

Read only

Former Member
0 Likes
1,264

Hi Phyrose ,

If you are specifying the field names then you will have to use into clause , since you dont want to use into clause then you select all the fields from the table using select *.

here is an sample

<b>select single * from ekpo where ebeln = v_ebeln.</b>

Regards

Arun

Read only

Former Member
0 Likes
1,264

Hi,

INsted of INTO clause u can go for APPENDING it will append the data into an internal table it_mara

select matnr

werks

from marc

appending table it_mara

up to 10 rows.

Regards

Manikumar

Read only

Former Member
0 Likes
1,264

hi,

you are not using single in this statement because of that it needs it_table to store data.

write query as:

tables: ekpo.

select single ebeln ebelp from ekpo where ebeln = user_entry.

Read only

0 Likes
1,264

Hi all,

i suppose that the fllowing statement cannot be used in SAP ECC 6.0:

select single ebeln ebelp from ekpo where ebeln = user_entry.

In SAP ECC 6.0, it is mandatory to specify <b>into </b> .

Regards.

Read only

Maciej_DomagaBa
Contributor
0 Likes
1,264

if u don't want INTO definitely u can try with the following syntax:

select .... from ...

<some abap code here>

endselect.

it's a kind of loop that each pass is processed for each record returned by select

Read only

Former Member
0 Likes
1,264

hi camila,

go throuth this code.

tables: vbak.

select single * from vbak where vbeln = user given vbeln.

but if u want to display the data i.e vbeln u should use internal table .

ie..

TABLES: vbak.

DATA: BEGIN OF g_t_itab OCCURS 0,

ebeln LIKE ekpo-ebeln,

ebelp LIKE ekpo-ebelp,

END OF g_t_itab.

SELECT ebeln ebelp FROM ekpo INTO TABLE g_t_itab WHERE ebeln = '4215712'.

LOOP AT g_t_itab.

WRITE:/ g_t_itab-ebeln,

g_t_itab-ebelp.

ENDLOOP.

<b>please reward points if helpfull.</b>

with regards,

radhika kolluru.