Giter Site home page Giter Site logo

sapcli's Introduction

Build Status codecov

SAP CLI

Command line interface to SAP products

This tool provides command line interface for ADT which should help you to build your CI tools.

This tool also provides a limited set of RFC Functionality for the cases where ADT is no sufficient or possible.

Installation and usage

First of all you need Python3 (>=3.10) and then you need python-request module. Nothing else because ADT works on level HTTP.

Ubuntu

sudo apt-get install -y git python3 python3-requests python3-openssl python3-venv
git clone https://github.com/jfilak/sapcli.git
cd sapcli
python3 -m venv ve
. ve/bin/activate
pip install -r requirements.txt
./sapcli --help

Enable RFC features

sapcli uses PyRFC which provides Python API for communication over SAP NetWeaver RFC.

Please, follow the installation official install instructions at: https://sap.github.io/PyRFC/install.html

Linux hints

It is not necessary to modify /etc/ld.so.conf.d/nwrfcsdk.conf as you can just set the environment variable LD_LIBRARY_PATH.

The required libraries are compiled the way you can executed them on any x86-64 GNU/Linux, thus you can use the libraries located on your Application server.

Features

The primary goal was to enable ABAP Unit testing

sapcli aunit run class zcl_foo --output junit4
sapcli aunit run program zfoo_report --output junit4
sapcli aunit run package '$local_package' --output junit4

, ATC checks triggering and installation of abapGit which is delivered as a single source ABAP program (report, SE38 thing).

sapcli package create '$abapgit' 'git for ABAP by Lars'
sapcli program create 'zabapgit' 'github.com/larshp/abapGit' '$abapgit'
curl https://raw.githubusercontent.com/abapGit/build/master/zabapgit.abap | sapcli program write 'zabapgit' - --activate

See the complete list of supported operations in doc/commands.md

Usage

You must provide the tool with hostname, client, user and password. It is possible to use either command line parameters or environment variables.

You can prepare a configuration file like the following:

cat > .npl001.sapcli.openrc << _EOF
export SAP_USER=DEVELOPER
export SAP_PASSWORD=Down1oad
export SAP_ASHOST=vhcalpnlci
export SAP_CLIENT=001
export SAP_PORT=8000
export SAP_SSL=no
_EOF

and the you can source the configuration file in your shell to avoid the need to repeat the configuration on command line parameters:

source .npl001.sapcli.openrc

sapcli package create '$abapgit' 'git for ABAP by Lars'
sapcli program create zabapgit 'github.com/larshp/abapGit' '$abapgit'
sapcli aunit run class zabapgit

The tool asks only for user and password if missing. All other parameters either have own default value or causes fatal error if not provided.

Find the complete documentation in doc/configuration.md

RFC usage

When using the RFC features you have to provide the following additional parameters:

  • --sysnr which can be provided as the environment value SAP_SYSNR

For developers

Your contribution is more than welcome! Nothing is worse than the code that does not exist.

Have a look into CONTRIBUTING guide, if you are not sure how to start.

And even seasoned GiHub contributors might consider checking out HACKING guide.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.