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

SAP HANA XSA: How to use xshttpdest with XSA?

$
0
0

I am trying to call an xsjs file from another xsjs file using xshttpdest in XSA. The developer guide mentions a word on xshttpdest using destinationProvider property in sap-xsjs. I tried implementing it but I keep facing the error. 2016-07-08_20-21-32.jpg

And the following is my folder structure for the xsjs app

xsjsapp structure.jpg

Sorry for stuffing the image!

If you look at the File.xsjs, the first line reads the xshttpdest and this is where it runs into the error.

var dest = $.net.http.readDestination("TestXSJS.xsjs.lib.myFolder", "myFile");
var client = new $.net.http.Client();
var req = new $.web.WebRequest($.net.http.GET);
client.request(req, dest);
var response = client.getResponse();
var body = undefined;
if (response.body) var body = response.body.asString();
$.response.contentType = "text/plain";
$.response.setBody(body);

 

And in start.js as per the developer guide I have mentioned the following code piece:

var xsjs = require('sap-xsjs');
var xsenv = require('sap-xsenv');
var port = process.env.PORT || 3000;
console.log('here'+ port);
var options = xsenv.getServices({ hana:{tag:'hana'}, uaa:{tag:'xsuaa'} });
options.destinationProvider=function getDestinationSync(packagename, objectname, dtDescriptor) {
console.log('I am being executed');
};
xsjs(options).listen(port);
console.log('XSJS application listening on port %d', port);

Lines 6-8 is what I have added to have the xshttpdest identified but I keep getting the error I posted in the image above.

The following is what my manifest file looks like:

