SAP Focused Run service availability management

manage the figures you need for service availability management:

  • Uptime of the system
  • Planned and unplanned downtime of the system

All service availability management functions are present using this Fiori tile:

On the left hand side there is the menu with all options:

Service availability management definitions

There are 2 definitions we need to configure:

  1. The outage customization
  2. Service availability definitions

First we start with the outage customizing:

Make the required settings for planned and unplanned downtime.

Now you add a new service management definition:

Provide a name and validity date for the definition and use the + symbol to add systems for which the definition is relevant.

In the tab availability set the SLA threshold for the availability percentage:

If relevant you can set specific contractual maintenance time in the last tab:

Example of use for this tab: you are running your SAP system hosted on for example AWS or Azure. Those platforms can have scheduled maintenance as well. That is not in your control.

Carefully check your entries and definition before saving. They cannot easily be changed later!

You cannot delete an active definition. To make it inactive you need to change the end date of the definition to today, and then delete it next day.

Each system can only be in one SLA definition!

Classifying the outages

On the Outages overview you can see the outages. The outages can be 0, or there can be open and/or confirmed outages:

Click on the open alert to classify it (click once for the line, click on the line for the details):

Classify the outage (planned/unplanned) and set the status. Fill out the text to clarify. And then save the update.

Outage reporting

There are 2 main reports. The uptime and outage reporting. The uptime reporting shows how long your system is up since the last reported planned or unplanned downtime. This overview is not so useful.

The useful overview is the outage reporting which shows you the downtime per system and per month:

In the example above 1 system had outage, but that was short enough to still meet the SLA target. Availability was 99.64% versus SLA target over 99.5%.

<< This blog was originally posted on SAP Focused Run Guru by Frank Umans. Repost done with permission. >>

SAP Focused Run workmode management

There will be planned maintenance on SAP systems, databases, operating systems and the below infrastructure. During this planned maintenance, you don’t want any alerts and mails from SAP Focused Run, since the application is not available for a planned time.

Using the work mode management function you plan these maintenance events.

Questions that will be answered in this blog are:

  • How can I set up planned maintenance for systems monitored by SAP Focused Run to temporarily suppress the alerts during maintenance?
  • How can I see the current maintenance and planned upcoming maintenance?
  • Can I make a public page for the IT calendar?

Planning maintenance

Goto the IT calendar and workmode management tile:

Select the system (or select multiple systems in one go) and create the work mode for maintenance, and immediately switch to Expert Mode:

With expert mode you can simply set start and stop date and time.

You also should check the scope (the system will make a proposal) and extend if needed:

After saving, you can send notification via mail on the planned maintenance:

You can now see the planned maintenance in the calendar mode.

Overview of upcoming events

If you are in the calendar mode there can be a lot of systems. The overview screen for upcoming events will filter on the systems which have maintenance mode planned:

Actual maintenance

Actual maintenance can be seen in the System Down monitor:

You will only see maintenance that is currently running in the system down monitor, not the upcoming events.

Alert suppression

Alert suppression is in details set in table ACWMGLOBALDIR (maintenance via transaction SM30). See also this OSS note 3142800 – Health Monitoring Alerts generated during an active workmode in Focused Run for all the details.

Tips and tricks

Can I select multiple systems for planned maintenance in one go? Yes you can, this will save you a lot of time to input.

Can I make a recurring maintenance? Yes you can, in the scheduling screen mark the maintenance as recurring.

IT Calendar access for Non-SAP Focused Run Users

During the maintenance the alerts are suppressed. The same information can also be made generally available to serve as a IT calendar for all interested persons. This can be people for the IT department and the business. These users are mainly interested in planned downtime of the IT systems.

Use of the IT calendar for non-SAP focused run users

After the setup each person can now use this URL:

https://<host>:<port>/sap/bc/ui5_ui5/sap/itcal_external/index.html? FILTER_VARIANT=<public_variant-name>&sap-client=<client>

End result looks like this:

Setup of IT calendar access for non-SAP focused run users

The basic steps are described in OSS note 2926433 – IT Calendar access to Non-SAP Focused Run Users.

