on 2024 Dec 22 11:03 PM
Hello experts on line, my codes is as below and without syntax error.
TYPES: BEGIN OF t_str,
carrid like sflight-carrid,
connid like sflight-connid,
END OF t_str.
data: gt_itab type table of t_str,
gs_wa type t_str,
gv_carrid like sflight-carrid value 'AA'.
EXEC SQL PERFORMING APPEND_ITAB.
SELECT A.CARRID, A.CONNID
INTO :GS_WA-CARRID, :GS_WA-CONNID
FROM SFLIGHT A
WHERE A.MANDT =: SY-MANDT AND A.CARRID =: GV_CARRID
ENDEXEC.
FORM APPEND_ITAB.
WRITE:/ GS_WA-CARRID, GS_WA-CONNID.
APPEND GS_WA TO GT_ITAB.
CLEAR GT_ITAB.
ENDFORM.
But when it runs, it has runtime error in category installation error. Short Text is ‘SQL error 257 occured while executing Native SQL’. How can I correct it? Thanks
Request clarification before answering.
":" must be placed right before the global variable name (e.g. use "A.MANDT = :SY-MANDT" instead of "A.MANDT =: SY-MANDT")
EXEC SQL PERFORMING APPEND_ITAB.
SELECT A.CARRID, A.CONNID
INTO :GS_WA-CARRID, :GS_WA-CONNID
FROM SFLIGHT A
WHERE A.MANDT = :SY-MANDT AND A.CARRID = :GV_CARRID
ENDEXEC.NB: Please use the buttons "..." and "</>" to display your code nicely, and also to let the people test and fix your code easily. See how to do it here: https://community.sap.com/t5/questions-about-sap-websites/how-to-post-code-in-sap-community-gt-2024/...
NB: Please indicate your database software if it's a question about native SQL ("sql error 257" depends on the database software).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 18 | |
| 7 | |
| 6 | |
| 6 | |
| 6 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.