Tuesday 26 January 2016

SAP Development Guide



SAP- HANA

Introduction

SAP

It is basically a German software company whose products allow businesses to track customer and business interactions. It is well known for ERP (Enterprise Resource Planning) and data management programs.SAP means Systems, Applications and Products.

Disks I/O has been a performance bottleneck since the beginning of three tier architecture which led to SAP emerging and developing in-memory technologies to accelerate its applications.

SAP-HANA

It is an in-memory data platform that is deployable as an on-premise appliance, or in the cloud. A revolutionary platform that’s best suited for performing real-time analytics, and deploying real-time applications.

 


Filling this information will allow you log in to the AWS

 


 Configuring your eclipse for SAP HANA installation

1)      Download the Luna Eclipse IDE from  : http://eclipse.org/downloads
2)      Unzip your eclipse
3)      On the help menu, Go to Help Install new Software then add: https://tools.hana.ondemand.com/luna
4)      Select all the  tools, done.
6)      SAP Hana Studio Developer Edition  (similar to eclipse installation,you don’t have to do this if you have installed it as a plug-in in eclipse)  can be downloaded from :


 

After the eclipse have been installed, Open the SAP HANA perspective. Through: Windows > Open Perspective > Other, then choose the SAP HANA Development Perspective.
Now you should connect with the SAP HANA Trial Instance in the cloud.
Select the systems tab which is part of the SAP HANA Development Perspective.

Ensure you have a SAP Hana Instance on the cloud,which you can create via the developer zone as shown below:

 

 


Click on the button New Trial Instance which gives you a form to fill with the details




 




 


  


 


It should give you the following screen after save:


 


You should have this perspective after  eclipse has finished installing the SAP HANA:



 

Fill in:
Go to Start of the navigation path Window Next navigation step Open Perspective Next navigation step Other End of the navigation path.
Select SAP HANA Administration Console and choose OK.
From the Systems context menu, choose Add Cloud System.
The Account Information window displays the default landscape host. Modify it manually entering your productive or trial landscape. For more information about landscapes, see Landscape Hosts.
Enter your account name, e-mail or SCN user name, and SCN password.

https://account.hanatrial.ondemand.com/cockpit
Account name:         ****************
Username:         *****************
Password:    *****************

 

Choose Next.
In the SAP HANA Schemas and Databases window, choose radio button Databases.
From the dropdown menu, select the database you want to work with.
Enter your database user and password. For more information, see Creating a Database Administrator User.
Choose Finish.
You are now connected to a dedicated SAP HANA database.



When finished it will give you the Repository, and ready to work with SAP HANA



 


Creating a repository
To start development on SAP HANA you need to create a Repository
Open the Repositories tab of the SAP HANA Development Perspective
Choose the Create Repository Workspace button:







The new Repository is now ready and will be shown in the Repositories Tab:
Congratulations: With this you are now ready to start your first SAP HANA project with Eclipse.



If objects (tables/views) of a schema (say SCHEMA_ABC) are used to build modeling views then it’s necessary to grant _SYS_REPO the SELECT WITH GRANT privilege on this schema.

The following SQL statement must be executed before activating any such modeling views.
GRANT SELECT ON SCHEMA SCHEMA_ABC TO _SYS_REPO WITH GRANT OPTION


If you miss this step, an error will occur when you activate your views later.

Explanation: The activation of modeling views are done in the name of user _SYS_REPO.
Think of _SYS_REPO as "the activation guy". It takes your models and creates the necessary runtime objects from them. Therefore user _SYS_REPO needs the allowance to select YOUR tables/views. (If _SYS_REPO user cannot select on the tables specified in the from-clause of the view-definition, it cannot define that view)
Exposing Services through Odata
Create a file named as model_access.hdbrole.
In that file type the below contents:
role p1941724669trial.mugambinstance.SAP_Exercise::model_access {
              catalog schema "NEO_1V39L2WI3XXZTKGTIZGFNYKLF": SELECT, UPDATE, INSERT, DELETE;
    }

Create a file named as businessPartners.xsodata.In that file the contents are as below:
service namespace "sapfirst.services" {
 "NEO_1V39L2WI3XXZTKGTIZGFNYKLF"."DCLS" as "BusinessPartners" ; 
}

Call this on your sap- hana console:
call "HCP"."HCP_GRANT_SELECT_ON_ACTIVATED_OBJECTS"
You can now access your service on the cockpit using the url as :
this will display the metadata
While the data in entity as:
NB:
If the table has no data I use a quick insert into the hana console using the query:
INSERT INTO "NEO_1V39L2WI3XXZTKGTIZGFNYKLF"."DCLS" (DCLS_CD,DCLS_ACTIVE,DCLS_DSC_LG1,DCLS_DSC_LG2,DCLS_SNM_LG1,DCLS_SNM_LG2,AUD_DT,AUD_ID)
 VALUES(100001,1,20121225,'USD',12367,'Martin','2015-12-03',1001);


INSERT INTO "NEO_1V39L2WI3XXZTKGTIZGFNYKLF"."LSO" (LSO_ID,TBL_NAME,LSO_GEN_KEY1,LSO_GEN_KEY2,LSO_GEN_KEY3,LSO_GEN_KEY4,TEXT_FLD,AUD_DT,AUD_ID)
 VALUES(100001,'LSO','XDRETY1','XDRETY1','XDRETY1','XDRETY1','Text Field','2015-12-03',1001);

Enjoy and be free to share your opinions.

References:
https://help.hana.ondemand.com/help/frameset.htm?4efc124a0ccc42b3b502ad3a3908d23d.html

No comments:

Post a Comment