abap-gencust
A generic customizing table pair and reader class for ad hoc configuration parameters in ABAP, replacing a new table, view and access routine per parameter, with values per user or key date.
New customizing parameters in a project usually mean a new table, a view, a view cluster and an access routine each time. This replaces them with one generic pair of header and item tables, keyed by a purpose key, holding single values, structure-like parameters or multi-value parameters, and read through a reader class that a factory instantiates and that returns an object saying whether a value was found rather than the value alone. An item key can also carry an organisational level, a valid-from date and a user id, so a setting can be switched on for one user during a test phase or from a key date onwards. There are two identical table pairs: one is normal customizing with a link to the transport system, the other has none and is meant for maintaining values directly in the production system. Validating values against domains or check tables stays outside it, which the maintainer leaves to normal customizing features.
Facts
Where it sits
Who is behind it
In the atlas: maintains 5, contributes to 6@jrgkrausmaintainer
What it declares
Every artifact
- Type
- Package
- Origin
- Independently maintained
As a package
- Where it runs
- Inside its host
- Distributed through
- abapGit
Connections
Per-environment settings without per-environment code
Git client written in ABAP that runs inside the system
Download
README
quoted from jrgkraus/abap-gencust under GPL-3.0, readGeneral customizing table for ABAP
Use case
If there is a need for new customizing parameters in customer projects, we usually create tables, views, view clusters, access routines and so on. What if we used one single table for this? We would have an unique access module and could store as many parameters as we want using an access key.
Real-life experiences
I used this approach for many years in a mid-range implementation with about 3000 Users. It makes the developing more straightforward when it comes to use settings stored in the database. After 4 years, about 250 different parameter keys accumulated in our generic table. In case we have special requirements such as proper validation of values against domains or check tables, we continue using normal customizing features, but in case of simple setup parameters, the generic table is very helpful.
Features
- General customizing tables
- Possibility to set validity dates and user ids (for testing)
- Usage with our without change requests (customizing or non-customizing)
- Possibility to store structure-like parameters (see
ZP_GENCUST_DEMO_STRUCTURE) - Possibility to store multi-value parameters (see
ZP_GENCUST_DEMO_MULTIPLE)
Installation
- Download the repository and install it with ABAPGIT
- Generate view maintenance dialogues
- ZDB_GENCUSTHD, ZVI_GENCUSTIT: Delivery class is C, so the dialogues will create with recording routine
- ZDB_GENCUSTHD2, ZVI_GENCUSTIT2: Delivery class is A, so no recording routine will be included
Usage notes
Maintaining the tables
There are two (identical) sets of customizing tables: ZDB_GENCUSTHD ZDB_GENCUSTIT and ZDB_GENCUSTHD2 ZDB_GENCUSTIT2. The latter ones are tables with no transport link. They are intended for maintaining directly in the production system (for example, if material numbers, customer codes, address numbers ore anything else concerning master data is to be stored). The others are normal customizing with link to the transport system.
I recommend creating two view clusters, for each pair of tables one. See the example here:

We also created parameter transactions (based on SM34) to quickly maintain the data.
The header table contains the following fields:
- Purpose key: the general access key for this parameter set
- SAP Module: The top-level ERP module (MM, PP...) where the parameter is used
- Description of the parameter
- Description that contains info on the organization level that is being used (could be plant, company key or even a concatenation of levels such as sales org / distr. chan / division)
The item table has the following:
- Purpose key
- Org level: a general-purpose key (20 chars) to qualify the setting. Could be a "real" org. level but also any another structural characteristic from the business model
- Optional key: in some cases, a single key is not sufficient. Here, this key comes handy
- Valid from: This special parameter can be used to make a row valid from a specific date on. It could be helpful if you want to activate a new feature on a key date
- User: This is for the test phase of the project. One can activate the setting only for a specific user
- Counter: If a multi-value parameters is required, use the counter and create several lines with the same key but incremental counter. Make sure to not mix values with counters and those without for one purpose key
- Inactive: activating this checkbox wil make the reader class not consider the row
- Parameter value: 255 characters to store the value of the parameter
- Parameter description: if needed, each parameter can be described here
Using the reader class
The reader class is instantiated by a factory:
settings_reader =
cond #(
when input = abap_true
then zcl_gencust_factory=>get_main_nocust( parameter_purpose )
else zcl_gencust_factory=>get_main( parameter_purpose ) ).
As shown in the example, there are two options: instantiate the customizing variant (ZDB_GENCUSTHD ZDB_GENCUSTIT) or the non-customizing one.
Reading the values
data(settings_value) = settings_reader->single( plant ).
The read methods implement the return pattern, thus they return an object that can be used to get the value that has been read, but also to determine if a value exists or not.
if settings_value->is_ok( ).
cl_demo_output=>display( |Value found: { settings_value->get_value( ) }| ).
else.
cl_demo_output=>display( settings_value->get_error( ) ).
endif.
Demo reports
Refer to the ZP_GENCUST_DEMO* reports to learn more about how to use the features
Others providing
Compare all 6 on the Configuration page →- config-managementconfig-managementKeeps the theme, UI5 bootstrap source, custom CSS and Content-Security-Policy of an abap2UI5 page in database tables instead of in code, with a popup app to edit them.community org, abapTheme, CSS and CSP settings of abap2UI5 pages kept in tables
- abaKabaKA beta library for ABAP constants that lets each program register its own source, a custom table or CSV, XML or JSON content from a URL, standard text, server file or remote system, rather than one shared table.independent, abapLibrary for managing ABAP constants from registered sources
- aqoaqoA library for defining ABAP application options as a structure or class, with change history, transport integration and a maintenance UI generated from that description, instead of SM30 tables or STVARV.independent, abapABAP application options as a structure with a generated editor
- abap-dynamic-assignmentabap-dynamic-assignmentA framework for maintaining runtime parameters, ranges and value mappings in ABAP instead of hard-coded values or TVARVC, checked against data elements and maintained in a RAP Fiori app.independent, abapFramework for runtime parameters, ranges and value mappings in ABAP
- abap-tvarvcabap-tvarvcA helper class for reading TVARVC parameters and select-options from ABAP, with one method for a single parameter and two for select-options, raising zcx_core_tvarvc when a read fails.independent, abapHelper class for reading TVARVC parameters and select-options
Details
Sources
Sources are graph entities: the same page may back several entries, and an unreachable source flags every row that rests on it.
Compatibility and provenance
abaplint
History in the atlas
- First seen.
For your agent
- Ref
artifact:jrgkraus-abap-gencust- JSON
- /artifacts/jrgkraus-abap-gencust.json
- MCP
- Connecting an agent