SAP Router tips and tricks

This blog will give tips and tricks on SAP Router.

SAP router versions and maintenance can be found in this OSS note: 1897597 – SAProuter: Release rollout.

OSS note 1895350 – Secure configuration of SAProuter covers the security aspects of SAP router. To store encrypted passwords in SAP Router, follow the instructions of OSS note 2046942 – Support encrypted passwords in saprouttab.

SAP router documentation is listed in OSS note 30289 – SAProuter documentation. Public documentation of SAProuter. Help link on help.sap.com on SAP router.

For trouble shooting network issues, follow the instructions in OSS note 1227116 – Creating network traces.

In case you need reverse invoke of the SAP router follow the instructions from this help.sap.com link.

Support backbone configuration

The support backbone configuration is explained in OSS note 2827658 – Automated Configuration of new Support Backbone Communication – Update 02. STC01 task list SAP_BASIS_CONFIG_OSS_COMM can be used to speed up the setup:

OSS notes:

Performance monitoring for http(s) and ODATA

You can setup detailed performance monitoring for HTTPs and ODATA calls to show this information in ST03 workload monitoring.

Setup

Run program SWNC_CONFIG_URL and change the settings:

Background OSS note: 2093522 – ST03 Profiles do not show full information (compressed data). This note also warns that for very large volume there might be issues with the data collection. Solution for that issue is explained in OSS note 2059569 – Runtime error EXPORT_TOO_MUCH_DATA when saving statistic data aggregates.

With report SWNC_CONFIG_PATH you can reduce the path in the recording. See also OSS notes 2285159 – ST03n: Normalization of background job names and URLs in VC/WM profiles and 3070839 – MON-TUN: Extension of length and starting Position for the Normalization of URLs. By doing this, you get more aggregation and also less issues: 3297874 – How to improve the performance of transaction ST03/ST03N on systems with high http(s) workload.

Result in ST03

In ST03 you can now see the results in the part for transaction profile standard overview:

Good background SAP blog: reference.

HANA Cleaner Monitoring Setup in FRUN

Introduction

Maintaining SAP HANA systems requires regular housekeeping activities, and one of the critical components is the HANA Cleaner. Monitoring its activity ensures that log cleanup and housekeeping jobs are running as expected.

In this blog, it is explained how we implemented HANA Cleaner monitoring in SAP Focused Run (FRUN) using custom metrics via template maintenance, without requiring custom scripts. This approach leverages standard FRUN capabilities and provides a scalable and maintainable monitoring solution.

Solution Overview

The objective of this monitoring setup is:

  • Track the execution of HANA Cleaner jobs
  • Detect inactivity or failure scenarios
  • Alert operations teams proactively

We achieved this using:

  • Custom Metric based on File Monitoring
  • FRUN Template Maintenance
  • Diagnostic Agent (push) data collection

How It Works

The monitoring logic is simple but effective:

  1. The system monitors the last modified timestamp of HANA Cleaner log files
  2. A custom metric evaluates this timestamp continuously
  3. If no update is detected beyond a defined threshold (e.g., 2 days), an alert is triggered

This ensures immediate visibility into any issues with the HANA Cleaner process.

Implementation Details

Step 1: Create Custom Metric in FRUN

Navigate to:

Advanced System Management → System Monitoring → Template Maintenance

Create or enhance a metric such as:

HANA Cleaner Run Status

Category:

Exceptions

Step 2: Configure Data Collection

From the screenshot setup, the following configuration is used:

Data Collector Type

Diagnostic Agent (push)

Data Collector Name

File Information

Collection Interval

5 Minutes

Step 3: Maintain Collector Input Parameters

Here are the key parameters used:

Parameter IDDescription
DATEPATTERNDate format used (yyyy-MM-dd)
FILEPATTERNHANA Cleaner log file pattern
FOLDERPath to log directory
KEY_FIGMetric to evaluate
RECURSIVEEnable/disable recursive search

Actual Values Used

Plain Text

DATEPATTERN = yyyy-MM-dd

FILEPATTERN = hanacleanerlog_*

FOLDER = /usr/sap/${SAP_HDBSystemID}/${SAPSystemName}/hanacleaner/output

KEY_FIG = Last Modified age in seconds

RECURSIVE = False
Show more lines

✅ This configuration ensures the system monitors the latest file modification time in the HANA Cleaner output directory.

