- 2 Minutes to read
- Print
- PDF
Automatic Code Upload via API for Unix OS SAP Server
- 2 Minutes to read
- Print
- PDF
This guide is applicable for a Unix SAP server
Download the Ruby for Linux ZIP file
The file includes the following -
- Xa.rb - the ruby executable script for the Custom Code Extraction and Upload automation
- Config.yml
- RunRuby.sh
- Gemfile
- InstallRuby.sh - Ruby & Ruby Version Manager install file
Step 1 - Create a Folder for Panaya
Create a folder named PANAYA on the Working directory of the SAP server
e.g. /mnt/data/usr/sap/<SYSTEM_NAME>/DVEBMGS00/work/PANAYA
- The PANAYA folder must have the same group and owner as the rest of the files in the working directory
- All files extracted must have full execution permissions
Step 2 - Install Ruby and RVM on Unix server
This step is to be performed by a certified Unix system admin.
The downloaded ZIP file contains the RubyInstall.sh file. Use it for installing Ruby and RVM on the SAP Unix server.
During the RVM installation, you will need to manually be requested to execute the following script -
source ~/.rvm/scripts/rvm
Important!
The steps in the file should be executed by the same user executing systems commands
To verify the installation -
- Use the following command
gem list
and verify that the following gems are installed-
bigdecimal (default: 1.2.8)
bundler (1.15.3)
bundler-unload (1.0.2)
did_you_mean (1.0.0)
domain_name (0.5.20170404)
executable-hooks (1.3.2)
gem-wrappers (1.2.7)
http-cookie (1.0.3)
io-console (default: 0.4.5)
json (default: 1.8.3)
mime-types (3.1)
mime-types-data (3.2016.0521)
minitest (5.8.3)
net-http-persistent (2.9.4)
net-telnet (0.1.1)
netrc (0.11.0)
power_assert (0.2.6)
psych (default: 2.0.17)
rake (10.4.2)
rdoc (default: 4.2.1)
rest (3.0.8)
rest-client (2.0.2)
rubygems-bundler (1.4.4)
rvm (1.11.3.9)
systemu (2.6.5)
test-unit (3.1.5)
unf (0.1.4)
unf_ext (0.0.7.4)
uri-handler (1.0.2) - If any of the gems are missing, try to manually install the bundle by running the following -
gem install bundler
Alternatively, install the gems manually by running the following -
gem install systemu
gem install rest-client
gem install json
gem install uri-handler
Step 3 - Configure the Config.yml file
Open the Config.yml file and define the following -
- server_login - https://<PROD_SERVER_ADDRESS>/api/accesstoken
Use the relevant URL - https://my.panaya.com/api/accesstoken or https://emea.panaya.com/api/accesstoken - server_erps - https://<PROD_SERVER_ADDRESS>/api/erps
Use the relevant URL - https://my.panaya.com/api/erps or https://emea.panaya.com/api/erps - server_etl - https://<PROD_SERVER_ADDRESS>/api/accounts/
Use the relevant URL - https://my.panaya.com/api/accounts/ or https://emea.panaya.com/api/accounts/ - username - <username> - your login username to Panaya
- token- <token> - your token for the Panaya login
- workingdir - <empty>
- erpid - <ERPID> - provided by your CSM
Step 4 - Change parameter in runruby.sh
Open the runruby.sh file and configure the following -
system name - <SYS_NAME>
Verify that the PANAYA folder path is correct -
cd /mnt/data/usr/sap/<SYS_NAME>/DVEBMGS00/work/PANAYA/
bundle install
ruby /mnt/data/usr/sap/<SYS_NAME>/DVEBMGS00/work/PANAYA/xa.rb
Step 5 - Configure the Panaya Code Extractor Program
- Launch transaction SA38
- Fill in the program name - ZPANAYA_EXTRACT_PROG_LIB
- Under Execution mode - Select Background Directory and paste the PANAYA folder path
- Fill in the production RFC details
- Click on Save to create a variant.
For variant name use - API_AUTOMATION
For Meaning use - API Automation - Click on Save
Step 6 - Generate an OS-Command
- Execute transaction SM69
- Use the Create button
- Define Command Name as ZPANAYA_RUBY
- Under Definition, fill in the Operating system command -
<Full path to Folder PANAYA>/runruby.sh
Step 7 - Generate a Scheduled Job
- Execute transaction SM36
- Fill in the job name - ZPANAYA_AUTOMATION_EXTRACT
- Click on the Step button
- Under the ABAP Program section, select ZPANAYA_EXTRACT_PROG_LIB and variant API_AUTOMATION
- Save your work. The following step should appear.
- Click on the Create button
- Select External Command and define the name for the External Command as ZPANAYA_RUBY
For Operating sys. type Linux - Save your work. The following step should appear.
- Click on the Back button and then Start Condition
- Click on the Date/Time Button and define the date and time for the Panaya extractor to be executed.
Check the Periodic Job option and then click on the Periodic values button. - Select the Weekly option and Save
- Click Save again
- The following screen will appear