Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
VolkerSaggau
Product and Topic Expert
Product and Topic Expert

So here is a simple sample with some structural changes and the swap between HDBTABLE and HDBMIGRATIONTABLE. Lets start with a very simple definition:

VolkerSaggau_0-1707399895420.png

Now we add some data into the generated tables:

VolkerSaggau_1-1707400034411.png

Now we found out that the structure needs to be changed:

Instead of a Person_Name we need a Person_LastName  and of course we now need additional a Person_FirstName. Now if we rename Person_Name the first name  has be set into a different column and the old column has to be flashed. One could have done the renaming better but now you see for your cases new possibilities.

We will do this changes with HDBTABLEMIGRATION:

Step 1.) copy the original object, renamed it by adding ".TXT" and modified the extension of the copy to "HDBMIGRATIONTABLE":

VolkerSaggau_3-1707400614037.png

Step 2.) Fill in the migrationstep and the new desired table structure in the copy

VolkerSaggau_2-1707400381644.png

By this we change the OWNERSHIP of the design time object as well.

Step 3.) Deploy the project in BAS on the highest level. This will ensure "Auto undeploy" behavior.

Otherwise you have to maintain the undeploy.json file in your project.

VolkerSaggau_4-1707401056018.png

What you see now in the deployment log:

The runtime object "PERSON" now has new OWNER.

VolkerSaggau_0-1707396803524.png

And we got the migration right.

VolkerSaggau_0-1707402903080.png

As a last step we have to get back to the HDBTABLE format.

So a copy of the migrationtable file, rename and cleanup leads to:

Note that you can "neutralize" HDI-Artifacts with rename "*.txt".

VolkerSaggau_0-1707403400255.png

Now a new deployment that will change the ownership again:

now the new Person_aftermigration.hdbtable is the owner of the run time artifacts.

VolkerSaggau_0-1707404124733.png

Summary:

Complex changes on a HDBTABLE can be done with an intermediate HDBMIRATIONTABLE.