SAP Focused Run API’s

SAP Focused Run offers some nice API’s that you can use and re-use.

API’s available:

  • LMDB API
  • Work mode management API
  • Guided procedure API
  • Advanced analytics API

LMDB API

The LMDB now has a REST API available to read data in structured way. You can search for hosts, technical systems, software components, installed product versions and instances.

The full specification for this API can be found on this link.

Ad hoc work mode creation via function module

Via function module FM_START_ADHOC_WORKMODE you can create an ad-hoc work mode to stop monitoring for a system. You can start monitoring again by stopping the work mode by calling function module FM_STOP_ADHOC_WORKMODE.

The full specification of all the work mode API’s can be found in the PDF attached to OSS note 2508346 – Work Mode Management API Documentation for Focused Run.

Triggering guided procedure via function module

Function module FM_EXTRN_GP_EXEC can be used to call a guided procedure. Unfortunately, you need to pass the GUID of the guided procedure to the function module.

The full guided procedure API can be found on this SAP page.

Advanced Analytics API

The specification for the Advanced Analytics API can be found here.

User based debugging

In some cases you need to debug the session of another user. This can be needed for example when you need to solve an issue in ABAP for a FIORI app. The end user is doing his work until the break point is reached. Then you take over the session using the normal debugging tools. The basic principle is explained in OSS note 1919888 – Debugging the applications of another user, and in this SAP help file.

Prerequisites:

Then let the user start the work. You will take over as soon as the break point is reached.

Checklist for issues can be found in OSS note 2462481 – External debug / breakpoint is not recognized.

Set the user ID to be debugged

For your user ID choose the menu option Utilities/Settings. Then select main tab ABAP editor and subtab Debugging:

Now replace your user with the user name for which you want to take the session over using the external break point.

Custom SCI class for checking AUTHORITY-CHECK statement

Follow the steps explained in this blog to set up a new custom check. We will use these steps to set up an extra SCI class to check if the AUTHORITY-CHECK statement is added in ABAP code or not.

New SCI check coding

Step 1: create the ZCL_CI_SCAN_AUTH class

In SE24 copy class CL_CI_TEST_FREE_SEARCH to ZCL_CI_SCAN_AUTH. In the attributes of the copied class set C_MY_NAME as variable to ‘ZCL_CI_SCAN_AUTH’. Also set the error code MCODE_0001 to ‘Z001’.

Step 2: redo the CONSTRUCTOR

Goto the constructor of the new class and overwrite the existing code with this code snippit:

 super->constructor).
 
   description    'Search authority check statement'(001).  "required
   category       'ZCL_OWN_CHECKS'.         "required
   version        '000'.                      "required
   has_attributes c_false.                        "optional
   attributes_ok  c_false.                 "optional
   DEFINE fill_message.
     CLEAR smsg.
     smsg-test c_my_name.
     smsg-code &1.  "message code
     smsg-kind &2.  "message priority
     smsg-text &3.  "message text
     smsg-pcom &4.  "pseudocomment
     INSERT smsg INTO TABLE scimessages.
   END-OF-DEFINITION.
 
   fill_message 'Z001' 'E' 'Search authority check statement'(001' '.

Don’t forget to double click on the 001 to generate the text message.

Step 3: adapt the RUN code

Now the check itself has to be built in the RUN method:

DATA:
     l_include       TYPE sobj_name,
     l_row           TYPE token_row,
     l_column        TYPE token_col,
     l_tokennr       LIKE statement_wa-from,
     l_code          TYPE sci_errc,
     l_search_string LIKE LINE OF search_strings VALUE 'AUTHORITY-CHECK',
     l_position      TYPE i,
     l_found         TYPE VALUE ' '.
 
 *  IF search_strings IS INITIAL.
 *    RETURN.
 *  ENDIF.
 
   IF ref_scan IS INITIAL.
     CHECK get'X'.
   ENDIF.
 
   CHECK ref_scan->subrc 0.
 
 *-- loop at all tokens
   LOOP AT ref_scan->statements INTO statement_wa.
     CHECK statement_wa-from <= statement_wa-to.
     l_position sy-tabix.
     IF statement_wa-type 'S' OR
        statement_wa-type 'P'.
       CHECK comment_mode 'X'.
     ENDIF.
 
     LOOP AT ref_scan->tokens INTO token_wa
            FROM statement_wa-from TO statement_wa-to.
       l_tokennr sy-tabix.
       IF token_wa-type 'S'.
         CHECK literal_mode 'X'.
       ENDIF.
 
 *-- does ABAP-string contain search-string ?
       IF token_wa-str CP l_search_string.
         UNPACK sy-tabix TO l_code(4).
         l_include get_include).
 
         l_row     get_line_absl_tokennr ).
         l_column  get_column_absl_tokennr ).
         l_found 'X'.
 
         EXIT.
       ENDIF.     "l_strpos > l_pos
 
     ENDLOOP.
   ENDLOOP.
   IF l_found NE 'X'.
     informp_sub_obj_type c_type_include
                 p_sub_obj_name l_include
                 p_position     l_position
                 p_line         l_row
                 p_column       l_column
                 p_kind         'E'
                 p_test         c_my_name
                 p_code         'Z001'
                 p_suppress     '"#EC CI_NOAUTH '
                 p_param_1      token_wa-str ).
   ENDIF.

