HANA Studio, SAP HANA Cloud, HDI & Git-Based Development – Day 4 Hands-On Guide | Part 49 | FreeLearning365

 

HANA Studio, SAP HANA Cloud, HDI & Git-Based Development – Day 4 Hands-On Guide | Part 49 | FreeLearning365


🔥 DAY04 [SAP HANA Database & Performance] {Part-49}

Welcome to the day you transform from a lone-wolf HANA developer into a DevOps-savvy data engineer. Over the last three days, you built deep technical knowledge of HANA’s architecture, SQLScript, and data modeling. But no model matters if you can’t move it safely from your personal workspace to a production system while collaborating with a team. That’s exactly what we’ll master today: the tools, connections, and lifecycle that power modern HANA development.

We’ll walk through the classic HANA Studio, move into the cloud era with SAP HANA Cloud and BTP, learn how to keep systems healthy with the HANA Cockpit, and then dive headfirst into the game‑changer: HDI containers and Git‑based development. You’ll finish with a hands‑on lab that sets up a real project pipeline – something you can show in your next job interview.


🖥️ HANA Studio (Eclipse‑Based) – The Old Faithful That Still Delivers

SAP HANA Studio is the Eclipse‑based administration and development client that shipped with HANA for years. While SAP now pushes Business Application Studio for new development, Studio remains deeply embedded in many organizations for quick DBA tasks, backup management, and running ad‑hoc queries. Knowing it is non‑negotiable when you step into an existing S/4HANA landscape.

🧰 System Overview & Navigating Studio

After installing Studio (which requires a matching Java runtime), you create a connection to your HANA tenant. The left panel shows a “Systems” view listing all connected HANA instances. Each system expands into a tree: Catalog (schemas, tables, views, procedures), Content (design‑time models), Security, and Administration. Right‑click any table to see data, generate SQL, or check runtime information.

-- Example: Quick table overview via SQL Console SELECT * FROM M_CS_TABLES WHERE TABLE_NAME = 'ACDOCA';

📝 The SQL Console – Your First Line of Defense

The SQL Console is where you spend 50% of your time. It’s a simple SQL editor with syntax highlighting, execution plans (PlanViz), and the ability to run SQLScript procedures. Use it to prototype queries before embedding them in models. Learn these shortcuts:

  • F8 (Execute): Runs the statement or selected block.
  • Ctrl+Shift+X: Opens Plan Explanation for the current query.
  • Result tab: Export results to CSV/Excel for quick analysis.

💾 Backup & Recovery Management from Studio

Studio provides a graphical interface to schedule and monitor backups. Navigate to the system → “Backup and Recovery” → “Backup Console”. You can configure full data backups, log backups, and point‑in‑time recovery settings. In S/4HANA, the underlying HANA backup is often orchestrated via BR*Tools or a third‑party solution, but knowing the native interface is essential when those tools fail.

🧠 Real‑life tip: Every HANA admin should know how to check backup status via Studio: SELECT * FROM M_BACKUP_CATALOG shows recent backups. A missing backup on a Friday afternoon is a resume‑generating event.

⚠️ Limitations & the Shift to Modern Tools

HANA Studio is Eclipse‑based, which means it can be heavy, and plugin management can be painful. SAP has frozen major new features for Studio. For new projects, you’re strongly encouraged to use SAP Business Application Studio or Microsoft Visual Studio Code with SAP HANA plugins. However, for reading trace files, administering older HANA 1.0 remnants, and doing quick‑and‑dirty DBA work, Studio remains installed on most senior consultants’ machines.


☁️ SAP HANA Cloud – HANA as a Service on BTP

SAP HANA Cloud is the fully managed database‑as‑a‑service offering running on the SAP Business Technology Platform (BTP). It’s the foundation for all new SAP cloud applications, and increasingly, S/4HANA Cloud, private edition, also relies on HANA Cloud. Understanding the differences from on‑premise HANA is critical because the management approach shifts dramatically.

🔹 Key Differences: On‑Premise vs SAP HANA Cloud

  • Infrastructure: No more hardware sizing or OS patching; SAP manages the database server, storage, and backups automatically.
  • Memory & storage scaling: You can scale up/down vCPU and memory via BTP cockpit, and storage scales elastically.
  • Connectivity: You connect via a secure tunnel (Cloud Connector) from on‑premise networks, or directly over the internet with TLS.
  • Tooling: No direct OS access; all administration via BTP cockpit, HANA Cockpit, or HANA Database Explorer in BAS.
  • Release cycle: Automatic quarterly updates, so you always run a recent version. No more SPS upgrade projects.

