Skip to Content

Create Business Configuration Maintenance Object

Create a Business Configuration Maintenance Object using the ABAP Repository Object Generator.
You will learn
  • How to create Packages
  • How to create Data Elements
  • How to create Database Tables
  • How to enable Log Changes
  • How to generate a Business Configuration Maintenance Object
mervey45Merve TemelFebruary 17, 2023
Created by
jmmargo
May 23, 2022
Contributors
maximilianone
jmmargo
sepp4me

Prerequisites

This tutorial shows you how to create a SAP Fiori based Table Maintenance app using the ABAP RESTful Application Programming Model (RAP) and the Custom Business Configurations (CUBCO) app. This tutorial is based on a simplified error code data base model.

Hint: Don’t forget to replace all occurrences of the placeholder ### with your ID of choice in the exercise steps below. You can use the ADT function Replace All (CTRL+F) for the purpose.

  • Step 1
    1. Open your ABAP Development Tools, logon to your ABAP system and right-click on ZLOCAL, select New > ABAP Package.

      New package
    2. Create a new package:

      • Name: Z_ERROR_CODES_###
      • Description: Error Codes ###
      • Super-package: ZLOCAL
      • Check Add to favorite packages
      Enter new package
      Click Next >.
    3. Enter a new transport request and click Finish.

      Create new Transport Request
    Log in to complete tutorial
  • Step 2
    1. Right-click on Z_ERROR_CODES_###, select New > Other ABAP Repository Object.

      New Data Element
    2. Search for Data Element, select it and click Next >.

      Select Data Element
    3. Create a data element:

      • Name: Z_ERROR_CODE_###
      • Description: Error Code
      Enter new Data Element
      Click Next >.
    4. Select the previously created Transport request and click Finish.

      Select existing Transport request
    5. Select Predefined Type as Category, NUMC as Data type, 3 as Length and enter Error Code as Field Labels:

      Data Element definition
    6. Save and activate.

    7. Repeat step 2.1. - 2.5 to create a second Data Element:

      • Name: Z_CODE_DESCRIPTION_###
      • Description: Error Code Description
      • Category: Predefined Type
      • Data Type: CHAR
      • Length: 120
      • Short Field Label: Text
      • Other Field Labels: Description
      Data Element definition
    8. Save and activate.
    Log in to complete tutorial
  • Step 3
    1. Right-click on Type Group Dictionary in package Z_ERROR_CODES_###, select New > Database Table.

      New database table
    2. Create a Database Table:

      • Name: ZERRCODE_###
      • Description: Error Code ###
      Create database table
      Click Next >.
    3. Select Transport Request and click Finish.

    4. Replace your code with the following:

      ABAP
      Copy
      @EndUserText.label : 'Error Code ###'
      @AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
      @AbapCatalog.tableCategory : #TRANSPARENT
      @AbapCatalog.deliveryClass : #C
      @AbapCatalog.dataMaintenance : #ALLOWED
      define table zerrcode_### {
        key client            : abap.clnt not null;
        key error_code        : z_error_code_### not null;
        last_changed_at       : abp_lastchange_tstmpl;
        local_last_changed_at : abp_locinst_lastchange_tstmpl;
      }
      
    5. Save and activate.

    6. Repeat step 3.1.- 3.4 and create another Database Table:

      • Name: ZERRCODET_###
      • Description: Error Code Description ###
      ABAP
      Copy
      @EndUserText.label : 'Error Code Description ###'
      @AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
      @AbapCatalog.tableCategory : #TRANSPARENT
      @AbapCatalog.deliveryClass : #C
      @AbapCatalog.dataMaintenance : #ALLOWED
      define table zerrcodet_### {
        key client            : abap.clnt not null;
        @AbapCatalog.textLanguage
        key langu             : abap.lang not null;
        @AbapCatalog.foreignKey.keyType : #TEXT_KEY
        @AbapCatalog.foreignKey.screenCheck : false
        key error_code        : z_error_code_### not null
          with foreign key [0..*,1] zerrcode_###
            where client = zerrcodet_###.client
              and error_code = zerrcodet_###.error_code;
        description           : z_code_description_###;
        local_last_changed_at : abp_locinst_lastchange_tstmpl;
      }
      
    7. Save and activate.

    Log in to complete tutorial
  • Step 4

    To use the Business Configuration Change Logs app, activate the log changes function to keep track of configuration changes in your business configuration tables.

    For client dependent customizing tables, buffering is typically switched on by generic key with number of key fields equal to 1. For client dependent customizing text tables, buffering is typically switched on by generic key with number of key fields equal to 2 to include the language key field.

    Read operations on the CDS view entities do not benefit from the table buffer but have their own buffer mechanism see this blog. Consider reading directly from the buffered customizing tables in your application code.

    The Log Changes flag has to be enabled in the technical settings for the table:

    Enable Log Changes

    Save and activate.

    Log in to complete tutorial
  • Step 5

    A Business Configuration Maintenance Object declares a Service Binding as relevant for business configuration. They are listed in the Custom Business Configurations app. By selecting an entry in the app a SAP Fiori elements based UI is rendered to maintain the business configuration.

    You can use the ABAP Repository Generator to create the necessary repository objects.

    1. Right-click on table ZERRCODE_### and select Generate ABAP Repository Objects….

      Start ABAP Repository Objects generator
    2. Create a Business Configuration Maintenance Object:

      • Description: Maintain error codes
      • Generator: Business Configuration Maintenance Object
      Select generator
      Click Next >.
    3. The system generates a proposal for all input fields based on the description of the table. An additional database table is considered as the text table by the wizard if the annotation @AbapCatalog.foreignKey.keyType : #TEXT_KEY is used. If you encounter an error message stating a specific object already exists, change the corresponding name in the wizard.

      Click Next >.

      Generator proposal
    4. The list of repository objects that are going to be generated is shown. Click Next >.

    5. Select a Transport Request and click Finish.

    6. When the generation is completed, the new Business Configuration Maintenance Object is shown. Refresh your project explorer and check the other generated objects. If you publish the Local Service Endpoint of service binding ZUI_ERRORCODE###_O4 you can already start the Custom Business Configurations app from the SAP Build Work Zone and select the created Business Configuration Maintenance Object. However you will not be able to read or edit the configuration entries because your user is missing authorizations. Instead you will provide authorization control for a Business Configuration Maintenance Object in the next tutorial and then finally use the Custom Business Configurations app.

    7. If you only have a trial account you need to perform the following adjustments because you are not able to create Customizing Transport Requests or Business Roles. You can then also skip the following tutorial Provide authorization control for a Business Configuration Maintenance Object and continue with tutorial Use Custom Business Configurations app.

      • Edit class ZBP_I_ERRORCODE###_S, section Local Types. Delete the content of the following methods. Afterwards save and activate the class.

        • GET_GLOBAL_AUTHORIZATIONS
        • LSC_ZI_ERRORCODE###_S→SAVE_MODIFIED
        • LHC_ZI_ERRORCODE###→VALIDATERECORDCHANGES
        • LHC_ZI_ERRORCODE###TEXT→VALIDATERECORDCHANGES
      • Delete the generated Access Control objects

      Delete Access Controls
      • Publish the Local Service Endpoint of service binding ZUI_ERRORCODE###_O4
      Publish Service Binding

    More information about the Business Configuration Maintenance Object configuration can be found here. For example you can enable or disable inline creation of table entries.

    More information about defining CDS annotations for metadata-driven UIs can be found here. For example you can adjust the visibility, positioning and labels of the fields. By default the field label is derived from the Data Element.

    Additional information about RAP BO with multi-inline-edit capabilities can be found here

    The content of a text table can also be maintained using the Maintain translations app

    Draft business objects requires a total Etag field to ensure optimistic concurrency comparison.

    The augment statement is used to enable the end user to maintain language dependent texts in their logon language

    See also naming conventions for Development Objects

    Log in to complete tutorial
  • Step 6

    Which repository object declares a Service Binding as relevant for Business Configuration?

    Log in to complete tutorial
Back to top