Create a system user with copy of role SAP_FRN_APP_ITC role and update it with the UI5 application “itcal_external”(IWSG and IWSV).

Also add these 4 not documented authorizations:

  1. Display for service availability management:

2. Display for work modes:

3. Add generic services:

4. Add filter bar rights:

Activate and save this role.

Activate these 2 SICF services:

  • /default_host/sap/bc/bsp/sap/itcal_external
  • /default_host/sap/bc/ui5_ui5/sap/itcal_external

On the Logon tab of these 2 services set the user ID and password of the newly created system user.

Do the same for the external system alias /sap/itcalnonsolman (also in SICF transaction): also here set the user ID and password for the newly created system user with the assignment of the newly created role.

After settings are done, execute testing. Most issues are coming from lack of auhtorizations.

OSS note for IT calendar function

Relevant OSS notes:

  • 2926433 – IT Calendar access to Non-SAP Focused Run Users
  • 3150979 – Number of systems in scope is limited, while using External IT Calendar

<< This blog was originally posted on SAP Focused Run Guru by Frank Umans. Repost done with permission. >>

New way of activating super user SAP*

In SAP note 3303172 – Activating a Super-User SAP* SAP is describing a new alternative to activate user SAP*.

The SAP* activation is required in some cases. Systems that are protected well have the parameter login/no_automatic_user_sapstar set to 1 which will forbid the logon with SAP* (see also blog on SAP standard users). To use SAP* this parameter has to be set to 0, followed by system restart to activate it (the parameter is not dynamic). Often after using SAP* it is forgotten to undo the SAP* activation or to set the parameter login/no_automatic_user_sapstar to the secure 1 status again.

The new way described is available as of kernel release 790 and a separate tool with a short lived password only.

SAP Focused Run tactical dashboard

ultiple systems. Items that are part of the tactical dashboard is database backup status, performance, logged on users, software maintenance status.

Questions that will be answered in this blog are:

  • How to use the Focused Run tactical dashboards?
  • How to fine tune the tactical dashboards?
  • How to setup your own tactical dashboard?

Tactical dashboards usage

To start the tactical dashboard, click the corresponding Fiori tile:

You now reach the tactical dashboard overview screen:

By clicking the Expand Group icon at the right you get first level of details:

By clicking the tile you are interested in you get the details.

Examples are hardware resources for current week and last month:

Dialog response times:

Amount of logged on users:

And software maintenance status for detailed components:

An alternative for manageming software components is via Security and Configuration management. More details be found in this detailed blog. The tactical dashboard is nice for 1 system. The configuration validation tool is useful for overview of components across multiple systems.

Configuration of the tactical dashboard

By clicking the personalization button top right:

you will reach the configuration screen. Here you can add and delete systems from the overview:

And you can set the view properties and thresholds for each of the categories:

This fine-tuning you do as per your companies needs. By clicking on the Visibility symbol, you can hide an aspect from your overview. Like above the Database backup was put to invisible.

Creating your own tactical dashboard

You can create your own tactical dashboard for your own specific needs. We will take the example here to make a dedicated dashboard for the backups. Since we want to check daily in the overview if the backups were successful.

Start by clicking top left on the big + symbol to add a new dashboard:

The personalization view screen will open:

Important here are a few things. Set the tick box Public if you want to share this dashboard. Find the keyword for the right SAP icon (use the SAP icons link and read this blog). Rename the dashboard by clicking the Rename button.

Now Save the page. Close the personalization. You are now in the empty screen. Open peronalization again to add the system(s):

Also hide the not needed views. On the left hand side you can immediately see the result updating.

Hint: start with one or two systems only when making a new dashboard. First fine tune what you want to see. When all is ok, add the systems later. If you have a lot of systems, the updating of the left hand screen will be slowing you down.

Don’t forget to save off course.

Using a dashboard created by a different user

If you want to use a dashboard created by a different user, go to the personalization option and select the add page option:

Now you can select any created dashboard, which has been set to public.

If you don’t see the correct dashboard, check with the owner that he made it public.

SAP Focused Run self monitoring

When using Focused Run you monitor systems. But how about the health and stability of the monitoring tool itself? Here is where self monitoring plays an important role.

