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,048

Hi Friends,

How to select multiple fields in a select statement.

Eg. Fields A, B, C, D.

I tried the following, it is not working.

Select A B C D

INTO A1 B1 C1 D1

FROM XYZ.

Kindly guide me.

TIA.

Regards,

Mark K

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
985

Select A B C D
INTO(A1, B1, C1, D1)FROM XYZ.

)---->remember no space b/w '(' and A1.

kishan negi

9 REPLIES 9
Read only

Former Member
0 Likes
986

Select A B C D
INTO(A1, B1, C1, D1)FROM XYZ.

)---->remember no space b/w '(' and A1.

kishan negi

Read only

Former Member
0 Likes
985

Select A B C D

INTO (A1, B1, C1, D1)

FROM XYZ.

regards

shiba dutta

Read only

former_member508729
Active Participant
0 Likes
985

Hi

You have to provide here where condition .

try using this

Select A B C D

INTO ( A1,B1,C1,D1 )

FROM XYZ.

where a eq cond1.

Regards

Ashutosh

Reward points if helpful

Message was edited by:

ashutosh ambekar

Read only

Former Member
0 Likes
985

Hai

tables : xyz.

data : a1 type xyz-a,

b1 type xyz-b,

c1 type xyz-c,

d1 type xyz-d.

Select A B C D

INTO ( A1, B1, C1, D1 )

FROM XYZ.

Regards

Sreeni

Regards

Sreeni

Read only

0 Likes
985

Hai Check the sample Code

tables : mara.

data : v_matnr type mara-matnr,

v_mtart type mara-mtart,

v_mbrsh type mara-mbrsh,

v_meins type mara-meins.

select

matnr

mtart

mbrsh

meins

into (v_matnr,

v_mtart,

v_mbrsh,

v_meins)

from mara up to 1 rows.

endselect.

Regards

Srini

Read only

Former Member
0 Likes
985

KEEP A1 B1 C1 D1 IN AN ITAB. AND USE:

select a1 b1 c1 d1 from xyz into table itab.

Cheers.

Read only

Former Member
0 Likes
985

Hi,

Your question is not clear.

if your fields A,B,C,D are there in some database tables say XMARK.and you are fetching these fields into an internal table say itab created during run time..

you can fetch like this...

select A B C D from XMARK into corresponding fields of table itab.

to display it :

loop at itab.

write: / itab-A,itab-B,itab-C,itab-D.

endloop.

rgrds,

pankaj

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
985

Hi,

data : begin of itab occurs 0,

a type xyz-a,

b type xyz-b,

c type xyz-c,

d type xyx-d,

end of itab.

select a b c d from xyz into table itab.

The above stateemnt will fetch multiple rows and multiple columns.If you need to fetch the values in a variable,use

select a b c d from xyx into (a1, b1, c1, d1) up to 1 rows.

Read only

Former Member
0 Likes
985

Hi,

Declare like this

data : wa type XYZ.

Select A B C D

INTO corresponding fields of wa

FROM XYZ.

Thanks,

Sutapa