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 plase 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 either a table used by another existing Config Store or you 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>' und OBJVERS = ‘A' und SCI_DESC='<Description>'
START_COND="DAILY_HH"
SUPPL_INTF="FUNC"  und SUPPL_NAME="<FUBA_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 serialized XML format: #The 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. #The 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.

  types: 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.

  data: 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 SSI manually for each system in the CSA Administration by running the Setup. For triggering an immediate update on the SDA, you have to select and setup systems one by one.

Note that scripts need to be distributed with non-SAP tools, since FRUN is currently unable to perform this step.

FAQ

So far no questions have been raised.