Step 4: Define Metric Logic

The key figure:

Last Modified Age in Seconds

This indicates how long it has been since the log file was updated.

Step 5: Threshold Configuration

Define thresholds based on your operational requirements.

Example:

ConditionThreshold
Green< 24 hours
Yellow24–48 hours
Red> 48 hours

This ensures alerts are triggered if HANA Cleaner hasn’t executed in expected time.

Step 6: Assign Metric to Template

Assign the custom metric to:

  • Relevant HANA systems
  • Both Production and Non-Production landscapes

This ensures full coverage across your environment.

Monitoring Output

Once configured, FRUN displays:

  • Historical trend of HANA Cleaner activity
  • Status indicators (Green/Yellow/Red)
  • Alerts in case of inactivity

From your reference screenshot:

  • The metric appears under Exceptions
  • A graph shows activity progression
  • Alerts are triggered if thresholds are breached
  • System Monitoring
  • (Optional) Root Cause Analysis

Coverage

This setup can be implemented:

  • Across the entire HANA landscape
  • For all S/4HANA or standalone HANA systems
  • In both:
    • Production
    • Non-Production environments

Advantages of This Approach

No Custom Coding Required
Uses standard FRUN capabilities
Can be applied across multiple systems via templates
Frequent monitoring (every 5 minutes)
Detects failures before business impact
Simple file-based monitoring logic

Key Learnings & Best Practices

  • Always ensure correct file path and pattern
  • Validate that Diagnostic Agent has access to directory
  • Fine-tune thresholds based on:
    • HANA Cleaner job frequency
    • Business requirements
  • Use template-based rollout for consistency

Conclusion

Monitoring housekeeping activities like HANA Cleaner is critical for maintaining system health. By leveraging FRUN custom metrics and file monitoring, we can implement an efficient, scalable, and proactive monitoring solution.

This approach eliminates the need for custom scripts while fully utilizing standard SAP monitoring capabilities.

Funny ABAP code blocks

Just for fun: funny ABAP code block comments….

When we cannot call our own function modules properly, we do deserve a short dump (program LSZA0F34):

Spaceship BERID, MRP area, has adventures (program LATPCFA6):

Program LSHI0F02 has road construction (Baustelle):

Trigger an error or end up in FI hell (program LWOST_CR_IMG01FNG):

A nice golden rule: do not touch coding if you don’t know what you are doing, and if you do it is night work for you in the office to repair it (program SAPMSSYD):

It will be painful (program RPCMSAG0PBS_FORMS):

Program RSORAF01 show life is sometimes terrible:

Complaints in function module ADDR_GET_NEXT_COMM_TYPE about junior programmers:

Some commented out Scheisse (shit in German) in program RV14B000:

Program RSDBPREV calls out to Helga:

ADT-VS: ABAP development tools for visual studio

SAP ABAP on Eclipse will be replaced with ABAP on visual studio (background is explained in this blog). Developments in the RAP framework and AI Joule will be done in ADT-VS. If you are looking for Eclipse ADT installation, read this blog. Both Eclipse ADT and ADT-VS require the ABAP backend installation of the ADT tools, which is the same for both and described in this blog.

Installation and connection to backend

Frequently asked questions blog refers to the formal help.sap.com page on ADT for visual studio code.

Simple steps:

  1. Install Visual Studio Code on your laptop from this URL Download Visual Studio Code – Free AI Code Editor for Mac, Linux, Windows.
  2. Launch the newly installed tool
  3. Go to the Extension on the left hand side:

Search for the ABAP Development tools and install them:

4. Wait for the installation to finish and restart the Visual Studio

5. To add an ABAP destination, click in the menu View and select Command Pallette, and key here ABAP: New Destination

6. In the popup select on the right hand side the + button:

7. Select RFC to backend or HTTP to cloud system:

If you take RFC, the popup will show entries from your SAP GUI.

8. Enter User ID, password, client (be careful here: default it will give you 000, this is NOT what you want), language and password if SSO is not setup

Using the studio

On the left hand side the connections are visible. Right click on any and select the option Logon to Destination:

Rest is same as ADT. Do realize that not all editors are yet working in Visual Studio.

Background references

ABAP AI Joule: read this blog, and this blog. Do realize AI ABAP Joule is licensed and not free of use.

All about ABAP for VS code: blog.