Skip to content

About

abapgit-api-rfc

Resources

Stars

9 stars

Watchers

6 watching

Forks

Latest commit

 

History

11 Commits

Folders and files

Repository files navigation

abapGit API

This API enables you to perform essential abapGit functions on a remote SAP system.

Overview

abapGit API can be used for building your CI tools and integrations.

It allows you to perform the following actions:

  1. Link the repository
  2. Pull the repository
  3. Switch the branch
  4. Unlink the repository
  5. List the repositories
  6. Commit and push all changes

Requirements and installation

  1. Install the sapcli
  2. Install PyRFC
  3. Add a configuration file (as documented in the sapcli repository)
  4. The remote SAP system must have abapGit developer version and abapgit-api-rfc (this repo) installed

Usage

Create link

ZABAPGIT_API_RFC_LINK

  • required
    • GIT_REPO_URL
    • GIT_USER
    • GIT_PASSWORD
  • optional
    • ABAP_PACKAGE
    • BRANCH
    • FOLDER_LOGIC
    • IGNORE_SUBPACKAGES
    • MAIN_LANG_ONLY
    • STARTING_FOLDER

example:

sapcli startrfc -c bapi ZABAPGIT_API_RFC_LINK -S=GIT_REPO_URL:https://github.com/abapGit/background_modes -S=GIT_USER:filak-sap -S=GIT_PASSWORD:${MY_GH_TOKEN} -S=ABAP_PACKAGE:'$BACKGROUND_MODES'

Pull Repo

ZABAPGIT_API_RFC_PULL

  • required
    • ABAP_PACKAGE
    • GIT_USER
    • GIT_PASSWORD
  • optional
    • CORRNR

example:

sapcli startrfc -c bapi ZABAPGIT_API_RFC_PULL -S=ABAP_PACKAGE:'$BACKGROUND_MODES' -S=GIT_USER:filak-sap -S=GIT_PASSWORD:${MY_GH_TOKEN}

Switch branch

ZABAPGIT_API_RFC_SWITCHBRANCH

  • required
    • ABAP_PACKAGE
    • GIT_USER
    • GIT_PASSWORD
  • optional
    • BRANCH_NAME

example:

sapcli startrfc -c bapi ZABAPGIT_API_RFC_SWITCHBRANCH -S=ABAP_PACKAGE:'$BACKGROUND_MODES' -S=GIT_USER:filak-sap -S=GIT_PASSWORD:${MY_GH_TOKEN} -S=BRANCH_NAME:main

Unlink

ZABAPGIT_API_RFC_UNLINK

  • required
    • ABAP_PACKAGE

example:

sapcli startrfc -c bapi ZABAPGIT_API_RFC_UNLINK -S=ABAP_PACKAGE:'$BACKGROUND_MODES'

List repositories

ZABAPGIT_API_RFC_LIST

  • no parameters
  • returns the table REPOSITORIES (ZABAPGIT_API_RFC_REPO_T) with the fields REPO_KEY, NAME, ABAP_PACKAGE, IS_OFFLINE, URL, BRANCH_NAME, SELECTED_COMMIT, CREATED_BY, CREATED_AT, DESERIALIZED_BY, DESERIALIZED_AT

example:

sapcli startrfc -c bapi ZABAPGIT_API_RFC_LIST

Commit and push

ZABAPGIT_API_RFC_COMMITPUSH

  • required
    • ABAP_PACKAGE
    • GIT_USER
    • GIT_PASSWORD
    • COMMENT - the commit subject
    • ALL - must be 'X'; only committing all changes reported by abapGit is supported
  • optional
    • BODY - the long commit message, separated from COMMENT by an empty line
    • COMMITTER_NAME, COMMITTER_EMAIL - default to the abapGit user settings, then to the user master record and finally to the SAP user name
    • AUTHOR_NAME, AUTHOR_EMAIL - default to the committer

The committed and deleted objects are reported in RETURN as messages of the type S.

example:

sapcli startrfc -c bapi ZABAPGIT_API_RFC_COMMITPUSH -S=ABAP_PACKAGE:'$BACKGROUND_MODES' -S=GIT_USER:filak-sap -S=GIT_PASSWORD:${MY_GH_TOKEN} -S=ALL:X -S=COMMENT:'Update objects'

About

abapgit-api-rfc

Resources

Stars

9 stars

Watchers

6 watching

Forks

Used by

Contributors

Languages