Questions that will be answered are:

  • What to check in self monitoring?
  • How much metrics are collected and stored in my Focused Run installation?
  • How can I check all grey metrics in system monitoring?

Self monitoring

Self monitoring can be started with the Self Monitoring Fiori tile:

If you click the tile the overview page comes (this page will take time to load):

The interesting part is unfortunately hidden in the below screen (you need to scroll), which is the CPU utilisation.

The other interesting part is the amount of data collected and stored. This is not so interesting for yourself, but more interesting for your manager to show how much data HANA can handle, or to show how much work is really automated.

Simple diagnostics agent

On the top left icons, click on the Simple DA agent button to get the agent overview screen:

Important here:

  • Check that all agents are up
  • Check that all agent versions are not too old

Monitoring and Alerting Infrastructure

The next option is to check the MAI (monitoring and alerting infrastructure) data collection:

Important here is to fix the systems in error.

Wily Introscope

The Wily option will show if your Wily Introscope connected to Focused Run is ok. Wily is used for special use cases like JAVA and Business Objects products.

Managed system overview

The managed system overview gives the overview of the diverse systems and application status:

Any red or yellow item can mean a setup issue. But it can also be because of missing authorizations and privileges of the Focused Run technical user in the connected managed system.

Central component monitoring

The central component monitoring shows the overview of the central components:

Identifying all grey metric in System Monitoring

In SAP Focused Run there is no standard mechanism to identify and display all grey metrics in System Monitoring, a grey metric can cause critical situations not being captured and alerted in monitoring hence we need to monitor such grey metrics.

In this blog we explain how you can list all the grey metrics by directly reading from database tables that store the monitoring data.

Focused Run system monitoring metric aggregate data is stored in table AEM_METRIC_AGGR. We can filter on metric status = Grey to see the list of grey metrics.

Open the table in transaction SE16:

Increase the width and no of hits and click on execute:

Now you have all the data that you can export to an excel sheet. For this select the following menu option.

Select file type as Text with Tabs.

Provide the path and filename to save the file and then click on Generate button.

Now open the .txt file in MS Excel.

In the Home tab select option for filtering as shown below

Now set the following filter for the column LAST_RAT

Now you will get the list of all grey metrics as shown below.

Note: The Context_ID value will give you the ID of the managed object, Metrtric_type_ID will give you the ID of the metric name and the Last_text will give you the return text of the last data collection which will give you the reason for grey metric.

In order to get the managed object name and metric type you can use the following in transaction MAI_TOOLS –> Metric Event Alert Details.

In the selection screen for Managed Object ID enter the Context ID from the excel and for Metric Type ID enter the same from the excel. Also select the checkboxes as shown below and execute.

Now you will get the info on the Template as well as the Metric name which is currently in grey.

SAP instructions for grey metrics

You can also check the instructions from SAP in OSS note 2859574 – How to list all current Grey Metrics in FRUN.

Alerting on critical metrics turning grey

It is essential to activate alerting on critical metrics turning grey in order to avoid missing critical issue not getting detected by Focused Run.

Since SAP Focused Run 3.0 FP2 , a new metric has been added to the self monitoring template in System Monitoring, the Grey Metrics metric measure what percentage of critical metrics in Grey.

This metric by default uses threshold 30% for Yellow and 70% for Red rating. You can change this threshold to show red if value crosses more than 1% so that if there are any critical metric that is in grey then alert is raised.

Note: This metric considers only those metrics which are marked as critical in Self Monitoring app. The percentage is calculated based on how many metrics out of the metrics designated as critical metrics in Self Monitoring app are in Grey.

To designate a metric as critical metric navigate to Self Monitoring App in Focused Run launchpad –> Infrastructure Administration.

In the Self Monitoring app navigate to MAI Data Quality.

In the Overview screen select the Managed System type to go to its details screen.

In the Details page it shows list of systems with their critical metrics that are in grey. To modify the list of designated critical metrics click on the chnage button.

In the new popup use the text search button to enter the text of the metric you want to add to the list.

Finally click on the “+” button and then click on close to save the added metric in the critical metric list.

