on 2016 Apr 05 5:26 PM
Hello,
i'm trying to load datasources dynamically at runtime. Generally my source code is working.
SourceCode for loading the datasources:
SourceCode for visualization:
Comment: The script errors are normal, because the initial datasource has other measures than the dynamically loaded one.
When i use for example a crossstab and set the datasouce to the newly loaded one, the crosstab shows the correct dimensions, measures and values. But the KPI's have the value '0'.
But the getData-method of the datasource DS_1 throws the following error:
Is this a bug or what is wrong with my conding?
kind regards
Berndt Gernand
X-perion Consulting AG
Hi,
I don't think you need to put the SAP client number in single quotes, unless the database stores it like that. Try the removing it and see if it works.
What you have in the getData command is "'"+ g_active_client + "'", instead try + g_active_client +.
And if the variable g_active_client stores integer values then convert it to string and try the same.
Regards,
Swapnil Koti
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Berndt,
In the Script for Get data you need to mention Dimension but you have mentioned SAP Client in Place of Mandant that's why it's not able to pick Data, Kindly Follow the get Data Syntax Properly
eg:datasource.getdata("Keyfigure",{"Dimension": "Value"}).value
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sathish,
thanks for your answer. I already solved the problem. Generally the coding for the getData()-Method is correct. It was just a little timing problem. The application still has to wait until the datasource is initialized and only than you'll be able to get Data. That's it 😉
But now i have another problem:
Some of the Hana Live Views for Utilities (e.g.: sap.hba.isuecc/InstalledUtilitiesDeviceQuery) have a direct input parameter, witch has no relationship to a database column:
Using the following code does not work: DS_1.setVariableValueExt("P_UtilsDeviceKeyDate", "20160408");
You'll get the following error at runtime:
I also tried the date values "2016-04-08", "08.04.16", "08.04.2018" and "2016/04/08", but the result is always the same.
So i temporary switched the parameter type to "column" and assigned a date column from the associated hana view. This works ... but this is only a workaround. In this case i only can choose values, that are stored in this column. But often you want to set a key date, independently of the real date values.
It seems, that it is absolutely necessary to have master-values/-data in the hana view. Is this right? If so, i had to open an incident. This feature is a must have in reporting:
E.G.: You have a start date and an end date for an contract and you want to count all active contracts at a specific key date.
kind regards
Berndt
User | Count |
---|---|
67 | |
10 | |
10 | |
10 | |
10 | |
8 | |
8 | |
7 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.