Basically the code looks for the statement ‘AUTHORITHY-CHECK’. If it found nothing happens. If it is found, it will generate a message.

Step 4: generating the message

In the method GET_MESSAGE_TEXT overwrite the code with this new code:

   data:
     L_CODE type SCI_ERRC.
 
   if P_TEST <> MYNAME or p_code c_code_not_remote_enabled.
     SUPER->GET_MESSAGE_TEXT(
                 exporting P_TEST P_TEST P_CODE P_CODE
                 importing P_TEXT P_TEXT ).
     return.
   endif.
   L_CODE P_CODE.
   shift L_CODE left deleting leading SPACE.
   P_TEXT 'No authorithy-check statement found'(101).
   replace first occurrence of '&N' in P_TEXT with L_CODE.

SCI settings

Use steps from blog xxx to add the new check to the SCI variant ZTEST.

SCI variant

Test program

We have written a simple test program without AUTHORITHY-CHECK.

Test program ZTEST

When running the SCI with our test variant, this is the result:

SCI check on AUTHORITHY-CHECK statement

 

S4HANA conversion downtime

When converting from ECC 6.0 EHP8 to S4HANA, you will have to face a significant downtime. In most cases a whole weekend or more.

To get insights into your estimated business downtime, first run the SAP S4HANA Readiness Check.

On the results website, scroll to the Planned Downtime Calculator tile:

Now the details will show the total estimated downtime split into phases:

Phases:

  • System Ramp-Down
  • Downtime Preparations
  • Technical Downtime (SUM)
  • Technical Postprocessing and Data Conversion Preparation
  • Finance and Material Ledger Data Conversion
  • Application Postprocessing
  • Business Validation
  • Go/No-Go Decision
  • System Ramp-Up
  • Fallback Buffer

Each of the phases is described and a amount of estimated hours are put into the estimation. Some are empirical, some are based on your data volume.

You can update the times in the graph by entering the number relevant for your situation and then press Save:

SAP Menu

In some cases you might be asked on the SAP menu. How it is build up, which transaction codes are in there, who is using SAP menu, and how is using the company created menu. And other questions.

Getting menu data can be done in several ways.

Who is using which menu

Check who is using SAP menu is explained in OSS note 3074602 – How to check who are using user menu and who are using SAP menu for all users.

Structured download of menu

Start transaction SE43N and select the menu and press display. In our example S001 for ABAP workbench:

For the main menu in ECC or S4HANA, check for SAP1 as the entry.

You now see the menu in not-expanded mode:

If the tree is large, you get a warning that the full tree is not exploded:

Make sure all the nodes you need information from are expanded.

Now select the menu option Area Menu and then Print to switch to the print mode:

With function System / List / Save / Local file, you can download the list to CSV or TXT file. And import that again to Excel if needed.

ABAP or function module to get data

You can run program SSM_LIST or check Function Module MENU_GET_MENU_TREE_NEW or MENU_R3_SSM_LOAD_MENU_DATA.

This gives list of transaction codes. The texts for the transaction codes are stored in table TSTCT.

Solved: How to download list of transaction from SAP area … – SAP Community

SAP cases (incidents) overview

The me.sap.com has a nice overview for all your SAP cases (incidents).

Questions that will be answered in this blog are:

  • How can I get a nice KPI overview in PDF format on my SAP cases?
  • How can I get a list of all my SAP cases?
  • How can I get insights into aging SAP cases?
  • How can I get insights if the SAP cases are on our side, or at SAP side to solve?

Cases (incidents) overview

Go to https://me.sap.com/reporting/cases/ (part of the EWA workspace).