Now the added metric will be considered as critical metric while calculating % of Grey Metrics.

<< This blog was originally posted on SAP Focused Run Guru by Frank Umans and Manas Tripathy (Simca). Repost done with permission. >>

Activating early watch report (EWA) for ABAP and JAVA managed systems in SAP Focused Run

EWAs in Focused Run

When you have performed Simple System Integration (SSI) for the connected managed system on the Focused Run system, by default SSI itself activates the SAP early watch (EWA) reporting for a managed system, provided the managed system has IT Admin Role defined as Production system. For more information on how to set IT Admin Role read this blog.

For non productive systems you can also manually activate EWA.

Additionally for all ABAP systems (Production and Non-production), you will need to configure SDCCN in managed system so that EWA data is sent to the Focused Run system.

Note: In an Focused Run environment, EWAs are not generated on the Focused Run system, but rather at SAP side. Only data is collected at the Focused Run side and the EWA is then available in Service Messages at SAP. For accessing the EWAs you can navigate from the launchpad using the EWA Workspace tile. For more details click here or here.

Steps for activating EWA for ABAP Systems

STEP 1: Activate EWA on Focused run System

Goto Launchpad and click on the SAP Early Watch Alert Status tile.

In the EWA Status Application first you need to select scope to include all ABAP systems as shown below.

To activate EWA, change under Active column from NO to YES for the respective system.

After Activation status changes as shown below. Refresh after 5 minutes to ensure that the first circle is Green.

STEP 2: Configure SDCCN on Managed System

Once EWA session for an ABAP system is activated, the SDCCN of the respective ABAP system must read the EWA session data from Focused Run system. For more details read OSS note 2359359 – SDCC Enhancement for ABAP Systems Connecting to Focused Run.

For this first create a HTTP destination from the managed ABAP system to Focused Run system using report /BDL/CREATE_HTTP . Provide the following input and execute the report.

  1. HTTP Destination: By default, it shows as SDCC_SID, you’d better change the SID to the real target system id. This is the suggestion, but you can specify any name if you want.
  2. SSL Status(HTTPS): This checkbox means whether you want to use HTTPS for the communication. By default, it will only use HTTP.
  3. Path Prefix: By default, the service used by SDCCN is /sap/bc/sdf/sdcc/. You cannot change this unless you mark the checkbox “Force Mode”.
  4. User Name: FRN_EWA_<FRUN SID> which you have created during the initial setup of FRUN system
  5. Run report /BDL/CONFIGURE_SDCCN_HTTP to activate SDCCN. Provide the HTTP destination that created in step 2 and change the job user. Only the first check box must be  selected (only on FRUN 1.0 both check boxes must be selected).
  6. The job user must have authorization SAP_SDCCN_ALL

After running this report with above parameters, the SDCC_OSS RFC will be removed from RFC destinations, and the new HTTP destination will be added to RFC destinations.

STEP 3: Create Maintenance Package on SDCCN in Managed System

Now you need to create a maintenance package in transaction SDCCN of managed system.

To Ensure the EWA activation is properly completed, goto transaction SDCCN on the managed system and ensure that the EWA sessions for the managed system is registered.

When EWA Data is sent to Focused Run and processed at the SAP side, you will see all circles in Green for the respective ABAP system as shown below.

Activating EWA for JAVA Systems

Goto Launchpad and click on the SAP Early Watch Alert Status tile.

In the EWA Status Application first you need to select scope to include all java systems as shown below.

To activate EWA, change under Active column from NO to YES for the respective system.

After Activation status changes as shown below. Refresh after 5 minutes to ensure that the first circle is Green.

To Ensure the EWA activation is properly completed, goto transaction SDCCN on the FRUN system and ensure that the EWA session for respective Java system is registered.

When EWA Data is sent to FRUN and processed, you will see all circles in Green for the respective JAVA system as shown below.

EWA troubleshooting

In case of issues you can follow the link to the troubleshooting guide of SAP:

Data retention

The EWA data is kept for 1 year. To change this, read the blog on housekeeping settings.

Relevant OSS notes

OSS notes:

