SAP Home Learn Build Integrate Model Operate Extend with AI ConnectTutorial navigator Knowledge Graph API Devtoberfest Developer Advocates App Space

Manage my Account SAP Devs YouTube ↗ Learnings ↗ Community ↗ Provide Feedback ↗
Logout
โคข Open full site

Create Scalar User Defined Functions

Leverage SQLScript in stored procedures, user defined functions, and user defined libraries.

Overview

🎓 intermediate 15 min. SAP HANAIntermediateSqlSAP HANA CloudSAP Business Application Studio

You will learn

  • โœ”How to create a scalar UDF for generating a full name from the last, first and middle name of the employee
Rich Heilman R Rich Heilman November 1, 2022
Created by February 11, 2021
Contributors

Prerequisites

Prerequisites

Steps

Step 1 Create new function
โ€”

  1. Right click on the src folder and choose New Folder.

    New Folder
    New Folder

  2. Enter the name of the folder as functions and click OK.

    Create Folder
    Create Folder

  3. Click View then Find Command...

    Find Command
    Find Command

  4. Enter hana as the search term, then click on SAP HANA: Create SAP HANA Database Artifact

    HANA Archifact
    HANA Archifact

  5. Click the Browse icon.

    Browse
    Browse

  6. Select the functions folder that you created earlier, then click Open.

    Select Function
    Select Function

  7. Use the dropdown, and select Function as the Artifact Type. Give the name of the artifact as get_full_name, then click Create.

    Artifact Type
    Artifact Type

  8. You will see a message saying that the new artifact as been created. From the functions folder, click on your new function. The SQLScript function editor will then be opened with the shell of your function code.

    Editor
    Editor

Step 2 Edit the function and save
+
Step 3 Edit the procedure and save
+
Step 4 Deploy and check results
+

Resources

Discussion

Share feedback on this tutorial or join the conversation in SAP Community.

Submit detailed feedback Discuss in Community
Steps
Step 1 of 4
1. Create new function 2. Edit the function and save 3. Edit the procedure and save 4. Deploy and check results

Learn more →