🧪 Hands‑on: Create a HANA Cloud Instance

  1. Log into SAP BTP Cockpit and navigate to your subaccount.
  2. Go to “Instances and Subscriptions” → Create → Service: “SAP HANA Cloud”.
  3. Choose “SAP HANA Database”, define size (e.g., 30 GB memory), and create.
  4. Once provisioned, open “SAP HANA Database Explorer” from the BTP launchpad – this is your new SQL console in the browser.

🗂️ HDI Comes First in Cloud

In HANA Cloud, the default development pattern is HDI containers. You don’t get a classic schema where you can just create objects manually. Instead, you build design‑time artifacts (CDS, hdbcds, calculation views) and deploy them via HDI. We’ll explore HDI in detail shortly.

✅ Pro tip: Even if you’re still on‑premise, start using HDI containers now. SAP is moving everything toward HDI, and HANA Cloud makes it mandatory. Future‑proof your skills.

📊 SAP HANA Cockpit – The Command Centre for Monitoring & Alerts

The SAP HANA Cockpit is a web‑based administration tool that replaces many functions of HANA Studio. It runs as a separate application (often on its own small HANA instance) and provides dashboards for performance, memory, disk, and alerts across multiple HANA systems. In S/4HANA landscapes, it’s the go‑to place for Basis teams to monitor database health.

🔔 Setting Up Alerts That Save Your Weekend

Cockpit allows you to configure thresholds and email notifications. For example:

  • Memory usage > 85%: raise an alert.
  • Delta merge stuck: send an email to the DBA team.
  • Backup failure: immediate critical alert.

To set an alert, go to the “Alerts” app, choose “Configuration”, add a new threshold on a metric like “Used Physical Memory”. Specify operator (>, <, =) and value, then assign an email recipient. This proactive setup prevents performance surprises.

📈 Real‑Life Diagnostic: Investigating a Slow System

A business user complains that Fiori app “Display Financial Statements” is crawling. You open HANA Cockpit, go to the tenant’s “Performance” card, and look at “Active Statements”. Sort by elapsed time descending. You see a query from that Fiori app taking 45 seconds. Click to see the plan, notice it’s ignoring an index. You now know exactly which calculation view to tune. This is data‑driven troubleshooting.


🛠️ SAP Web IDE / Business Application Studio for HANA Development

SAP Web IDE was the original browser‑based IDE for HANA native development, but it has been superseded by SAP Business Application Studio (BAS). BAS is a cloud‑based, modular development environment built on Eclipse Theia, similar to Visual Studio Code. It’s the official tool for building HANA native applications, calculation views, and multi‑target applications (MTA).

🔹 Why BAS over Web IDE?

  • Modern UI: VSCode‑like experience, extensions marketplace.
  • HDI integration: Deeply integrated with HDI container management and build tasks.
  • Git built‑in: Source control is first‑class citizen, not an afterthought.
  • Productive: Wizards for creating CDS entities, calculation views, and consuming them in CAP applications.

🧪 Quick Setup: Launch SAP Business Application Studio

  1. From BTP Cockpit, navigate to “Instances and Subscriptions” and subscribe to “SAP Business Application Studio”.
  2. Create a dev space of type “SAP HANA Native Application”.
  3. Wait a few minutes while BAS provisions your personal environment.
  4. Open the dev space and start coding.

Inside BAS, you can create a new project from a template: choose “SAP HANA Database Project”. This sets up the folder structure for HDI, complete with a src/ folder for your design‑time artifacts.

-- Example: directory structure of a HDI project in BAS /my-hana-project ├── db/ │ ├── src/ │ │ ├── data/ │ │ ├── hdbcds/ │ │ ├── hdbcalculationviews/ │ │ └── .hdiconfig │ └── package.json └── mta.yaml

📦 HDI (HANA Deployment Infrastructure) Containers – Dev/QA/Prod Isolation Done Right

In the old days, developers shared a single schema in a HANA development system. You’d create a procedure, and a colleague would drop it accidentally. HDI containers change the game by giving each module or developer an isolated, self‑contained container that holds all objects. The container is the unit of deployment, and it’s managed by a build‑on‑deploy mechanism.

🧱 What is an HDI Container?

An HDI container is a runtime collection of database objects (tables, views, procedures, calculation views) that belongs to a specific application or project. It has its own internal schema and a special HDI user that owns the objects. Developers never directly create objects with SQL; they define them as design‑time files (CDS, hdbview, hdbprocedure) and the HDI build process generates the runtime objects in the container.

🔄 Lifecycle: Design‑Time → Build → Runtime

  1. Design-time: Files like .hdbcds, .hdbcalculationview, .hdbprocedure are created in your project’s src/ folder.
  2. Build: You run “Build” (from BAS or command line). The HDI deployer reads the files, validates them, and creates or updates the corresponding runtime objects inside the target container.
  3. Runtime: The container now holds the executed objects. Applications connect using the container’s service user (with limited privileges) to access the data.

🛡️ Isolation & Promotion

