28.01.2013 Views

SAP HANA Developer Guide - Get a Free Blog

SAP HANA Developer Guide - Get a Free Blog

SAP HANA Developer Guide - Get a Free Blog

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

1. After you have created your workspace and your project, go to the Project Explorer view in the <strong>SAP</strong> <strong>HANA</strong><br />

Development perspective , right-click on the file name, select New, and select File. The New File wizard will<br />

appear.<br />

2. Enter or select the parent folder and enter the file name using the following naming convention<br />

.procedure. Choose Finish. The icon shows that your procedure is created locally. Choose Save.<br />

Your procedure will open containing the default Create Procedure template. In the Properties view, you will<br />

see the properties of your procedure, such as Access Mode, Name and Language. You can also change the<br />

default schema that this procedure is using.<br />

Note: You can also create a folder first and add a file. Right-click on the project name, select New, and<br />

select Folder. The New Folder wizard will appear. Enter or select the project, enter the folder name,<br />

and choose Finish.<br />

3. To share your project, right-click on the project name, select Team, and select Share Project. The Share<br />

Project wizard will appear. Choose Finish. The icon shows that your procedure is not committed and not<br />

activated.<br />

4. You can begin writing your code inside your new procedure and save it locally. The syntax is checked<br />

simultaneously and is highlighted. Auto-completion of the syntax appears as you type; press Ctrl + Spacebar<br />

to get a list of relevant SQLScript statements.<br />

Note: You can only write one stored procedure per file. The file name and the procedure name must<br />

be the same.<br />

5. To commit your new procedure or make changes to an existing one, first save it, right-click on the procedure,<br />

select Team, and select Commit. Your procedure is now synchronized to the repository as a design-time<br />

object and the icon shows that your procedure is committed .<br />

Caution: The design-time presentation of the procedure is currently in XML format that you must not<br />

edit.<br />

6. When you have finished writing your procedure and you are ready to activate it, right-click on the procedure,<br />

select Team, and select Activate. Your procedure is created in the catalog as a runtime object and the icon<br />

shows that your procedure is activated . This will allow you and other users to call the procedure and debug it.<br />

If an error is detected during activation, an error message will appear in the Problems view.<br />

Related Links<br />

Note: You can also activate your procedure at the project and folder level.<br />

<strong>SAP</strong> <strong>HANA</strong> Development Perspective [page 25]<br />

<strong>SAP</strong> <strong>HANA</strong> Repository Packages and Namespaces [page 43]<br />

In <strong>SAP</strong> <strong>HANA</strong>, a package typically consists of a collection of repository objects, which can be transported<br />

between systems. Multiple packages can be combined in a delivery unit (DU).<br />

About <strong>SAP</strong> <strong>HANA</strong> SQLScript<br />

<strong>SAP</strong> <strong>HANA</strong> SQL Reference<br />

<strong>SAP</strong> <strong>HANA</strong> System Tables and Monitoring Views Reference<br />

160<br />

P U B L I C<br />

© 2012 <strong>SAP</strong> AG. All rights reserved.<br />

<strong>SAP</strong> <strong>HANA</strong> <strong>Developer</strong> <strong>Guide</strong><br />

Developing Procedures

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!