12-19-2006 2:53 PM
Hi,
I want to do a union all for two open SQL statements at the database level, e.g:
SQL statement 1
UNION ALL
SQL statement 2.
Is this possible with ABAP open sql? I know its possible via native sql or using manipulations via ABAP internal tables (FOR ALL ENTRIES, joins, etc) but I don't want to take these routes and want to do it with just a SQL instead...So is this possible?
12-19-2006 3:05 PM
12-19-2006 3:22 PM
Already covered the sub query option but its not applicable to what I need since I am interested in a union of datasets rather than the results of dataset derived from another dataset.
12-19-2006 3:30 PM
Hi Thang,
Check this link perhaps it may help.
http://help.sap.com/saphelp_nw2004s/helpdata/en/05/5b0e24d68849d4abcf034885ca82a0/content.htm
Regards,
Ferry Lianto
12-19-2006 3:45 PM
Try with two open sql select statements works similar to UNION ALL:
select f1 f2 from tab1 into corresponding fields of table itab.
select f1 f2 from tab2 appending corresponding fields of table itab
Regards
Sridhar
12-19-2006 5:09 PM
thanks for the info everyone. figured in the end that ABAP OPEN SQL couldn't handle UNIONs very well as per native SQL. Had wanted to transfer the processing logic to the DB but in the end of the day, I gave up and just did the union using internal tables.
08-09-2016 8:22 PM