Skip to main content

User Exits

abapGitAbout 3 minreference

abapGit contains predefined user exits which can be used to modify the standard behavior.

Overview

If the standalone version is installed, create include ZABAPGIT_USER_EXIT and add local class ZCL_ABAPGIT_USER_EXIT implementing ZIF_ABAPGIT_EXIT.

If the development version is installed create global class ZCL_ABAPGIT_USER_EXIT implementing ZIF_ABAPGIT_EXIT.

To support both versions with the same code, proceed as follows:

  1. Implement ZCL_ABAPGIT_USER_EXIT as a global class and test with the developer version.
  2. Copy & paste the complete code of ZCL_ABAPGIT_USER_EXIT into include ZABAPGIT_USER_EXIT and change the beginning to a local class.
CLASS zcl_abapgit_user_exit DEFINITION
  FINAL
  CREATE PUBLIC.
  1. Activate the include.

In either case, add the object in a package different from the main abapGit code.

The list of user exits can change at any time, make sure to syntax check user exits after updating abapGit.

Exits

ADJUST_DISPLAY_COMMIT_URL

Can be used to set the URL to display a commit. There are default implementations for some providers:

ProviderRepo URLShow Commit URL
githubhttp(s)://github.com/<user>/<repo>.githttp(s)://github.com/<user>/<repo>/commit/<sha1>
bitbuckethttp(s)://bitbucket.org/<user>/<repo>.githttp(s)://bitbucket.org/<user>/<repo>/commits/<sha1>
gitlabhttp(s)://gitlab.com/<user>/<repo>.githttp(s)://gitlab.com/<user>/<repo>/-/commit/<sha1>

ADJUST_DISPLAY_FILENAME

This exit can be used to change the path and filename displayed in the repository view (see #5185open in new window). For example, you can implement a logic to shorten the path avoiding the output of repetitive details.

ALLOW_SAP_OBJECTS

Force allowing serialization of SAP objects.

CHANGE_LOCAL_HOST

If the hostnames are not properly configured, this exit can be used to modify the settings. This is especially useful when running abapGitServer on the local system.

CHANGE_MAX_PARALLEL_PROCESSES

Adjust the determined maximum number of parallel processes used in parallel serialization. Also see CHANGE_RFC_SERVER_GROUP.

CHANGE_PROXY_AUTHENTICATION

Determine based on the repository URL if authentication is required when accessing the proxy.

CHANGE_PROXY_PORT

Determine the proxy port from the repository URL.

CHANGE_PROXY_URL

Determine the proxy URL from the repository URL.

CHANGE_RFC_SERVER_GROUP

Adjust the RFC Server Group used for parallel serialization (default parallel_generators). The group may be cleared to use parallelization without a server group. Then CHANGE_MAX_PARALLEL_PROCESSES needs to be implemented as well. Also see System Resources.

CHANGE_SUPPORTED_DATA_OBJECTS

Add or remove supported data objects. You can add single tables, for example, TABU, RSADMIN, or a set of tables, for example TABU, T009*.

CHANGE_SUPPORTED_OBJECT_TYPES

Add or remove supported object types

CHANGE_TADIR

Can be used to skip certain objects, or force a different object setup than currently in TADIR (Exampleopen in new window).

CREATE_HTTP_CLIENT

Store username and password in RFC connection setup (see #1841open in new window).

CUSTOM_SERIALIZE_ABAP_CLIF

Allows for a custom serializer to be used for global classes' CLIF sources. See #2321open in new window and #2491open in new window for use cases. This example implementationopen in new window forces the old class serializer to be used for specific packages.

As of #4953open in new window, the exit offers a post-processing option. First, the exit is called with the optional parameter it_source set to initial. If you do not return any serialization (rt_source is initial), then abapGit will serialize the object as usual and call the exit a second time. This time it_source contains the complete source and can be modified in the exit as required. To use this option, use the following code at the beginning of the exit:

" Ignore the first call of exit
IF it_source IS INITIAL.
  RETURN.
ENDIF.

DESERIALIZE_POSTPROCESS

Can be used for any postprocessing operation for deserialized objects. Since it is a postprocessing step, only logs can be added to ii_log and one should not terminate the process by raising an exception, which may lead to inconsistencies.

DETERMINE_TRANSPORT_REQUEST

Set a transport request per repository. If set, no transport request popup appears and the transport is used for pull/delete (see #5916open in new window).

ENHANCE_REPO_TOOLBAR

With this exit, you can extend the toolbar with your own menu options. Currently, the exit is active for repository settings so you may define your own settings (see #6249open in new window).

GET_CI_TESTS

Add your own repositories to run a complete CI cycle (clone, pull, check, delete) when executing unit tests for object serializer classes (see #3993open in new window).

GET_SSL_ID

Possibility to change the default ANONYM SSL ID to something system-specific.

HTTP_CLIENT

Can be used for setting logon tickets eg. in connection with abapGitServer connections between SAP systems (Exampleopen in new window). Can be used to change HTTP protocol. E.g. to switch from HTTP/1 to HTTP/1.1 (Exampleopen in new window).

ON_EVENT

This exit allows you to extend abapGit with new features that are not suitable for abapGit itself. For example, you can link to a new page from a wall message. Another use case is redirecting menu items to a custom page rather than standard abapGit, for example using a company-specific solution to replace "Advanced > Run Code Inspector" (see #4722open in new window).

PRE_CALCULATE_REPO_STATUS

Can be used to modify local and remote files before calculating diff status. Useful to remove diffs that are caused by deployment between different system versions (see also abapgit xml stripper pluginopen in new window).

diff sample
diff sample

The exit also receives a repo metadata snapshot (zif_abapgit_persistence=>ty_repo) to identify the repo and its attributes in the current system (e.g. package). This can be used to enable/disable the exit for specific repos.

SERIALIZE_POSTPROCESSING

This exit is called at the end of the serialize process and gives an opportunity to change the content of the serialized files (see #5194open in new window).

VALIDATE_BEFORE_PUSH

Perform custom validations just before pushing into remote while being on the "Commit Message" screen (see #6013open in new window).

WALL_MESSAGE_LIST

Can be used to add a message at the list level (repository list, see #4653open in new window).

WALL_MESSAGE_REPO

Can be used to add a message at the repo level (repository view, see #4653open in new window).

Example: encourage adding topic to repositoriesopen in new window