Abap

How to create database tables in SAP HANA Cloud

If you have created a table in SAP using transaction SE11, then you already know 90% of how to create database tables in SAP HANA Cloud (SHC).

In order to create the table in SHC, you need to use ABAP Environment (which can be accessed from ADT). If you do not have access to BTP or ABAP Environment, you can still practice creating database tables using ADT in any on premise system.

Step 1: From the ADT, select the open the folder Dictionary > Database Tables. Select Database tables and right click to create “New Database tables”.

Create database table

Step 2: Fill in the name and description. Select package and transport – if prompted. Click finish.

Step 3: Declare key fields. Example given.

@EndUserText.label : 'Test table in ADT'
@AbapCatalog.enhancementCategory : #NOT_EXTENSIBLE
@AbapCatalog.tableCategory : #TRANSPARENT
@AbapCatalog.deliveryClass : #A
@AbapCatalog.dataMaintenance : #ALLOWED
define table z000_test_table1 {
  key mandt : mandt not null;
  key matnr : matnr not null;
  key werks : werks_d not null;
  last_idoc : edi_docnum;
  @Semantics.quantity.unitOfMeasure : 'z000_test_table1.meins'
  quantity  : menge_d;
  meins     : meins;
  @Semantics.amount.currencyCode : 'z000_test_table1.waers'
  netpr     : netpr;
  waers     : waers;

}

Although it looks very different from SE11, if you look closely you will find all the elements familiar.

Step 4: Maintain the technical setting. There is a folder for this in the new database table created.

Technical setting for the table

Activate the changes.

Just like the class in ADT, database tables are created with the text-based flat interface and though in the beginning, it may seem difficult – I find the text based interface easier to work with than the guided navigation of SAP GUI.

Bonus tip: If you are not sure how to write the annotations, create a dummy table in On premise system in SE11 (or any existing table) and open it in ADT. It will open in text bases interface and you will know everything that you need to know. If you like our content – follow us on Linkedin.

error

Enjoy this blog? Please spread the word :)

Follow by Email
Twitter
LinkedIn
LinkedIn
Share