---
applications:
- name: web075361  port: 65100  path: ui  memory: 2048M  instances: 1  env:    destinations: >      [        {"name":"xsjs", "url":XXXXX:65101", "forwardAuthToken": true}      ]  services:  - sp-hdi  - sp-uaa
- name: xsjs075361  port: 65101  memory: 1024M  instances: 1  path: xsjs  services:  - sp-hdi  - sp-uaa

There is no material/working example available yet to try this out. Any inputs on this more elaborate than what is mentioned in the developer guide for XSA would be really helpful.

Thanks.



Communication between XSA environment and Classic XS environment on the same host

$
0
0

We are building an XSA app. It is a HANA (HDI), JAVA, UI5(approuter) stack on XSA. This stack populates the DB. Now we have some XS content in the standard XS stack that we want to run on the HDI DB artifacts and see the results on the ui for which we have created a separate UI5 web app. I am aware of the fact that the xs app can run inside the Node runtime. But for some reason we cannot transport the content in the XS stack to XSA stack. So considering this the only option is to establish a communication between XSA and XS environment. To be specific, the problem is in the approuter xs-app.json of this app. When you specify the "routes" section in this file, we say if the path is /a/b/c/d, then the destination should be <host>:80<instance_id> (note that it is the XS port NOT the XSA port).This does not work. Is that the expected behavior? Do we have any solution to establish such a connection between the XSA and XS environment?

Calling scripted calc view from another scripted calc view with INPUT PARAMETERS

$
0
0

Hi All,

 

I am trying to call a scripted calculated view with INPUT PARAMETERS from another scripted calculated view and passing INPUT PARAMETER and having trouble activating it.

 

1. I am able to call the scripted calculated view with INPUT PARAMETERS from a Graphical Calculated view and able to pass INPUT PARAMETERS and I could do this on multiple level in other Graphical view.

 

2. When referring and calculation view with INPUT PARAMETERS the values are passed using PLACEHOLDER syntax in the FROM clause. So I tried the same when invoking the scripted calculation from another scripted calculation view and get and error"argument type mismatch: Only named parameter is supported for column view search" (It expects actual values)

 

I changed it different ways but no success. Attached is the sample work I did.

 

Two Questions:

1. Is it possible to call Graphical Calculated View from Scripted Calculated view with INPUT PARAMETERS?

2. Is it possible to call Scripted Calculated View from another Scripted Calculated View with INPUT PARAMETERS?

 

Any ideas?

 

Arthur.

Full Text Index Question.

$
0
0

Experts and those more knowledgeable than I,

 

I have a trigger on insert of table A, insert the value of A.message to table B.

 

My full text index is on B.message.

 

After the B.message is Indexed and added to the generated table by Using Full Text Index; TA_B.. Can I delete B where B.ID = TA_B.ID?

 

I did a test..
The data is still there, after I deleted the value from B
I forced a Delta Merge on all tables involved..

 

Can anybody give me a little more re assurance that deleting from B will not delete my data in TA_B?


THank you for your time and diligence.
-Z-

How to send SMS from HANA XS using java script

$
0
0

Hello Colleagues,

I have requirement to notify users via email and sms in case of any critical change. I am able to send emails via SMTP XSJS API's.

I am not able to get any information on sending SMS. I am not sure even if it is supported currently.

 

Need your expert inputs on this. Thanks in advance...

 

Regards,

Amit Sharma

How to do a lookup

$
0
0

I need some guidance on best way to do this in HANA

 

Customer    Group     

(blank)         AB          

C1234          CD         

 

I need to assign a Group to each Customer.  If the Customer is maintained in the table, use the Group assigned to the customer.  If the Customer is not found, assign to Group 'AB'.

 

Can I do this using Joins or do I have to write SQL Script code?

Thanks.

UPDATE FULLTEXT INDEX

$
0
0

Hey all I hope you can help me with this problem.

 

I am loading Twitter Data via Node js into a HANA DB table. I got a Fulltext index (Voirceofcustomer)(FAST PREPROCSSING OF, ANALiTCS and TEXT MINING on) on it.

(This is the initial create statement, so you know what the index is about

 

 

CREATE FULLTEXT INDEX TWITTER_DATA_INDEX ON "GRUPPE_3"."TWITTER_DATA"("Tweet")

FAST PREPROCESS OFF

SEARCH ONLY OFF

TEXT ANALYSIS ON

CONFIGURATION 'EXTRACTION_CORE_VOICEOFCUSTOMER'

TEXT MINING ON

LANGUAGE DETECTION('EN','DE','IT','FR','ES')

 

 

How do I update the fulltext index $ta Table with the new data? (via SQl, or...).

It stays empty for me if I throw in new data (even after an hour of waiting for asnyc...)

 

Thank you very much !

Is it possible to create a view in HANA CDS which queries from a table in repository (not from the entity)?

$
0
0

Dear Experts,

 

I am trying to create a view in Hana CDS which will fetch data from "SCARR" table of "SFLIGHT" schema.

 

Code:

 

namespace dev.cds.model;

 

 

@Schema: 'CDS'

context sampleCDS {

 

 

    view sample as select from "SFLIGHT"."SCARR"

   {

    CARRID,

    CARRNAME,

    CURRCODE,

    URL

   };

 

 

};

 

When I try to activate this CDS document, it is throwing an error saying 'Cannot find artifact "SFLIGHT"' .

 

As per my understanding, it is trying to find the SFLIGHT entity in the same CDS document, but I want it to fetch data from a table in schema(which was imported, not created through any CDS document).

 

Is it possible to achieve my requirement through CDS ?, I have been referring multiple sources including reference docs, but couldn't find any guidance.

 

I am using HANA MDC Trial, 1.00.102.03.1449674847.


SAP HANA Cloud Trial account - Content - Insufficient privilege

$
0
0

Dear SCN members,

 

I am trying to use free trial HANA Cloud account mentioned in Open SAP https://account.hanatrial.ondemand.com but after creating an account and schema, I have added the account in HANA studio.

 

But in Contents folder, I am receiving an error as "Insufficient privilege (EXECUTE on REPOSITORY_REST)".

 

Hence, I cannot try the practice sessions provided.

 

Please suggest the solution or guide me if I have missed anything in the setup of an account.

 

Thanks in advance,

 

Regards,

Nachappa S

Insufficient privilege (EXECUTE on REPOSITORY_REST) error on /content folder

$
0
0

I am using trial account of hana ondemand, I connected to the cloud system in hana studio, but the content folder is showing the error "Insufficient privilege (EXECUTE on REPOSITORY_REST)", I was following tutorial - Creating a SAP HANA XS application from the one of the tutorial documented in SAP HANA Cloud Platform

 

This is the studio screenshot for more details:

xs1.png

 

How to overcome this error, I am stuck at Step-3 Create a sub-package of the above mentioned tutorial for creating a SAP XS application.

Many Thanks!!

Call Procedure from .XSodata Service

$
0
0

Hello Forum,

I want to call a procedure when i add something to an odata service.

 

I created the procedure like this. I removed the custom logic. It works when i call the procedure in the sql console with "call <"Schema Name">."example3":

 

create PROCEDURE <"Schema Name">."example3"

LANGUAGE SQLSCRIPT AS

BEGIN

/*****************************

  Write your procedure logic

*****************************/

*

*
*
*

END

 

 

Now i want to tell the OData Service that he should use the procedure by adding the "create using.." Statement like this:

 

service{

"S0016089493"."Survey" as "Survey"

    create using <"Schema Name">."example3";

}

 

 

 

The console throws a systax error stating that "<"Schema Name">."example3" is incorrect or misaplaced.

 

 

I googled a lot, read in the forum and took a look at the documentation but i don't find the mistake.

Greetings,

Oliver

Problem in nested IF loop in calculated column

$
0
0

Hello,

 

I am trying to use nested IF loop in a calculated column. My requirement is as below.

 

IF "MBEW" = 0 THEN

   STATUS = 'NA'

ELSEIF "MBEW" > 0 THEN

 

       IF  "NET_CONS_CARATS" > 0 THEN

               STATUS = 'C'

       ELSEIF    "TRANSIT_QTY"  >  0 THEN

               STATUS = 'TR'

       ELSEIF  "DIR_PEND_CARATS" > 0 THEN

               STATUS = 'NA'

      ELSEIF  "TTL_OH_CARATS" > 0 THEN

               STATUS = 'A'

      ELSE

               STATUS = 'NA'

      ENDIF.

 

 

ENDIF.

 

 

For this I tried to use nested IF with 2 different ways, as below in HANA calculated column.

 

1)   IF("MBEW_LBKUM" = 0 , 'NA', IF("MBEW_LBKUM" >  0  AND "NET_CONS_CARATS" > 0 , 'C' ,  IF ("MBEW_LBKUM" >  0 AND "TRANSIT_QTY"  >  0 , 'TR',  IF("MBEW_LBKUM" >  0 AND "DIR_PEND_CARATS" > 0, 'NA',  IF("MBEW_LBKUM" >  0 AND "TTL_OH_CARATS" > 0 , 'A','NA')))))

 

2)  IF("MBEW_LBKUM" =  0 , 'NA',  IF("NET_CONS_CARATS" > 0 ,'C' , IF("TRANSIT_QTY"  >  0, 'TR', IF("DIR_PEND_CARATS" > 0, 'NA', IF("TTL_OH_CARATS" > 0, 'A','NA')))))

 

 

I am sure that the second try is wrong. But with both codes it is considering only first equation of else part ie. IF("MBEW_LBKUM" >  0  AND "NET_CONS_CARATS" > 0 , 'C'  . For rest of the scenarios it is giving null output (?) .

 

Please check and help with proper way to write it.

 

 

Thanks,

Shriniwas

XS Engine Session Timeout?

$
0
0

Hi,

 

Anyone know if it is possible to set the XS Engine Session Timeout at the server side (say I want my sessions to last no more then 2 minutes before the user has to login again). I do not seem to find a global setting for that, or should I just do that in the code?

 

thx.

S.

Input parameter

$
0
0

Dear all,

 

In hana studio, I build two input parameters:"Year" and "Month"

 

And I put the two parameters as filters in calculation view,

 

There are two cases,

 

one case,  I want to view the data on date 2016-03, I just input year(2016) and month(03) in the filter, the result is ok

 

second case, I want to view the whole year data, such as year 2016, I just input year(2016) in the filter, do nothing in the filter month, there is nothing

 

How to solve the problem, if I input nothing in the filter, the database returns the all data

 

Many thanks

CDS view with SQL Privileges

$
0
0

Hi all,

 

Since SP11 it should be possible to add CDS view to SQL Privileges. I am not able add CDS objects or add the view below (V_VBAP) to SQL Privilege.

 

@WithStructuredPrivilegeCheck: true

view V_VBAP as select from VBAP_SYN

{

          "MANDT", "VBELN"

};

 

I am using the first revision of SP11. I have attached the presentation given by SAP which shows how it works. Did I miss something?

 

Second issue: I have created structured privileges by using SQL statement for this V_VBAP view, but this privilege is not available as an object in a package. Therefor it can not be moved to other environments. See statement below. Any idea how to add this structured privilege to a package.

 

CREATE STRUCTURED PRIVILEGE AP_VIEW_SQL FOR SELECT ON "DD.V_VBAP" WHERE "MANDT" = '100';

 

I would gladly receive a solution for this.


Thanks


Is syntax description correct for CREATE SPATIAL REFERENCE SYSTEM

$
0
0

I do not understand CREATE SPATIAL REFERENCE SYSTEM

 

I want to create a new spatial reference system which is based on an EPSG srid, but I'd like to register it with a different SRS_ID.

View ST_SPATIAL_REFERENCE_SYSTEMS has columns SRS_ID and ORGANIZATION_COORDSYS_ID.

So how do I fill those columns with different values?

I can only create a new spatial reference system where SRS_ID and ORGANIZATION_COORDSYS_ID are the same...

 

I tried:

 

CREATE SPATIAL REFERENCE SYSTEM "Test My CS"

SRID 1213

LINEAR UNIT OF MEASURE "meter"

TYPE PLANAR

COORDINATE X BETWEEN 0 AND 400000

COORDINATE Y BETWEEN 0 AND 700000

DEFINITION 'HELLO WORLD'

ORGANIZATION "EPSG" IDENTIFIED BY 1212;

 

But that fails on SRID...

Could not execute 'CREATE SPATIAL REFERENCE SYSTEM "Test My CS" SRS_ID 1213 LINEAR UNIT OF MEASURE "meter" TYPE PLANAR ...'

SAP DBTech JDBC: [257]: sql syntax error: incorrect syntax near "SRS_ID": line 2 col 1 (at pos 48)

 

 

While the definition of the statement is. see : SAP HANA Spatial Reference - SAP Library

 

CREATE SPATIAL REFERENCE SYSTEM <srs-name>

[ srs-attribute ] [ srs-attribute ... ]

 

srs-attribute - (back to Syntax)

SRID <srs-id>

  | DEFINITION { <definition-string> | NULL }

  | ORGANIZATION

  { <organization-name> IDENTIFIED BY <organization-srs-id> | NULL }

  | TRANSFORM DEFINITION { <transform-definition-string> | NULL }

  | LINEAR UNIT OF MEASURE <linear-unit-name>

  | ANGULAR UNIT OF MEASURE { <angular-unit-name> | NULL }

  | TYPE { ROUND EARTH | PLANAR }

  | COORDINATE <coordinate-name>

  { UNBOUNDED | BETWEEN <low-number> AND <high-number> }

  | ELLIPSOID SEMI MAJOR AXIS <semi-major-axis-length>

  { SEMI MINOR AXIS <semi-minor-axis-length> |

  INVERSE FLATTENING <inverse-flattening-ratio> }

  | TOLERANCE { <tolerance-distance> | DEFAULT }

  | SNAP TO GRID { grid-size | DEFAULT }

  | AXIS ORDER axis-order

  | POLYGON FORMAT polygon-format

  | STORAGE FORMAT storage-format

 

grid-size - (back to srs-attribute)

DOUBLE : usually between 0 and 1

 

axis-order - (back to srs-attribute)

{ 'x/y/z/m' | 'long/lat/z/m' | 'lat/long/z/m' }

 

polygon-format - (back to srs-attribute)

  { 'CounterClockWise' | 'Clockwise' | 'EvenOdd' }

 

storage-format - (back to srs-attribute)

{ 'Internal' | 'Original' | 'Mixed' }

Install random NPMs

$
0
0

Hi,

 

I received an error during implementing NPM's squel:

npm ERR! 404 no such package available : squel

npm ERR! 404

npm ERR! 404 'squel' is not in the npm registry.

npm ERR! 404 You should bug the author to publish it (or use the name yourself!)

npm ERR! 404 It was specified as a dependency of 'js'

npm ERR! 404

npm ERR! 404 Note that you can also install from a

npm ERR! 404 tarball, folder, http url, or git url.

 

But this package is official released yet:https://www.npmjs.com/package/squel

 

Even when I try to install it locally on my machine, all seems to be fine:

 

Unbenannt.PNG

 

How to install random NPMs with SPS12 ? I have no access to our linux Server - just to the WebIDE.

Thank you in advance!

How can I install HANA XSA Job Scheduler?

$
0
0

I have installed HANA SPS12 in my server and after following the tiny tutorial I've got the application fully working.

 

Now I'm trying to make work in my server the "SAP HANA Interactive Education (SHINE) SPS 12 for SAP HANA XS Advanced Model" by following the document at:

http://help.sap.com/hana/SAP_HANA_Interactive_Education_SHINE_for_SAP_HANA_XS_Advanced_Model_en.pdf

 

I have been able to download and install the "XS Advanced Monitoring Component".

 

But while checking the Job Scheduler Service with "xs marketplace" command seems like the job scheduler is not running:

 

ndbadm@xxxxx:/usr/sap/NDB/HDB00> xs marketplace

 

Getting services from marketplace...

 

service         plans                                       description

--------------------------------------------------------------------------------

fs-storage   free                                        xs file service provides an                                                   

                                                                 env variable which denotes

                                                                 the root of the clients

                                                                 application file system.

hana           hdi-shared,
                   sbss, schema, securestore   SAP HANA database

xsuaa        default, devuser, space           XS UAA Service Broker for

                                                                 authentication &

                                                                 authorization services

 

 

ndbadm@xxxxx:/usr/sap/NDB/HDB00>

 

 

Then the documentation says we need to contact the system administrator to install the job scheduler:

If it not installed, tcontact your system administrator to install the job scheduler service in the SAP space.

 

But I'm the system administrator and I cannot find out how to install the job scheduler. Could you please give me some hints how to proceed?

 

I have find out information about the job scheduler but not how to install it:

Scheduling Jobs in XS Advanced - Introduction to Application Development and Deployment (XS Advanced Model) - SAP Librar…

 

 

Thanks,

Trinidad.

Number of Rows difference between CRM query and HANA view

$
0
0

Hi,

 

One of the user running WebI report created on Universe which is on HANA CV and during one of the testing process , we found out that number of rows between CRM query(SQL Query) (Which is source) is less when compared with HANA view.

 

I did checked the Staged table in HANA and it is also giving me matching results when compared with the source but not Analytical view or Calc view.

 

Just a filer was applied at ETL side on table but nothing at view side.

 

Little confused and lost why the result set has the discrepancy.

 

Any thoughts or advices are appreciated.

 

Thanks,

Jothi

Problem in calling stored procedure in multiple triggers in HANA

$
0
0

Hi,

 

I have a requirement  to call a stored procedure PROCEDURE1 in 10 triggers written on 10 different tables in HANA.

After creating 3 triggers, system is giving me error : " SAP DBTech JDBC: [648]: nesting depth of trigger and procedure is exceeded: maximum nesting depth 64 " .

Anybody has faced same situation before? Please help.

 

 

Thanks,

Shriniwas

Viewing all 6412 articles
Browse latest View live


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