After opening you reach the dashboard you reach the KPI’s:

If you scroll down you get the easy list overview of all your cases:

From this list you can make an easy download to Excel.

KPI report in PDF format

Top right there is a button PDF report generator:

Follow the wizard and a nice PDF will be generated for you. Mock up of this PDF is so good that you can immediately share it with management.

SAP compatibility packages for S4HANA

In the EWA alert solutions or EWA workspace, you might get warnings from SAP regarding usage of S4HANA compatibility packs.

These alerts can look like below:

or

The background explanation

Both lead to the same background OSS note: 2269324 – Compatibility Scope Matrix for SAP S/4HANA.

From the note: “Through the Compatibility Packages (CP) listed in the attachment “Compatibility Scope Matrix”, SAP provides a limited use right to SAP S/4HANA on-premise customers to run certain classic SAP ERP solutions on their SAP S/4HANA installation. Condition is that these customers have licensed the applicable solutions as set forth in their License Agreements. Compatibility Pack use rights may apply to selected private cloud deployments as well, without the prerequisite of an on-premise classic license.”.

Basically it means SAP did not have time enough to redo all the old solutions for S4HANA, but reserved the rights to do so later.

In the first years of S4HANA this did not used to be a big issue. Now SAP is catching up and will remove compatibility functions in upcoming versions, or will stop support.

Next steps

What do you need to do:

  1. Check if you have any systems with this alert in your EWA. The EWA is detecting this based on system usage/configuration settings.
  2. If you have them, read OSS note 2269324 – Compatibility Scope Matrix for SAP S/4HANA carefully. There are good attachments to the note that explain for each use case.
  3. Determine the impact of the note for your situation with both the functional team and your management (since it can have license impact as well)
  4. Create action plan for your situation

Since the compatibility packs are coming from diverse functional background with diverse solution routes, there is no generic advice possible.

Except one advice: don't ignore this alert, but pick it up seriously. Investigate and take appropriate action in time to avoid license rights discussions and/or support issues.

File interface discovery tool

The file interface discovery tool is a nice tool to find out which file processing is happening on your productive system.

The tool is part of the S4HANA readiness check, but can also be used as a standalone tool.

File interface discovery tool background

All the background of file interface discovery tool is described in OSS note 3322944 – File interface discovery for SAP Readiness Check – incl. corrections for ST-A/PI 01V* SP01 or SP02 (or SP03 if AIX).

The tool re-uses the STUSERTRACE trace function.

Launching the file interface discovery tool

In ST13 choose tool FILE_INTERFACE_DISCOVERY:

Start screen:

Before you start using the Activate traces with filter, please make sure you have sufficient authorizations as described in OSS note 3322944 - File interface discovery for SAP Readiness Check - incl. corrections for ST-A/PI 01V* SP01 or SP02 (or SP03 if AIX).

To start the trace, you have to follow a roadmap guided by the Activate traces with filter button:

Activate the traces:

A switch to RZ11 happens:

Rz11 warning:

Make the setting in RZ11:

Jump back to the roadmap screen (click enter and back). Roadmap will launch trace tool:

Entries will be added:

Reconfirm again RZ11 and finalize the roadmap:

The trace is active now.

File interface discovery tool results

After activation you need to wait for the system to record all actions.

When sufficient time has passed, go back to the ST13 tool FILE_INTERFACE_DISCOVERY and select the function to display the results:

Results list:

You can see:

  • Entry point (in this case LSMW)
  • ABAP include that does the actual file call
  • Activity (R = read, W = write)
  • File names involved

Flat file interface as part of S4HANA readiness check

The file interface discovery tool is part of the S4HANA readiness check. If you did not run the tool, you get an errror:

After you run the tool, download the results and upload in the readiness check portal, the results will be available:

EWA alert solutions

The SAP Early Watch Alert (EWA) report can contain valuable information on specific topics in your system that you must fix.

More information on the EWA workspace can be found in this blog.

General EWA tips and tricks can be found in this blog.

EWA alert solution finder

On the me.sap.com go to the specific page for EWA solution finder:

Action follow up is on the right hand side per alert:

You can choose:

  • Hide the alert (be very careful!)
  • Snooze the alert (see SAP blog)
  • Mail the alert

The snoozing is a very useful function. For example, you detect a red alert on HANA revision, but it will take you a month to implement (due to regression testing, process, etc), you can now snooze the alert for the implementation period:

After the implementation is done, the alert should be gone. If the implementation is delayed, you will be reminded again.