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

abap select into a variable list

former_member97292
Participant
0 Likes
4,727

I have

select lfa1~lifnr

          lfa1~name1

          lfa1~ort01

          lfa1~regio

          into gv_lifnr, gv_name1, gv_ort01, gv_regio

          from laf1

etc

I have gotten into corresponding to work.  According to documentation, INTO a list of variables is supposed to work.

I know.  The corresponding works.  I am trying to learn to do it this way just for fun.  I am simply looking for an answer to my question.  What am I doing wrong?

Also, is there one go to web site that has a robust ABAP reference?

Thanks.

4 REPLIES 4
Read only

matt
Active Contributor
0 Likes
1,370

help sap.com is an excellent ABAP reference

Have another look at the syntax of INTO - you'll see the variables need to be surround with brackets.

INTO (v1, v2, v3).

Read only

ronaldo_aparecido
Contributor
0 Likes
1,370

Hello why do not u create a structure with these fields and then move to them?

A good reference site is part of the sdn abap and sapthcnical.

and also saphelp

Read only

mh97
Contributor
0 Likes
1,370

What Matthew said, for your current question.

I take it you've tried the onboard ABAP reference? (click on a keyword, such as SELECT, then do F1)

It can be a bit overwhelming when you are new to ABAP. If the onboard docs + help.sap.com aren't doing it for you, you may want to check out some of the ABAP books available at http://www.sap-press.com/ .

Read only

Former Member
0 Likes
1,370

Hi Perry ,

U can use

DATA: gv_lifnr LIKE LFA1-LIFNR,
       gv_name1 LIKE LFA1-name1,
       gv_ort01 LIKE LFA1-ort01,
       gv_regio LIKE LFA1-regio.

select SINGLE lfa1~lifnr
           lfa1~name1
           lfa1~ort01
           lfa1~regio from LFA1
           into (gv_lifnr,gv_name1,gv_ort01, gv_regio)

    where .......................

etc.