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

Creating Table 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 transform a procedure to a table function.
Rich Heilman R Rich Heilman November 1, 2022
Created by February 11, 2021
Contributors

Prerequisites

Prerequisites

Steps

Intro

There are application and scenarios where you need a table function instead of procedure to leverage the advantage of direct selects on the output, for example, filtering, sorting and grouping. In the following exercise, we show you how you can easily transform a procedure to a table function.


Step 1 Create new function
โ€”

  1. Use what you have learned and return to the functions folder and create a new function called get_po_counts using the SAP HANA: Create Database Artifact command.

    New Function
    New Function

Step 2 Enter table function code
+
Step 3 Save, deploy, 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 3
1. Create new function 2. Enter table function code 3. Save, deploy, check results

Learn more →