on 04-29-2015 11:47 AM
Hello,
I have two entities E1 {a: Integer; b: Integer} and E2 {a: Integer; c: Integer} and I want to build a CDS view which does a union on both like:
SELECT a, b, null as c FROM E1
UNION SELECT a, null as b, c FROM E2
I have written the following:
view UnionView as select from E1 {a, b, null as c} union select from E2 {a, null as b, c}
Now I get the error message: Feature is not supported
Has anybody an idea, how to model this with a CDS view? With a graphical calculation view, this is possible, but I want to build it as a CDS view.
Regards,
Michael
What revision is your system on? I show that UNION was new syntax in SPS 09.
http://help.sap.com/hana/SAP_HANA_Core_Data_Services_CDS_Reference_en.pdf
I tried the following in my system and it worked just fine:
namespace playground;
@Schema: 'PLAYGROUND'
context unionDemo {
entity E1 {
key a : Integer;
b : String(20);
c : LocalDate;
};
entity E2 {
key x : String(20);
y : LocalDate;
z : Integer;
};
view V as
select from E1 { a, b, c}
union
select from E2 { z, x, y};
};
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Thomas,
I have a system on revision 93.
Your example is a bit different than my example.
I want to have a column in the output, which is always null for entries of E1 and another column which is always null for entries of E2.
view UnionView as
select from E1 {a, b, null as c}
union
select from E2 {a, null as b, c}
;
Here I get the error message "Feature not supported"
Regards,
Michael
Then I'm guessing the error message is telling you that the null column union isn't supported. Have you tried it without the nulls to double check that this is the cause.
Although in my system I was able to get the union with the nulls to work just fine.
@nokey
entity E1A {a: Integer; b: Integer; };
@nokey
entity E2A {a: Integer; c: Integer; };
view VA as
SELECT from E1A { a, b, null as c }
UNION
SELECT from E2A {a, null as b, c };
};
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.