Reputation: 425
I want to do an inner join on the SAP tables BSEG and AUFK.
At my selection screen I have a selection of g/l-accounts (SELECT-OPTIONS s_hkont FOR hkont.
) and I want tis selection as parameter in my database select.
SELECT bseg~hknot, bseg~zuonr FROM bseg INNER JOIN aufk
ON bseg~hkont IN @s_hkont
AND aufk~aufnr = bseg~zuonr
INTO @DATA(output).
ENDSELECT.
The keyword IN
is not supported ("IN" is invalid here (due to grammar).
).
How can I use select-options
in a database select with an inner join?
Thanks in advance!
Upvotes: 0
Views: 1236
Reputation: 10522
I think your query should look like this.
SELECT bseg~hkont, bseg~zuonr FROM bseg INNER JOIN aufk
ON aufk~aufnr = bseg~zuonr
WHERE bseg~hkont IN @s_hkont
INTO @DATA(output).
ENDSELECT.
Upvotes: 1