Wednesday 22 February 2017

HANA XS: Write Server Side Java Script

How to Write Java Script Libraries?
  1. Click here to learn more about libraries.
  2. Open SAP HANA Development Perspective -->Project Explorer tab.
  3. Server Side Java Script libraries have an extension .xsjslib.
  4. To create a new file, select
    New-->Other-->SAP HANA-->Application Development-->XS JavaScript Library File.

  5. Select the parent folder and Name of file (eg. Custom_library.xsjslib).
    Note: Please create this file in other package apart from your project's package to test it out the $import function.

  6. Enter the following content in custom_library.xsjslib file.

  7. Import this library into your javascript file (hello.xsjs).
    Use $.import to reference library file to .xsjs file

  8. Activate it and Run that application as Run AS --> XS Service.




No comments:

Post a Comment