02-19-2016 1:28 PM
Hello,
I'm trying to use the sys.dummy table to do some calculations in ADT. However, when I issue e.g. the statement
SELECT RAND()*1000 AS VAL FROM DUMMY
in SQL console I get the error
"DUMMY" is not declared as a table, projection view, or database view in ABAP Dictionary or does not exist in an active version
When I try to join dummy in a CDS view definition I get
"Basis object dummy does not exist or is not active"
In the same system, when I execute the function module SHDB_EXISTS_TABLE with I_SCHEMA_NAME = SYS and I_TABLE_NAME = DUMMY, I get a positive result. Inside, it counts the rows of the table to check whether it exists. So it must be active, otherwise it couldn't count the rows.
Is there any limitation that I can't use table DUMMY in ABAP Developer tools?
System is a HDB system with SAP_BASIS 751.
Thank you
Josef
02-19-2016 2:36 PM
Hello Josef,
the ADT SQL console uses the OpenSQL connection which is linked to the "ABAP schema" on your database system (by default it is named "SAP<SYSID>"). Because of that table DUMMY is not found due to the assignment to schema SYS.
Function SHDB_EXISTS_TABLE uses the ADBC interface which does a native SQL query on the system view TABLES.
If you have a HANA DB user and the necessary privileges you could use the HANA SQL console for your requirement. For that you have to install the SAP HANA tools in your Eclipse environment.
Regards,
Florian
02-19-2016 2:36 PM
Hello Josef,
the ADT SQL console uses the OpenSQL connection which is linked to the "ABAP schema" on your database system (by default it is named "SAP<SYSID>"). Because of that table DUMMY is not found due to the assignment to schema SYS.
Function SHDB_EXISTS_TABLE uses the ADBC interface which does a native SQL query on the system view TABLES.
If you have a HANA DB user and the necessary privileges you could use the HANA SQL console for your requirement. For that you have to install the SAP HANA tools in your Eclipse environment.
Regards,
Florian
02-19-2016 2:40 PM
Hello Florian,
thank you for your quick answer. Does that mean I cannot use sys.dummy in CDS views at all?
Regards,
Josef
02-19-2016 2:47 PM
Hi Josef,
if you are only running on SAP HANA then can implement an ABAP CDS Table Function in SAP NetWeaver AS ABAP 7.51. In the SQLScript implementation you can access SYS.DUMMY and use the RAND() function. Otherwise, it is not possible.
Regards
Chris