‎2022 Apr 21 3:40 PM
Hi all,
I am trying to do a selection statement that select two fields from the table KNVV. The selection is as below:
SELECT SINGLE podtg, podkz
FROM knvv
INTO (lv_podtg, lv_podkz)
WHERE kunnr = vkdfs-kunnr
AND vkorg = vkdfs-vkorg
AND vtweg = vkdfs-vtweg
AND spart = vkdfs-spart.
I get this error message as below:
This SELECT statement uses additions that can only be used with Unicode flag enabled.
I believe that the issue is happening due to the field podkz, as when I did the selection without it, it worked perfectly and this is also a field which the values are 'X' or empty.
Can you please give me a suggestion on how to fix this issue?
Thank you all in advance!
‎2022 Apr 21 5:00 PM
There is the old ABAP SQL syntax, and the new "strict" ABAP SQL syntax. The syntaxes cannot be mixed.
And the error messages are often not very clear.
Your 1st line is in new syntax because of the comma.
Your 5 last lines are in old syntax because ABAP variables are not preceded with arobase (see Host variables in ABAP documentation).
Either old syntax:
SELECT SINGLE podtg podkz
FROM knvv
INTO (lv_podtg, lv_podkz)
WHERE kunnr = vkdfs-kunnr
AND vkorg = vkdfs-vkorg
AND vtweg = vkdfs-vtweg
AND spart = vkdfs-spart.Or new syntax:
SELECT SINGLE podtg, podkz
FROM knvv
INTO (@lv_podtg, @lv_podkz)
WHERE kunnr = @vkdfs-kunnr
AND vkorg = @vkdfs-vkorg
AND vtweg = @vkdfs-vtweg
AND spart = @vkdfs-spart.
‎2022 Apr 21 5:00 PM
There is the old ABAP SQL syntax, and the new "strict" ABAP SQL syntax. The syntaxes cannot be mixed.
And the error messages are often not very clear.
Your 1st line is in new syntax because of the comma.
Your 5 last lines are in old syntax because ABAP variables are not preceded with arobase (see Host variables in ABAP documentation).
Either old syntax:
SELECT SINGLE podtg podkz
FROM knvv
INTO (lv_podtg, lv_podkz)
WHERE kunnr = vkdfs-kunnr
AND vkorg = vkdfs-vkorg
AND vtweg = vkdfs-vtweg
AND spart = vkdfs-spart.Or new syntax:
SELECT SINGLE podtg, podkz
FROM knvv
INTO (@lv_podtg, @lv_podkz)
WHERE kunnr = @vkdfs-kunnr
AND vkorg = @vkdfs-vkorg
AND vtweg = @vkdfs-vtweg
AND spart = @vkdfs-spart.