2014 Dec 03 3:04 PM
2014 Dec 03 3:06 PM
Yes you can. I just did a search on SCN as well as ingoogle and there are many discussions etc about this. Please do a search before posting a question. Thanks.
2014 Dec 03 3:06 PM
Yes you can. I just did a search on SCN as well as ingoogle and there are many discussions etc about this. Please do a search before posting a question. Thanks.
2014 Dec 03 3:20 PM
I did a lot of searches,
It's clear in the WHERE-condition. But I don't seem to find the subquery in the field-list of the select statement.
2014 Dec 03 3:22 PM
OK, I am sorry. My apologies I didn't read your post correctly.
The answer is NO this can not be done in ABAP. In ABAP you can only have sub queries in the where condition, not in the field list.
2014 Dec 04 4:29 AM
Hi Kris,
I just want to offer an alternative that can be implemented in Open SQL.
SELECT <any fields from T1> SUM ( T2~fkbtr) AS som54 SUM( T3~fkbtr ) AS som57
FROM fmifiit AS T1 LEFT OUTER JOIN fmifiit AS T2 ON
T2~bukrs = T1~bukrs
and T2~kngjahr = T1~kngjahr
and T2~knbelnr = T1~knbelnr
and T2~knbuzei = T1~knbuzei
and T2~wrttp = '54'
LEFT OUTER JOIN fmifiit AS T3 ON
T3~bukrs = T1~bukrs
and T3~kngjahr = T1~kngjahr
and T3~knbelnr = T1~knbelnr
and T3~knbuzei = T1~knbuzei
and T3~wrttp = '57'
WHERE ....
GROUP BY <any fields from T1>
Please note that LEFT OUTER JOIN and GROUP BY need to be used to get the same result.