You can have separate HDI containers for DEV, QA, and PROD. A typical flow: build the project in a DEV container, test, then commit the code to Git. A CI pipeline picks the commit, builds it into the QA container, runs automated tests, and then deploys to the PROD container. The same design‑time artifacts are consistently built, eliminating “works in dev, fails in prod” nightmares.

-- Example: HDI container configuration (mta.yaml snippet) modules: - name: my-app-db type: hdb path: db requires: - name: hdi_my-app group: SERVICE_REPLACEMENTS resources: - name: hdi_my-app type: com.sap.xs.hdi-container

⚡ Real‑Life Scenario: Parallel Development without Conflicts

A team of three developers each works on a different feature (sales, inventory, procurement). Each has their own HDI container in a shared DEV space. They build and test independently, merge their design‑time files into Git, and resolve conflicts at the file level. The nightly build deploys everything into an integration container. No more “who dropped my table?”. This is modern database DevOps.


🔀 Git‑Based HANA Development – The Power of Version Control

Treating database artifacts as code – stored in Git – is the single most important shift in HANA development. Calculation views, CDS definitions, procedures: all become versioned, reviewable, and auditable. You can branch, merge, and tag just like application code.

📁 What to Store in Git

  • All HDI design‑time files (.hdbcds, .hdbcalculationview, .hdbprocedure, .hdbsequence, etc.)
  • CDS artifacts (both HANA CDS and ABAP CDS if stored in the HANA project).
  • Data load scripts (.csv, .hdbtabledata) and configuration (.hdiconfig).
  • The mta.yaml or package.json defining the module.

🌿 Branching Strategy for HANA Projects

A common approach:

  • main – production‑ready code.
  • develop – integration branch where features are merged.
  • feature/sales-report – isolated development branch.

When a feature is ready, a pull request is created, reviewed, and merged to develop. The CI pipeline then builds the develop container. For a release, merge develop to main and tag v1.2.0. The same tag can be deployed to production.

🧪 Hands‑on Lab: Push a Calculation View to Git and Deploy via CI (Simulated)

For this exercise, you’ll need a GitHub/GitLab account and a trial HANA Cloud instance with BAS.

  1. In BAS, initialize a Git repository in your project: git init, then commit all design‑time files.
  2. Create a remote repository on GitHub and push.
  3. In the root of your project, add a .github/workflows/deploy.yml (if using GitHub Actions) that uses the SAP HANA deployer to build the container on push to develop.
  4. Modify a calculation view, commit, and push. Watch the CI job run and deploy the updated view to the QA HDI container.

This mirrors what top SAP consulting firms deliver to clients. It’s portable, repeatable, and eliminates manual SQL deployments forever.


⚖️ Pros, Cons & Best Practices of the Modern HANA Toolchain

✅ Pros

  • Isolation: HDI containers prevent cross‑team interference.
  • Reproducibility: Same design‑time files, same build result, every time.
  • Collaboration: Git enables parallel development, code review, and audit trail.
  • Agility: Deploy from laptop to cloud in minutes.
  • Monitoring: Cockpit gives a single pane of glass for all HANA systems.

⚠️ Cons

  • Learning curve: Traditional DBA skills won’t cut it; must learn Git, CI/CD, and HDI concepts.
  • Tooling fragmentation: Studio still used for quick fixes, BAS for new dev, Cockpit for monitoring – context switching overhead.
  • Limited direct SQL execution: In HDI containers, direct DDL via SQL console is not recommended; must go through design‑time, which can be frustrating for prototyping.

🔁 Alternatives & Hybrid Approaches

  • SAP HANA XS Advanced (XSA): The on‑premise equivalent of HANA Cloud with HDI. Same concepts, but you manage the runtime yourself.
  • Manual schema with Transport Management System (TMS): Still used in many S/4HANA landscapes for ABAP-managed CDS views, but for native HANA, HDI is the way.
🔥 Pro tip: Even in S/4HANA, you can create separate HDI containers for custom native HANA development alongside the ABAP schema. Use the HDI container for your SQLScript procedures and calculation views, then access them from ABAP via a database procedure proxy. This decouples your development lifecycle from the ABAP transport system.

📌 What You’ve Built Today – The Developer’s Environment

You’ve moved beyond writing a single SQL file and learned to manage HANA projects with professional tools. HANA Studio, HANA Cloud, Cockpit, BAS, and HDI form the backbone of daily work for a HANA developer or data engineer. Tomorrow, we’ll shift to performance tuning: PlanViz, expensive statement trace, and partitioning – applying everything you’ve built so far to make your models fly.

🚀 Action Item: Spin up an SAP HANA Cloud trial instance, create a BAS dev space, and build a simple HDI project with one calculation view. Commit it to a Git repository and try a manual build. Experience the power of DevOps-driven database development.

Post a Comment

0 Comments