HANA SQL- Global Temporary Table

light111Global Temporary Table in HANA SQL


In HANA there are two types of temporary tables. Local and Global Temporary Table.

A global temporary table stays in the database. Insert, update and delete operation can be performed on the global temporary table.


In one of the custom program we are using the standard interface and we need to pass a different input data set to this interface and process inside the BAdI that is called from the standard interface. So as we can’t pass this data set to by the standard interface input parameters, we created a global temp table and before calling the standard interface we set/insert the data in the global temp table and inside the BAdI implementation of the standard interface we retrieve the data from the global temporary table and process this data and finally delete the records from the global temp table. 

The below post just shows the steps how we can create such table and its set/get/delete operation like a normal transparent table.

Create a global temp table- table category and delivery class.

1

In SE11 we can see like this.

23

Here below we have an amdp method that calls 3 different amdp procedures to set, get and clear temp table data.

456

Test program that calls amdp method.

7

We have some data and now we can INSERT into the global temp table line normal DB table. 

8

Here we just using select on the global temp table we can get the data.

9

The record details.

10

Deleting the data from global temp table.

11

After delete, no more data we exists in the global temp table.

12


 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s