How to enhance CCDB with Custom ABAP Content

This document describes how to enhance the data collection of Advanced Configuration Monitoring with custom data collectors in ABAP systems. The following steps must be performed:

1.    Identify suitable CCDB table (ABAP Dictionary)

2.    Create a custom config store definition (CSA Administration – CSA Template Management)

3.    Create function module in the Managed System (BAPI)

4.    Perform SSI Setup

The following sections describe the above-mentioned steps in detail. For further questions please check the FAQ section at the end of the page.

CCDB Table

Step 1: Identify suitable CCDB table

In this How-to we assume Name / Value pairs as collected data, which corresponds to the use of table CCDB_DATA_001. If your data is structured different then you should use one of the generic table stores (CCDB_DATA_5*). For details, please refer to the section CCDB Table in How to enhance CCDB with database content from custom SQL.

Custom Template

Step 2: Create a Custom Config Store Template


In the Focused Run system, a template for the new store collector item (SCI) must be created. Names of Custom Templates  must start with "Z". You can copy and change from an existing templates as starting point (e.g. S00009 when collecting a Name / Value pair).

The following changes must be applied to the new Z-Template:

SCI_ID = "Z<NNNNN>"
OBJVERS = "A"
SCI_DESC = "<Description>"

START_COND="DAILY_HH"

SUPPL_INTF="FUNC"
SUPPL_NAME="<Function name>"
STORE_NAME="<Store name>"

ABAP function module (BAPI)

Step 3: Create ABAP Function Module in the Managed System (BAPI)

You need to create a new ABAP function module and transport it into your managed systems. 

For snapshot based table configuration data, the configuration data is delivered like a regular internal abap table together with an UTC timestamp specifying the detailed time of the snapshot. The developer of the function module must define the key and data fields within the interface described below.

 

Function module interface

  • Attributes: "Remote-Enabled Module" is not required
  • Import Parameters: none
  • Export Parameters:

Changing Parameters

Exceptions

Description

  • Export Parameters TIMESTAMP, RC and RC_TEXT: The mandatory parameter TIMESTAMP corresponds to the UTC time when the snapshot was created. RC is a return code that can be used by the function to send an error code to the CCDB. If RC is ≥ 8, the execution of the function is interpreted as failed which means no data will be transferred. RC=1..7 are reserved returncodes: If possible rc=6 should be delivered in case of missing authorizations. In addition an error text can be passed by the field RC_TEXT.
  • Export Parameters XML_DATA: The snapshot data itself is transferred by the xstring XML_DATA containing two data objects in ABAP canonical XML representation (as XML).
  • Fieldlist: Via the fieldlist you must specify the role of a field. For snapshot based configuration data there are two valid roles: 
    "K" Key Field: Defines the role of a key to the corresponding field. You can define between 1 and n fields having this role. 
    "D" Data Field: Defines the role of a regular data column to a field. Such fields are just attributes of the tupel of key fields.All fields having the role of a key field specify together the primary unique key of one row.
  • Please refer to the template coding below regarding the type definition that must be used.
    In the serialized XML the fieldlist must be stored under the key FIELDLIST. 
  • Snapshot configuration data: The snapshot data consists of a standard internal table. It's mandatory that it contains all fields defined in the fieldlist. Additional fields are ignored but should be avoided because of performance. In the serialized XML the snapshot table must be stored under the key SNAPSHOT.
  • Change Parameters CONTROL_DATA: Parameter reserved for special extractors requiring additional communication.
  • Exceptions UNEXPECTED_ERROR: The function should raise this exception for any error situation that should not occur at all. For all other errors, a returncode RC ≥ 8 can be sent. The caller will catch all other exceptions as OTHERS. Therefore an exception like OTHERS is interpreted as a communication problem. Therefore please don't add additional exceptions, but deliver a return code rc ≥ 8 in error situations.
  • Template Coding:

FUNCTION z_snapshot_table_templ.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  EXPORTING
*"     VALUE(TIMESTAMP) TYPE  TIMESTAMP
*"     VALUE(XML_DATA) TYPE  XSTRING
*"     VALUE(RC) TYPE  I
*"     VALUE(RC_TEXT) TYPE  NATXT
*"  CHANGING
*"     VALUE(CONTROL_DATA) TYPE XSTRING
*"  EXCEPTIONS
*"      UNEXPECTED_ERROR
*"----------------------------------------------------------------------

* Type-Definition: Fieldlist for Snapshot
  TYPES: BEGIN OF ts_fieldlist,
           fieldpos  TYPE i,
           fieldname TYPE fieldname,
           fieldrole TYPE char1,      " 'K' = Key Field
           " 'D' = Data Column
         END OF ts_fieldlist,
         tt_fieldlist TYPE STANDARD TABLE OF ts_fieldlist.

* Fieldlist
  DATA: ls_fieldlist TYPE ts_fieldlist,
        lt_fieldlist TYPE tt_fieldlist.

* Create TimeStamp of Snapshot
  GET TIME STAMP FIELD timestamp.

* START-OF-EXTRACTOR-CODING:

* Data Table
  DATA: BEGIN OF ls_snapshot,
          component  LIKE cvers-component,
          release    LIKE cvers-component,
          extrelease LIKE cvers-component,
        END OF ls_snapshot,
        lt_snapshot LIKE STANDARD TABLE OF ls_snapshot.

* Fill Fieldlist
  CLEAR ls_fieldlist.
  ls_fieldlist-fieldpos  = 1.
  ls_fieldlist-fieldname = 'COMPONENT'.
  ls_fieldlist-fieldrole = 'K'.
  APPEND ls_fieldlist TO lt_fieldlist.

  CLEAR ls_fieldlist.
  ls_fieldlist-fieldpos  = 2.
  ls_fieldlist-fieldname = 'RELEASE'.
  ls_fieldlist-fieldrole = 'K'.
  APPEND ls_fieldlist TO lt_fieldlist.

  CLEAR ls_fieldlist.
  ls_fieldlist-fieldpos  = 3.
  ls_fieldlist-fieldname = 'EXTRELEASE'.
  ls_fieldlist-fieldrole = 'D'.
  APPEND ls_fieldlist TO lt_fieldlist.

* Select data
  SELECT component release extrelease
    FROM cvers INTO TABLE lt_snapshot.

* END-OF-EXTRACTOR-CODING

* Result as XML in xstring
  TRY.
      CALL TRANSFORMATION id
        SOURCE fieldlist = lt_fieldlist
               snapshot  = lt_snapshot
        RESULT XML         xml_data.
    CATCH cx_root.
      RAISE unexpected_error.
  ENDTRY.

ENDFUNCTION.

SSI Setup

Step 4: Perform Simple System Integration (SSI) 

CCDB store template changes are triggered automatically down to the SDA's after changes have been done. The trigger should be completed for all systems within 1 hour. 

You can also trigger the Advanced Configuration Management (ACM) setup of the SSI manually in the CSA Administration by using the button ‘Setup'. For triggering an immediate update on the SDA, you have to select and setup systems one by one.

Waiting one hour or using the CSA Setup directly avoids a complete rerun of the SSI which is of course possible as well.

FAQ

So far no questions have been raised.