Global 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.
In SE11 we can see like this.
Here below we have an amdp method that calls 3 different amdp procedures to set, get and clear temp table data.
Test program that calls amdp method.
We have some data and now we can INSERT into the global temp table line normal DB table.
Here we just using select on the global temp table we can get the data.
The record details.
Deleting the data from global temp table.
After delete, no more data we exists in the global temp table.