Skip to Content
Author's profile photo Gordon Leslie McDorman

Using QR Codes with the Create Incident App in SAP Solution Manager 7.2

Release 7.2 of the SAP Solution Manager contains many significant improvements. One of them is the growing portfolio of SAP Fiori applications, including several easy to use apps for IT Service Management. In this blog, I will describe how you can use the Create Incident Fiori app, together with QR Codes (Quick Response codes), to make reporting and processing incidents even easier for your users.

QR Codes contain encoded information, similar to a 2-d bar code, which users can scan and decode – typically with a smartphone app. The most common use case is to encode a URL which users can scan from a printed physical object, such as a poster, handout, ticket, etc.; the user’s QR Code scanning app then automatically opens the decoded URL. This saves the user the error prone and sometimes tedious task of manually entering the URL in a Web browser.

For example the QR Code below encodes the permalink to my profile:

You can do the same with the SAP Solution Manager Create Incident Fiori app. If you post QR Codes in office spaces, your users will be able to quickly access the app without having to look up the URL. In addition, you can add parameters to the encoded URL to pre-fill fields, such as the component, configuration item, etc. This will save users from manually filling out fields, and make sure that users do not enter incorrect data.

To take advantage of this, perform the following steps:

  1. Determine the URL for your Create Incident app.
  2. Add parameters to the URL in order to pre-fill fields and attributes in the app.
  3. Optionally shorten the URL (this reduces the size of the QR Code).
  4. Encode the resulting URL as a QR Code.
  5. Distribute the QR Code to your users.

I describe each of the steps in more detail below.

1. Determine the URL for Your Create Incident App

This step is easy. Simply open the SAP Solution Manager’s Fiori Launchpad (or your central Fiori Launchpad if you use one) and select the Create Incident tile. Make note of the resulting URL, which should look like the following:


2. Add Parameters to the URL

The Create Incident app allows you to pre-fill most fields with URL parameters. The following is a list of the app’s parameters which were current as of the writing of this blog entry:

Parameter Name Description Example / Encoded Example
title Set the Short Text / Title of the Incident title=Hello%20World
priority Set the Priority of the Incident
Priority ID (1-4) is considered and only valid keys are accepted.
category Set the MLC (Multi-Level Category) of the Incident
Category ID is used. Only valid category IDs for the current Process Type.
component Set the SAP Component
Only existing component keys are accepted
configitem Set the Configuration Item
ConfigItem ID is accepted.
contactperson Set the additional contact person.
BP (Business Partner) ID is accepted.
description Set the Long Text / Description of the Incident description=Hello%20colleagues
PROCESS_TYPE Preselect the Process Type. (Selection Screen will be skipped)
Only valid process types can be used

Use URL encodings (title=Hello%20World instead of title=Hello World) for the parameter values.

A URL with parameters should look like the example below:


3. Optionally Shorten the URL

If you shorten the URL (in other words, reduce the number of characters in the URL), the QR Code which you generate will also be smaller. This could be convenient if you wish to affix QR Codes to smaller devices, such as laptops or printers.

There are a number of online services which offer convenient URL shortening functions. Be sure that your organization’s security policy allows you to use such services.

There is also a blog article which describes how you could implement such a service in ABAP, on one of your own NetWeaver servers:

Here is what my user profile looks like when shortened using a common (third party) service:

4. Encode the URL as a QR Code

You can use several methods to generate QR Codes from the URLs which you have generated:

  • Use an online tool (perform an Internet search to find a reliable QR Code generator).
  • Use your ABAP infrastructure to generate the codes. (See this blog and the sample report below)
  • Use SAPUI5 and the Google Charts API (See this blog)
  • Use a third party tool to generate the code. There are various commercial and open source software products which support this. You may already have access to such tools in your organization.

By far, the easiest options to get started are to use online services or a third party tool. However, if you want to generate lots of QR Codes (for example, to affix codes to every server or printer of your organization), you can use the ABAP infrastructure’s Smart Forms facilities to mass-produce the codes.

Here is an example of how the above generic URL looks when converted to a QR Code:

5. Distribute the QR Code to Your Users

This is also an easy step but could be time consuming. You simply need to print out the codes and affix them anywhere they might be needed: to printers or other devices, so users can report problems without having to find the device’s configuration ID, to user workplaces so users do not have to go hunting for the correct URL to report incidents. There are many options which would make reporting incidents much easier through QR Codes.

