abaplint: Statement does not exist in ABAPv755(or a parser error), "SELECT"(parser_error)

The following SELECT statement is valid:

CONSTANTS: lc_name1(5) TYPE c VALUE 'name1',
           lc_name2(5) TYPE c VALUE 'name2',
           lc_name3(5) TYPE c VALUE 'name3'.

SELECT vbeln, vbtyp,
 CASE
   WHEN auart = 'ZAMA' THEN @lc_name1
   WHEN auart = 'ZACR' THEN @lc_name2
  ELSE @lc_name3
END AS ernam
FROM vbak
 INTO @DATA(ls_vbak2).
ENDSELECT.

image

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 15 (8 by maintainers)

Commits related to this issue

Most upvoted comments

You could alternatively just select into a table:

CONSTANTS: lc_name1(5) TYPE c VALUE 'name1',
           lc_name2(5) TYPE c VALUE 'name2',
           lc_name3(5) TYPE c VALUE 'name3'.

SELECT vbeln, vbtyp,
    CASE
    WHEN auart = 'ZAMA' THEN @lc_name1
    WHEN auart = 'ZACR' THEN @lc_name2
    ELSE @lc_name3
    END AS ernam
    FROM vbak
    UP TO 1 ROWS
    INTO TABLE @DATA(lt_vbak)
    WHERE vbtyp = 'C'
    ORDER BY vbeln.
IF sy-subrc = 0.
  DATA(ls_vbak) = lt_vbak[ 1 ].
ENDIF.
WRITE ls_vbak.