Recently, my colleague Thomas Jung introduced the new capabilities in SAP HANA 1.0 SP5, specifically the new SAP HANA Extended Application Services(XS) and the HANA Development perspective within SAP HANA Studio. Not only can you create XS artifacts like XSODATA and XSJS services, but you can also create SQLScript procedures using this new approach as well. Before SP5, procedures were created in the modeler view, very similar to the way you would create attribute, analytical, and calculation views. Using this new approach in SP5, you can now take advantage of the new SQLScript editor and debugger.
Like other XS artifacts, procedures can be created locally using eclipse based XS projects in the project explorer view. These projects are then stored in the HANA repository as well as all of the associated resources. For more information about the project based development, see the “SAP HANA Studio Becomes a Development Workbench” section of Thomas’ blog. In this post, I would like to introduce the new approach to creating procedures using the new SQLScript editor. In future posts, I will cover some of the more specific features of the new editor as well as the debugger.
To create a new procedure, simply right click in your XS project, and choose “New”, then “File”. Enter the file name as the name of the procedure with a .procedure file extension.
The new editor supports on-the-fly syntax checking, code hints, and some code completion. You may notice that the new editor does not support an input or output pane to define input/output parameters like in previous support packages. Instead, you define the parameters in the CREATE PROCEDURE statement itself. Also, properties can be set directly in the procedure definition. The procedure code is written between the BEGIN and END statements.
Once the coding is complete and free of syntax errors, the artifact must be committed to the database. This is done by right-clicking on the procedure and choosing “Team”, then “Commit”. After the commit is complete, the procedure must be activated by choosing “Team”, then “Activate”. The activation process will create the runtime object in the _SYS_BIC schema just as it did in prior support packages. The orange cylinder on the icon means that the activation has been completed successfully.
There are currently a few restrictions in regard to the new SQLScript editor and debugger which we are working to resolve in a future revision. Please see SAP Note 1779803 for more information about these restrictions. Refer to the new HANA Developer Guide for more information about how to create all of the new XS artifacts. Watch for more posts covering more features of the new SQLScript editor and debugger on SCN as well as on saphana.com. Lastly, look for new videos coming soon to SAP HANA Academy page showing how to use the new development tools delivered with SAP HANA 1.0 SP5.