When an end user wishes to report an incident, they do the following:
  1. Scan the QR code using their mobile device (smartphone or tablet).
  2. Launch the URL encoded in the QR code. This will start the Fiori Create Incident app and automatically fill in the given fields.
  3. Add any additional information, such as a specific description of the incident.
  4. Submit the incident.

The only requirement for end users is that they must have access to QR code scanners on their mobile devices. Such apps are readily available in the platform specific (iOS, Android, Windows) app stores.

Further Information

Sample Report: Generate QR Codes in ABAP

The following sample report generates a QR code based on the URL which you input and sends the resulting PDF document to your e-mail address. You could adapt the code to automatically generate a series of QR codes based on a list of configuration item IDs, for example.

The code assumes you have created a form, ZPF_QRCODE, as described in the Blog Step by step to create QRCode in ABAP Webdynpro

            mailto  TYPE ad_smtpadr OBLIGATORY.
   ls_outputparams  TYPE sfpoutputparams,
  ls_docparams     TYPE sfpdocparams,
  ls_pdf_file      TYPE fpformoutput,
  ls_post          TYPE crmd_soc_post,
  lv_fm_name       TYPE rs38l_fnam,
  lo_send_request  TYPE REF TO cl_bcs,
  lo_document      TYPE REF TO cl_document_bcs,
  lo_recipient     TYPE REF TO if_recipient_bcs,
  lo_bcs_exception TYPE REF TO cx_bcs,
  lv_sent_to_all   TYPE os_boolean,
  lv_pdf_size      TYPE so_obj_len,
  lt_pdf_content   TYPE solix_tab,
  lv_pdf_xstring   TYPE xstring.
ls_outputparams-noprint   = 'X'.
ls_outputparams-nopributt = 'X'.
ls_outputparams-noarchive = 'X'.
ls_outputparams-nodialog  = 'X'.
ls_outputparams-preview   = 'X'.
ls_outputparams-getpdf    = 'X'.
*     1. create pdf containing qr-code
    ie_outputparams = ls_outputparams
    cancel          = 1
    usage_error     = 2
    system_error    = 3
    internal_error  = 4
    OTHERS          = 5.
 CHECK sy-subrc = 0.
        i_name     = 'ZPF_QRCODE' " put your own form template name here
        e_funcname = lv_fm_name.
  CATCH cx_fp_api_repository
 ls_docparams-langu     = 'E'.
 ls_docparams-country   = 'US'.
 CALL FUNCTION lv_fm_name
    /1bcdwb/docparams  = ls_docparams
    qrcode_input       = content
    /1bcdwb/formoutput = ls_pdf_file
    usage_error        = 1
    system_error       = 2
    internal_error     = 3
    OTHERS             = 4.
 CHECK sy-subrc = 0.
    usage_error    = 1
    system_error   = 2
    internal_error = 3
    OTHERS         = 4.
*     2. send pdf via e-mail
*     -------- create persistent send request ------------------------
    lo_send_request = cl_bcs=>create_persistent( ).
*     -------- create and set document -------------------------------
    lt_pdf_content = cl_document_bcs=>xstring_to_solix( ls_pdf_file-pdf ).
    lo_document = cl_document_bcs=>create_document(
          i_type    = 'PDF'
          i_hex     = lt_pdf_content
*            i_length  = lv_pdf_size
          i_subject = 'Your created QR Code' ).             "#EC NOTEXT
*     add document object to send request
    lo_send_request->set_document( lo_document ).
*     --------- add recipient (e-mail address) -----------------------
*     create recipient object
    lo_recipient = cl_cam_address_bcs=>create_internet_address( mailto ).
*     add recipient object to send request
    lo_send_request->add_recipient( lo_recipient ).
*     ---------- send document ---------------------------------------
    lv_sent_to_all = lo_send_request->send( i_with_error_screen = 'X' ).
    IF lv_sent_to_all IS INITIAL.
      MESSAGE i500(sbcoms) WITH mailto.
      MESSAGE s022(so).
*   ------------ exception handling ----------------------------------
*   replace this rudimentary exception handling with your own one !!!
  CATCH cx_bcs INTO lo_bcs_exception.
    MESSAGE i865(so) WITH lo_bcs_exception->error_type.

Assigned Tags

      Be the first to leave a comment
      You must be Logged on to comment or reply to a post.