Guided answers

SAP guided answers:

<< This blog was originally posted on SAP Focused Run Guru by Manas Tripathy from Simac. Repost done with permission. >>

SAP Focused Run cloud monitoring overview

The integration and cloud monitoring function of SAP Focused Run consists of 2 main functions:

  • Cloud monitoring between on premise and cloud SAP products
  • Interface monitoring between SAP systems (read more on interface monitoring in this blog)

This blog will give an overview of the Cloud monitoring between SAP on premises systems and SAP cloud solutions.

Questions that will be answered in this blog are:

  • How does the Cloud monitoring in SAP Focused Run look like?
  • How much details and history can I see in SAP Focused Run interface monitoring?
  • Can I link an Cloud monitoring event to and alert?
  • Which Cloud monitoring scenarios are supported?
  • How to monitor message to and from SAP CPI?
  • How to setup the monitoring towards SAP CPI?
  • How to monitor message to and from SAP Ariba?
  • How to setup the monitoring towards SAP Ariba?
  • How to setup alert notification from SAP BTP?

Cloud monitoring

To start the cloud monitoring click on the Fiori tile:

Select the cloud scenarios:

You now reach the scenario overview screen:

Click on the tile for details (we will take Ariba as example):

Click on the red line between the on premise and the cloud system:

Click on the red errors number for the error overview:

Click on specific error:

Supported cloud scenarios

Not all cloud products and scenarios of SAP are supported via SAP Focused Run Cloud monitoring. On the SAP Focused Run Expert Portal the following scenarios are currently published:

Read the scenario details carefully! Inside the details there might be less monitored than you were expecting.

CPI message monitoring

SAP Focused Run Cloud Monitoring can be used to monitor messages to and from the SAP BTP CPI solution. CPI stands for Cloud Platform Integeration.

End result of CPI message monitoring

The configuration of the scenario is described in the next chapter. We start explaining the end result.

Select the scenario and the overview tile appears:

Click on the card to go to the scenario topology:

Zoom into the overview screen of the errors:

And drill down to any specific error:

Set up of the CPI monitoring scenario

llow the steps from the SAP expert portal for CPI monitoring to setup the STRUST in SAP Focused Run for the CPI URL.

Validate in the SAP Focused Run ABAP stack that these two parameters are set in RZ11:

  • icm/HTTPS/client_sni_enabled = TRUE
  • ssl/client_sni_enabled = TRUE

If this is done, go to the cloud setup FIORI tile:

Add a new end point for CPI:

The application key, client ID and client secret will need to be provided by the basis person or functional consultant maintaining the CPI interface configurations on the BTP cloud. Depending on the security setup, a proxy is required as well.

After entering the details check the connection that connectivity is working as expected.

Now go to the configuration of the interface scenario and create a new cloud service for Cloud Platform Integration:

On the monitoring screen specify filters for specific IFlows if requiered:

On the alerting tab you can set up any alerting wanted:

Set the filter for alerting (in this case all failed flows):

Assign alert receivers and make sure everything is saved and activated.

Now you can model the scenario graphically as well:

Cloud monitoring: Ariba

SAP Focused Run Cloud Monitoring can be used to monitor messages to and from the Ariba solution.

End result of Ariba cloud monitoring

The configuration of the scenario is described in the next chapter. We start explaining the end result.

Select the scenario and the overview tile appears:

Click on the card to go to the scenario topology:

Click on the red line to zoom into the communication error details:

Click on the message to zoom into the details:

Set up of the Ariba monitoring scenario

ollow the steps from the SAP expert portal for Ariba monitoring to setup the STRUST in SAP Focused Run for the Ariba URL.

Validate in the SAP Focused Run ABAP stack that these two parameters are set in RZ11:

  • icm/HTTPS/client_sni_enabled = TRUE
  • ssl/client_sni_enabled = TRUE

If this is done, go to the cloud setup FIORI tile:

Add a new end point for Ariba:

The application key, client ID and client secret will need to be provided by the basis person or functional consultant maintaining the Ariba interface configurations on the Ariba cloud. Depending on the security setup, a proxy is required as well.

After entering the details check the connection:

