2020 Apr 08 8:58 AM
Hi experts,
I need to rewrite the following code in ABAP.
outTab = SELECT
COALESCE (team_p.role_id, ") as "CPR_ROLE",
record,
SQL_PROCEDURE_SOURCE_RECORD
FROM:inTab AS it
LEFT OUTER JOIN "/BIC/APCPMAA022" AS team_p
ON it.root_key=team_p.root_key and
WHERE team_p.role_id='XX01'
Alternatively, we could correct the code here, because the last WHERE statement causes an error.
I'd be most grateful if you could give me some advice.
Thanks in advance!
Piotr
2020 Apr 08 9:48 AM
What ABAP code did you try? What syntax error did you get?
2020 Apr 08 1:57 PM
piotrillo,
Am afraid we wont be able to support you with the available information. For instance the above query is fetching data from local variable :it_root, unless we know the data logic for this we wont be able to support.
Also do let us know the code you have tried so far, which will be helpful for us to correct.
Regards!
2020 Apr 08 4:35 PM
The error is just
SQLSCRIPT: sql syntax error: incorrect syntax near "WHERE"
I haven't tried it in ABAP, I'm not so good at abap.
But I think it would be better to rebuild this logic in ABAP.
What do you think? Maybe someone can help me to do it in ABAP.
2020 Apr 09 1:10 PM
ON it.root_key=team_p.root_key and
WHERE team_p.role_id='XX01'
In your case "and" and "where" standing this close are causing the error. You need only one of them
2020 Apr 09 3:40 PM
What Artem says. Clearly it's not syntactically correct. I wonder why your first attempt at "fixing" this is to try to write it in ABAP?
2020 Apr 08 7:12 PM
Hi
Change your query as below
outTab = SELECT
COALESCE (team_p.role_id, ") as "CPR_ROLE",
record,
SQL_PROCEDURE_SOURCE_RECORD
FROM :inTab AS it
LEFT OUTER JOIN
(select * froom "/BIC/APCPMAA022" WHERE team_p.role_id = 'XX01') AS team_p
ON (it.root_key = team_p.root_key)
<br>