on 07-27-2016 7:31 AM
I get an error trying to use a layered CDS definition in a UDF (message below).
My type declaration in the hdbdd-file looks something like this:
...
type Base {
MANDT : String(3);
KOKRS : String(4);
};
type Xtra {
BUKRS : String(4);
SEGMENT : String(10);
};
type Useful {
BaseFields : Base;
XtraFields : Xtra;
};
The function like this:
FUNCTION mySchema"."myPack::myFunction"
RETURNS "mySchema"."myPack::myDef.Useful"
...
RETURN SELECT MANDT, KOKRS, BUKRS, SEGMENT from ...
The error message is: "Could not create catalog object: return type mismatch; Attribute name "Useful.MANDT" different from Attribute name: "MANDT" ....
Obviously this works:
type Useful {
MANDT : String(3);
KOKRS : String(4);
BUKRS : String(4);
SEGMENT : String(10);
};
Is it not possible to use this type of layered declarations?
Hello Martin,
it is possible using the full qualified field name as alias.
According to your type definition the return statement should look like following:
RETURN SELECT "MANDT" as "BaseFields.MANDT", "KOKRS" as "BaseFields.KOKRS", "BUKRS" as "XtraFields.BUKRS", "SEGMENT" as "XtraFIelds.SEGMENT" from ...
I wonder a little bit about the attribute name "Useful.MANDT" in the error message, cause that does not match the type definition. But maybe that error message is from another try from you.
Regards,
Florian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.