2023 Aug 08 11:34 AM
Hello Experts,
In left outer join the table in the right side depends on the value of a field in the left side table.
For example
1. Select from tbl1
2. If tbl1-fld2 = 1
then
Select fld1 into corresponding …
From tbl1
Left outer join tbl2_a
Else
Select fld1 into corresponding …
From tbl1
Left outer join tbl2_b
Something like that:
Select fld1 into corresponding …
From tbl1
Left outer join case tbl1~fld2 = 1 (tbl2_a)
Else (tbl2_b)
On ….
How can I write it in ABAP's select statement?
Thank you
Hagit
2023 Aug 08 11:57 AM
Formatting of question is awful, difficult to read and understand.
I think the question is better written this way (according to me):
-----------------------------------------------------------------------------------------------------------
In left outer join the table in the right side depends on the value of a field in the left side table.
For example
Select from tbl1
If tbl1-fld2 = 1 then
Select fld1 into corresponding …
From tbl1
Left outer join tbl2_a
Else
Select fld1 into corresponding …
From tbl1
Left outer join tbl2_b
How can I write it in ABAP's select statement Something like below?
Select fld1 into corresponding …
From tbl1
Left outer join case tbl1~fld2 = 1 (tbl2_a)
Else (tbl2_b)
On ….
2023 Aug 08 12:03 PM
2023 Aug 08 12:57 PM
I want to clarify that tbl2_a and tbl2_b are decided at runtime