Now go to the configuration of the interface scenario and create a new cloud service for Ariba Network Transaction:

On the Monitoring tab connect to the end point create above and set the wanted filters:

If you want, you can also set up alerting in the third tab.

Save and activate the setup.

Now you can model the scenario graphically as well:

Alert notification from BTP

The BTP platform has a function called Alert Notification. This is a generic function that can be used to send alerts. It can be used to send alerts from applications, but also to send alerts from the HANA Cloud database.

SAP Focused Run can pick up these alert notifications form the BTP platform. From there Focused Run can be used to further relay the alert to notification teams.

Setup of the scenario

First you need to prepare your BTP environment to allow SAP Focused Run to collect data from the Alert Management application from your tenant and subaccount. This will give you the URL, client ID and client secret (be careful this is only shown once). To do this, follow the steps on the SAP Focused Run expert portal in this link.

For the setup of the scenario in SAP Focused Run, go to the FIORI tile for cloud setup:

Set up the OAUTH end point:

After the setup save the details and test the connection.

Now this end point can be used in the scenario setup.

In the Scenario configuration create the Cloud Service and select the SAP Cloud Platform Alert Notification Service:

In the monitoring details set the Endpoint you just created and filter on the events:

In the third tab Alerting you can set up the alerts if wanted.

Save and activate.

In the scenario modelling you can now use an on premise system and the Cloud Service you set up above to model a graphical scenario:

End result of alert notification from BTP

Select the configured scenario:

In this case we have setup the alert notification for HANA Cloud. Click on the card tile for details, and click on the interface line:

Now select the errors and the overview screen opens:

Click on a single line to go to the specific error details:

<< This blog was originally posted on SAP Focused Run Guru by Frank Umans. Repost done with permission. >>

SAP Focused Run demo system and OpenSAP course

The SAP site for Focused Run has a link to the online Focused Run demo system and link to videos.

First visit the general SAP Focused Run site. Now scroll down to the resources part:

On the right hand side are the video.

In the middle the Demo System link. You can also access it directly via this URL.

Scroll down to the landscape overview. To access the system press the blue “SAP Focused Run launchpad button”.

The user ID and password is in the table below the button.

OpenSAP training on SAP Focused Run

SAP is providing training on SAP Focused Run on the OpenSAP online platform. Follow this link for the main training.

Content of the online training:

Older background material

Some older, but still useful, background material can be found on this link.

<< This blog was originally posted on SAP Focused Run Guru by Frank Umans. Repost done with permission. >>

SAP Focused Run housekeeping and technical clean up

Housekeeping in SAP Focused Run is needed for 3 reasons:

  1. Keep performance high
  2. Reduce data footprint on the database
  3. Stay within the licensed volume (see more on licenses of SAP Focused Run in this blog)

Questions that will be answered in this blog are:

  • Which housekeeping settings can I make in SAP Focused Run?
  • Which technical clean up can I do in SAP Focused Run?

Housekeeping for alert and event management

For alert and event management housekeeping program:

Housekeeping for system analysis and root cause analysis

For system analysis housekeeping schedule program SRAF_LOG_HOUSEKEEPING and WEA_AGG_STORE_PARTITIONING. For root cause analysis schedule program RCA_HOUSEKEEPING.

Detailed settings for RCA housekeeping are done in table RCA_HKCONFIG. You can maintain this table with SM30:

Housekeeping for application integration monitoring

For application integration monitoring housekeeping schedule program /IMA/HOUSEKEEPING for older releases and /IMA/HOUSEKEEPING_NEW for FRUN 3.0 FP01 onwards.

In the tile for integration monitoring you maintain the detailed settings and retention periods:

Press the change button to alter the data retention periods towards your need:

Housekeeping for EWA data

For EWA data housekeeping schedule program FRUN_DELETE_SERVICE_DATA:

Important year: default 1 year of EWA data is kept. If you need more, increase the days kept. If you want to clean up more, you can reduce the days.

Housekeeping for health monitoring

For health monitoring housekeeping, schedule program OCM_HOUSEKEEPING.

Housekeeping for statistical records

