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

Simple SELECT statement

Former Member
0 Likes
662

Hi. Could You explain to me where does an error come from?

DATA: 
  BEGIN OF itab OCCURS 0,
    bldat LIKE zrfakh-bldat,
    cpudt LIKE zrfakh-cpudt,
  END OF itab.
    
  SELECT zrfakh~bldat zrfakh~cpudt
  INTO   (itab-bldat itab-cpudt)
  FROM   zrfakh.

<i>ERROR: The list "(ITAB-BLDAT" after "INTO" is not of the form (f1, ...,fn), or contains an undefined field. excludes specification of a field list.</i>

When I make it like that:

  SELECT zrfakh~bldat zrfakh~cpudt
  INTO CORRESPONDING FIELDS OF itab
  FROM   zrfakh.
    APPEND itab.        
  ENDSELECT.

an error disappears.

Greetings. P.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
610

Hi

Just put a comma between the fields itab-bldat itab-cpudt

SELECT zrfakhbldat zrfakhcpudt

INTO (itab-bldat, itab-cpudt)

FROM zrfakh.

Reward points for useful Answers

Regards

Anji

5 REPLIES 5
Read only

Former Member
0 Likes
610

Hi,

When you give multiple fields...you should separate them with comma


SELECT zrfakh~bldat zrfakh~cpudt
  INTO   (itab-bldat,itab-cpudt)
  FROM   zrfakh.

Thanks

Naren

Read only

Peter_Inotai
Active Contributor
0 Likes
610

Hi,

The comma is missing there:

INTO (itab-bldat itab-cpudt)

this should be

INTO (itab-bldat, itab-cpudt)

best regards,

Peter

Read only

Former Member
0 Likes
610

Hi,

DATA: 
  BEGIN OF itab OCCURS 0,
    bldat LIKE zrfakh-bldat,
    cpudt LIKE zrfakh-cpudt,
  END OF itab.
    
  SELECT zrfakh~bldat zrfakh~cpudt
  INTO   ( itab-bldat,itab-cpudt )  " --> Space after the ( and before the )
  FROM   zrfakh.

Regards

Sudheer

Read only

Former Member
0 Likes
610

DATA:

BEGIN OF itab OCCURS 0,

bldat LIKE zrfakh-bldat,

cpudt LIKE zrfakh-cpudt,

END OF itab.

SELECT zrfakhbldat zrfakhcpudt

INTO (itab-bldat itab-cpudt)

FROM zrfakh

endselect.

Read only

Former Member
0 Likes
611

Hi

Just put a comma between the fields itab-bldat itab-cpudt

SELECT zrfakhbldat zrfakhcpudt

INTO (itab-bldat, itab-cpudt)

FROM zrfakh.

Reward points for useful Answers

Regards

Anji