Quantcast
Channel: SCN : Discussion List - SAP HANA Developer Center
Viewing all 6412 articles
Browse latest View live

Annotations in HANA CDS View based OData Service

$
0
0

Hi,

 

I'm using an XSODATA Service on top of several HANA CDS Views. Is it somehow possible to define annotations like "sap:text", "sap:aggregation-role", "sap:unit" in the View/XSODATA in order to consume this information on the UI?

 

In a previous discussion I found that "sap:label" is not yet supported, but is that also true for the other annotations? And if yes, are there any plans to support these annotations in the future? There are many controls/frameworks which rely on these annotations.

 

Unfortunately putting a modeled view on top is currently not an option (we're still on SPS 9) and in principle we want to reduce the usage of modeled views as much as possible.

 

Thanks and best regards

Felix


XSJS - Ajax Post Error 403(Forbidden)

$
0
0

Hi  Experts,

I have created an xsjs to write into the tables.

I have created a simple ajax post call.

I have created this about a week ago and everything was working fine till today.
Today i am getting the error : 403 Forbidden in Chrome,

In morzilla it is giviing the error Request execution failed due to missing or invalid XSRF token


 

 

The details are as below:

 

 

I am not sure what is the reason. . . and i have not changed any system values/priviledges.

Any Idea on that ?

SAP HANA SQL - WHERE clause with OR issues

$
0
0

Hello,

 

I have a HANA SQL statement question.

 


I have the following table defined:

 

CREATE COLUMN TABLE TEST_SCHEMA.TB_TEST_DATA
(ROW_ID                    INTEGER      PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY,
FLD1                      VARCHAR(255) NOT NULL,
FLD2                      VARCHAR(255) NOT NULL,
FLD3                      VARCHAR(255) NOT NULL,
FLD4                      VARCHAR(255) NOT NULL,
FLD5                      VARCHAR(255) NOT NULL,
FLD6                      VARCHAR(255) NOT NULL,
FLD7                      VARCHAR(255) NOT NULL,
FLD8                      VARCHAR(255) NOT NULL,
FLD9                      VARCHAR(255) NOT NULL,
FLD10                     VARCHAR(255));

 

 

I have loaded the above table with the following data:

 

insert into TEST_SCHEMA.TB_TEST_DATA
(ROW_ID, FLD1, FLD2, FLD3, FLD4, FLD5, FLD6, FLD7, FLD8, FLD9, FLD10)
VALUES (1, 'VAL 1', 'VAL 1', 'VAL 1', 'VAL 1', 'VAL 1', 'VAL 1', 'VAL 1', 'VAL 1', 'VAL 1', 'VAL 1');

 

insert into TEST_SCHEMA.TB_TEST_DATA
(ROW_ID, FLD1, FLD2, FLD3, FLD4, FLD5, FLD6, FLD7, FLD8, FLD9, FLD10)
VALUES (2,'VAL 1', 'VAL 1', 'VAL 2', 'VAL 2', 'VAL 2', 'VAL 2', 'VAL 2', 'VAL 2', 'VAL 2', 'VAL 2');

 

insert into TEST_SCHEMA.TB_TEST_DATA
(ROW_ID, FLD1, FLD2, FLD3, FLD4, FLD5, FLD6, FLD7, FLD8, FLD9, FLD10)
VALUES (3,'VAL 2', 'VAL 2', 'VAL 1', 'VAL 1', 'VAL 1', 'VAL 1', 'VAL 1', 'VAL 1', 'VAL 1', 'VAL 1');

insert into TEST_SCHEMA.TB_TEST_DATA


(ROW_ID, FLD1, FLD2, FLD3, FLD4, FLD5, FLD6, FLD7, FLD8, FLD9, FLD10)
VALUES (4,'VAL 2', 'VAL 2', 'VAL 2', 'VAL 2', 'VAL 2', 'VAL 2', 'VAL 2', 'VAL 2', 'VAL 2', 'VAL 2');

 


The following UNION ALL select executes successfully returning all 3 rows:

 

SELECT *
   FROM TEST_SCHEMA.TB_TEST_DATA
  WHERE (FLD1 = 'VAL 1' AND FLD2 = 'VAL 1' AND FLD3 = 'VAL 1')
UNION ALL
SELECT *
   FROM TEST_SCHEMA.TB_TEST_DATA
  WHERE (FLD1 = 'VAL 1' AND FLD2 = 'VAL 1' AND FLD3 = 'VAL 2')
UNION ALL
SELECT *
   FROM TEST_SCHEMA.TB_TEST_DATA
  WHERE (FLD1 = 'VAL 2' AND FLD2 = 'VAL 2' AND FLD3 = 'VAL 1') 

 


When I combine the top 2 selects using OR in the WHERE clause and execute it all 2 rows are returned.

 

SELECT *
   FROM TEST_SCHEMA.TB_TEST_DATA
  WHERE (FLD1 = 'VAL 1' AND FLD2 = 'VAL 1' AND FLD3 = 'VAL 1')
     OR (FLD1 = 'VAL 1' AND FLD2 = 'VAL 1' AND FLD3 = 'VAL 2')

 

Result
------
ROW_ID;FLD1;FLD2;FLD3;FLD4;FLD5;FLD6;FLD7;FLD8;FLD9;FLD10
1;VAL 1;VAL 1;VAL 1;VAL 1;VAL 1;VAL 1;VAL 1;VAL 1;VAL 1;VAL 1
2;VAL 1;VAL 1;VAL 2;VAL 2;VAL 2;VAL 2;VAL 2;VAL 2;VAL 2;VAL 2

 


When I combine the bottom 2 selects using OR in the WHERE clause and execute it the database returns an error and crashes.

 

SELECT *
   FROM TEST_SCHEMA.TB_TEST_DATA
  WHERE (FLD1 = 'VAL 1' AND FLD2 = 'VAL 1' AND FLD3 = 'VAL 2')
     OR (FLD1 = 'VAL 2' AND FLD2 = 'VAL 2' AND FLD3 = 'VAL 1') 


The following error is received error:

 

Could not execute 'SELECT * FROM TEST_SCHEMA.TB_TEST_DATA WHERE (FLD1 = 'VAL 1' AND FLD2 = 'VAL 1' AND FLD3 = 'VAL 2') OR ...' in 4:29.324 minutes .
Data receive failed.

 


Does anyone know what might be causing this issue?

 

 

Our current configuration is as follows:
SAP HANA studio
Version: 1.00.81.0
Internal Version: 1.81.2 (1812)

 


Thanks,
Victoria

Unable to Add schemas and Databases into Eclipse

$
0
0

Hi Experts,

 

I am having HANA cloud account(p1941658066trial).

 

when I am trying to add cloud system in Eclipse, it is giving me below error. Kindly help me to resolve this issues.


Hanna.png

 

Regards,

Penchalaiah N

xsjs sql query fails

$
0
0

Hi there,

 

I am currently playing around with the HANA Development Studio in Eclipse.

 

I created my own Databasetable in my own Scheme:

ZHemp.ZHempXSProject::ZHempMaterial

 

Now I am trying to query data from that table in a xsjs file:

 

$.response.contentType = "text/html";

var output = "Hello" <br><br>\n";

 

var conn = $.hdb.getConnection();

conn.executeQuery('SELECT "MaterialNumber" FROM "ZHemp"."ZHempXSProject::ZHempMaterial"');

 

 

$.response.setBody(output);

 

When I comment out the executeQuery line, everything works fine and I get an html page with the content "Hello".

But when I run it as it is, I only get a "500 - Internal Server Error".

 

Any Idea?

 

Thanks,

Bodo

Passing parameters from UNIX to HANA

$
0
0

Hello All,

 

Can anyone tell me if there is an equivalent to Oracle's &1 parameter for HANA? I'm trying to pass some parameters when calling a procedure in HANA from UNIX so that we can run it from a scheduler (Tivioli's TWS). I've tried things like :variable_name, $$variable_name$$ and ?? etc but I don't seem to be getting very far.

 

If it was Oracle I'd use $1 for the UNIX script, then when passing the parameter to the Oracle SQL script I'd use &1 and every ones happy.

 

Any tips or pointers would be greatly appreciated.

 

Thanks

Matt

HANA Studio Hangs (Not Responding)

$
0
0

Hi

 

We had HANA DB SPS5 and HANA Studio 1.00.49 and everything was working fine. We upgraded DB to SPS6 and our studio stopped working. Thought HANA Studio might be the cause and upgraded it to be in sync with DB to 1.00.67. Now I am getting the same error as below. I am not able to go to Data Provisioning, Content etc. The studio says Not Responding and if I force it to close I get the error message. I checked the links on similar issues and tried uninstalling, and installing a fresh one. Still no change. Should I change the Java versions? I have 1.7 JDK.. Any suggestion would help?

 

 

HANA_Studio_error.png

 

Thanks,

Raj

How to implement AMDP class using "alter".

$
0
0

Hi Gurus!

 

I will implement AMDP class for adding identity to HANA user.

Can AMDP class use "alter" ?

 

I want to use below sql in AMDP class.

"alter user <User-ID> add identity <identity value>;"

 

If anyone have sample AMDP source code using "alter", colud you please let me know?

 

Regards,

Wakiyama


Getting the SQL Script behind a Graphical Calculation View

$
0
0

I want to see the SQL script that is generated when I run my graphical calculation. By this I do not mean the select statement that extracts data from the view, but the statement that gets data from the database itself which includes the names of tables used inside the calculation view. Does anyone know of a way to do this?

 

Thanks.

HANA script - merge sql statements - syntax

$
0
0

Hi

 

I'm trying to create a very simple HANA SQL statement which will delete backups in the catalog older than 30 days, and struggling to link the 2 original statements I wish to use due to syntax issues.  Will be so helpful if someone can assist with the HANA syntax to link this 2 statements!

 

I have the following:

 

This script will select the output of the a backup ID older than 30 days:

 

SELECT TOP 1 min(to_bigint(BACKUP_ID)) FROM SYS.M_BACKUP_CATALOG where SYS_START_TIME >= ADD_DAYS(CURRENT_TIMESTAMP, -30) and ENTRY_TYPE_NAME = 'complete data backup' and STATE_NAME = 'successful'

 

and in this script I wish to use the output of the top SQL:

 

BACKUP CATALOG DELETE ALL BEFORE BACKUP_ID xxxxx COMPLETE

 

 

I can't get it to work by linking these 2 statements above, I tried by placing it in brackets, eg :  (will be great if this could work - merge into a single statement)

 

BACKUP CATALOG DELETE ALL BEFORE BACKUP_ID ( SELECT TOP 1 min(to_bigint(BACKUP_ID)) FROM SYS.M_BACKUP_CATALOG where SYS_START_TIME >= ADD_DAYS(CURRENT_TIMESTAMP, -30) and ENTRY_TYPE_NAME = 'complete data backup' and STATE_NAME = 'successful' )  COMPLETE


also not by assigning a variable to it: SET 'MY_VAR'=select TOP 1 min(to_bigint(BACKUP_ID)) FROM SYS.M_BACKUP_CATALOG where SYS_START_TIME >= ADD_DAYS(CURRENT_TIMESTAMP, -27) and ENTRY_TYPE_NAME = 'complete data backup' and STATE_NAME = 'successful';


I managed to create a procedure:


create procedure BACKUPID_30

language SQLSCRIPT AS

BACKUPID integer;

begin

select TOP 1 min(to_bigint(BACKUP_ID)) FROM SYS.M_BACKUP_CATALOG where SYS_START_TIME >= ADD_DAYS(CURRENT_TIMESTAMP, -30) and ENTRY_TYPE_NAME = 'complete data backup' and STATE_NAME = 'successful';

end

 

but also struggling to assign the output of the procedure to a variable: SET 'MY_VAR'=CALL "BACKUPID_27"

 

Will someone please advise on this merge?

 

Thanks

Sql Error while creating a script view in Sap HANA sps1.7

$
0
0

Hi experts,

 

can some one help me find the solution for the task described below.

 

Task: INVOICING ERRORS

 

DEF: Billing orders existed in future will be considered as a Invoicing errors.

  1. Table: Tab001  which contains all the billing orders.
  2. Dimensions : ANL001(Installations), ABRDATS(Schedule Billing Date)  along with other dimensions and Count() will act as a key figure.
  3. Condition 1:  ABRDATS >=SYSTEM DATE, No.of Entries(billing orders) that it display will be counted by count function(no.of invoice errors).

     Entries can be picked through a Master attribute  ANL001.


    4. Condition 2: ABRDATS< SYSTEM DATE., the no .of  entries that it displays with ANL001 must not match with the entries in future.


please see the below SQL script view developed for your clear vision.


/********* Begin Procedure Script ************/

BEGIN

Inst_not_in_Tab001 = select a.BUK001 AS "Company_Code",

                            a.SPA001 AS "Division",

                            a.ANL001 as "Installation",

                            a.COUNT_ANL001 as "COUNT",

                            from "_SYS_BIC"."Dake/AV_INVOICING_ERRORS_Tab001" a

                            select a.ANL001 from "_SYS_BIC"."Dake/AV_INVOICING_ERRORS_Tab001"  And ABRDATS >= SYS_DATE

                             where a.ANL001 not in

                             (select distinct b.ANL001 from "_SYS_BIC"."Dake/AV_INVOICING_ERRORS_Tab001" b) where ABRDATS <= convert(varchar(10), getdate(), 112)

      var_out = select "Company_Code","Division","Installation","COUNT"

      from :Inst_not_in_Tab001 

END

/********** End Procedure Script ************/

 

Note: DB date has a YYYYMMDD format where as we know for the  system as MM/DD/YYYY , consider this date format could also cause an error while the script calls the sys_date() function.

 

errors am getting in HANA while executing the script is below

 

 

 

quick help appreciated.

 

Thank you

dake

more Primary Keys for a table

$
0
0

Hi All,

 

I have a requirement as below.

 

The Number of columns in a HANA table is 110 and 9 fields combined can make the record unique. Is is a good idea to make the 9 fields as primary keys. What will be impact on the loading performance ? I am planning to build a attribute view on top of the table and selecting only 30 fields out of all 110 fields. Will there be any impact on the query performance ? The volume of data expected is 1GB and its a full load daily.

 

Please throw your views on this.

Send value from outer to inner Calculation View

$
0
0

Hi

I want to pass a value from the outer calculation view to a filter (on a cloumn) within the inner calculation view, both the views being of graphic type. The value is to be hard-coded in the outer calculation view, i.e. we do not need to ask the user to enter it. I haven't been able to find any option anywhere to do that. Any help is appreciated

XSOdata service : 503 not available

$
0
0

Hi All,

 

I have created a xsodata service using a Calculation view , the service defination is following:

 

service  {

 

"CEO_Dasboard.OPERATIONS::CEO_DB_REVENUES"as"RevenueSet"keysgeneratelocal"ID"

aggregatesalways;

 

annotations {

enableOData4SAP;

}

 

Where CEO_DB_REVENUES is my cal view , but when I am trying to access this service using the URL

 

https://wdpoc.pdrsap.com/CEO_Dasboard/OPERATIONS/KPI/service/Revenue.xsodata

 

IT gives me error  "503 Service not available" , I can see my service is activated with orange icon. I have attached screenshot of my Calc view and XS odata service.

 

Regards

Deep

INSERT to virtual table fails

$
0
0

Hi all,

is there any restriction on the INSERT statement to virtual tables? When I insert with the VALUES clause, it works, but when I try to insert with a subquery like

 

INSERT INTO vv SELECT * FROM t;

 

* 403: internal error: Error executing query ERROR: null value in column "time" violates not-null constraint

Failing row contains (null, null, null, null, null, null).;

Error while executing the query for query " INSERT INTO public.vv ( time, c, t, i, a, p) VALUES (?, ?, ?, ?, ?, ?)" SQLSTATE: HY000

 

and of course there are no NULL values in t. This is Hana 1.00.091.00.1418659308 and Postgres 9.4.

 

-- Micha


CDS View on custom type: Sub artifact not found

$
0
0

Hello,

 

a simple view in a .hdbdd file as follows. Activation always comes up with error: "Sub artifact HISTORY not found in MD.Products".

 

 

namespace ndw_app1.generated;
@Schema: 'MEISERM'
context viewtest {  view SOURCE as select from "sap.hana.democontent.epm.data::MD.Products" {  CATEGORY,  CURRENCY,  DEPTH,  DESCID,  DIMENSIONUNIT,  HEIGHT,  HISTORY.CHANGEDAT,  HISTORY.CHANGEDBY.EMPLOYEEID,  HISTORY.CREATEDAT,  HISTORY.CREATEDBY.EMPLOYEEID,  NAMEID,  PRICE,  PRODUCTID,  PRODUCTPICURL,  QUANTITYUNIT,  SUPPLIER.PARTNERID,  TAXTARIFFCODE,  TYPECODE,  WEIGHTMEASURE,  WEIGHTUNIT,  WIDTH  };
};

 

Any idea what I am missing?

 

Best regards,

Mathias

XSOData service on Analytical View

$
0
0

Hi Hana Gurus

 

Could someone help here.

 

 

Acutally , i would like to expose my Analytical view as OData service.

 

Within my XS Project , i have created blank xsapp file along with  xsaccess with  below content

 

  • xsapp -- Blank file
  • Profiles1.png

===========================

  • xsaccess -

Profiles2.png

===========================

  • index.html

<html><head> </head>

<body>

Testing dummy file

</body>

</html>

===========================

  • Order,xsodata.

//To define the XS OData service use the following syntax:

 

service  namespace "MyData"{

  

"sandbox.ecc.xxxxx.Open_Orders/ZAN_SALESORDER_DETAILS_BKUP2.analyticview" as "ORDER" keys generate local "ID";

 

 

}

 

Profiles3.png

 

 

After validate and activating the project.


I am able to access the index.html but On accessing the Odata service , i get ERROR :403


Same happens even if i try to expose simple ADRC table as ODATA service.


 

403 - Forbidden

The server refused to fulfill the request.



Profiles4.png


, any pointer are highly appreciated.

 

Thanks

Kumar

sapcontrol request failed:connection refused:connect

$
0
0

Hi Gurus,

 

 

I am unable to login to HANA studio . my user id and password is correct as i access hana previously .

 

Screen shot:

HANA Smart Data Access With postgreSQL driver

$
0
0

Friends,
Any one tried to install an alternate ODBC or JDBC driver to connect HANA Smart Data Access to a Postgresql data source?

If I were to use the ODBC generic where do i create a Domain Source Name with the connection properties?

Any help is appreciated.

Thank you for your diligence.

Zachary.

 

version: 1.00.80

suse LInux Ent. Server 11.2

Dropping automatically created fulltext indeces

$
0
0

Hi,

 

I want to change a fulltext index on a text field (for full/sentiment analysis), however I cannot drop the automatiaclly created index. Trying to do so raises this error:

 

Could not execute 'DROP FULLTEXT INDEX "_SYS_FULLTEXT_287592_#0_#BODY"' in 2 ms 984 µs .

SAP DBTech JDBC: [383] (at 20): invalid identifier: _sys_ prefix not allowed: _SYS_FULLTEXT_287592_#0_#BODY: line 1 col 21 (at pos 20)

 

Has anybody come across this? Is there another way of dropping an index?

Viewing all 6412 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>