For housekeeping of statistical records, schedule program AI_STATRAGG_HOUSEKEEPING:

Read also this note explaining it will take time before clean up is reflected: 3478938 – Housekeeping of System Analysis data in SAP Focused Run.

Housekeeping for work mode management

For housekeeping of work mode management, schedule program WMM_HOUSEKEEPING:

Housekeeping for security and configuration validation

In the Configuration and configuration analytics Administration tile, choose the configuration icon:

Here you can set the retention period.

Technical clean up

There are also technical tables that might grow fast in SAP Focused Run that will consume memory in your HANA database.

Fast growing table LMDB_P_CHANGELOG

See OSS note 2610122 – Cleaning up the change history in the LMDB: run program RLMDB_CLEAR_CHANGELOG.

Fast growing SISE_LOG table

Run program SISE_LOG_DELETE to clean up SISE_LOG table. See OSS note 2984789 – Scenario F4-help not working for SISE_LOG_DELETE report.

Idoc and PI monitoring data fast growing

If you get too much data for idoc monitoring, apply OSS note 3241688 – Category wise table cleanup report (IDOC, PI). This note delivers program /IMA/TABLE_CLEANUP_REPORT for clean up.

Invalid entries in MAI_UDM_PATHS

If table MAI_UDM_PATHS is getting large, follow the instructions from OSS note 3030652 – Cleanup invalid entries from database table mai_udm_paths to clean up. It is explained in more detail in OSS note 3250729 – Housekeeping for metric paths. And read OSS note 3424812 – MAI housekeeping does not allow ad hoc execution for ad hoc clean up.

<< This blog was originally posted on SAP Focused Run Guru by Frank Umans. Repost done with permission. >>

ABAP cleaner Eclipse plugin

The ABAP cleaner Eclipse plugin is a great tool to clean up your ABAP code according to the ABAP clean code principles.

Questions that will be answered in this blog are:

  • How to install the ABAP cleaner Eclipse plugin?
  • How to run the ABAP cleaner?
  • How to configure the ABAP cleaner?

Installation of the ABAP cleaner Eclipse plugin

Follow the instructions on the ABAP cleaner site for installation. In short, just like you install the ADT tools, now put in the site “https://sap.github.io/abap-cleaner/updatesite“. Download the software and ignore the certificate warnings. Eclipse restart is required.

Running ABAP cleaner

Basic use instructions can be found on the ABAP cleaner site. We will use this example code:

REPORT zcleanerdemo.

* ABAP clean code demo
Data: abap_true type boolean.
data: do_not_do_anything type boolean.

write:/ 'Hello world'.

if abap_true <> 'X'.
write: 'ok'.
else.
write: 'not ok'.

endif.

Yes, this code is ugly.

In Eclipse right click on the code and select the option Source Code and then the option Clean up with Interactive ABAP cleaner…

It is best to start always with the interactive cleaner so you have insights and control on the changes done to your source code.

On the left hand side you see your old code. On the middle the code changes proposed. On the right hand side you see the clean up settings.

The profile is determining the rules used. Out of the box you get the default and essential profile. It is advised to play around and build your own set using the Configure button (see next chapter in this blog).

You can set the clean up range: from current statement, current method, current class to whatever code you opened in Eclipse (multiple windows). You might wonder, why only current statement or method? Remember one of the clean code principles is the boy scout rule; leave the code better than how you found it. So no need to refactor old stuff completely, do it chunk by chunk every time.

The restrict rules of syntax can be set to the latest ABAP release or to a specific release.

If you click on a rule, you can see the rules applied in bottom right part of the screen:

If you are happy with the changes press the Apply and close button.

ABAP cleaner configuration

On the screen above when you hit the Configure button you reach the configuration screen:

This screen is overwhelming when you start. Top right you can manage your profiles. Create new ones or copy from templates. Bottom right you can switch on and off which detailed rule is part of the profile. On the top right you can fine tune the exact details of each rule according to your needs and preferences.

The changes you make will be made instantly available on the example, so you can immediately assess the impact of your fine tuning.

Word of care: take care that ABAP cleaner and Pretty printer are not constantly juggling your code around.