(DV-2208) ERP Report Comparison via Python - setup

Application server prerequisites:

  • GNU C Library (GLIBC) 2.17

SAP User prerequisites:

  • Auth. check on object S_LOG_COM

  • COMMAND = ‘python’, ‘cd’, ‘chmod', ‘ls’, ‘mkdir’,’rm'

  • OPSYSTEM = operating system of an application server

  • HOST = host on an application server

Installing Python Comparator on AS

Installation process of Python Comparator is simplified via the program. Run transaction /DVD/VAL_REP_PY_INST to execute it.

  • Fill in a new name for Preset ID starting with the prefix ZVAL_REP_PYTH_COMP_*. The preset defines all setups for location and execution of python script on the AS.

  • Click on the Install Python Comparator radio button

  • [OPTIONAL] Fill RFC Destination of the remote SAP system for installing and execution of Python Comparator if the current system will not be used. SNP Validate transport has to be already imported on the remote system too.

  • Fill in the name of the Application Server where the Python Comparator will be installed. If the RFC destination is used then the server name has to be from the remote system. By default, the server name of the current log-on session is used.

  • Fill working directory path where the Python Comparator will be installed and operates.

  • Click on the execution button.

When the installation process is executed the following actions are automatically performed on chosen Application Server (of the remote system if RFC is filled):

  • working directory path and subdirectories are created if not exists yet,

  • files of Python Comparator build (compiled version) from repository set DVD_VAL_REP_PYTH_COMP_INSTALL are copied to subdirectory compare_build

  • permission for execution is set to Python Comparator build

  • preset configuration is filled will all necessary setup and execution information

After successful installation following message is displayed with the processing log:

Created preset can be displayed by pressing the F1 key on the preset ID.

Check Python Comparator installation

To check if Python Comparator is properly installed, choose the radio button Check installation and execute it. The following message with a log is displayed if everything is fine:

Uninstall Python Comparator

To uninstall Python Comparator just choose the radio button Uninstall Python Comparator and execute it. Then confirm your decision to uninstall it.

After uninstallation all created files and directories will be deleted from the Application Server, the preset ID will be deleted too. The following message with a log is displayed after the finish:

Manual changes in the preset

The preset is something like an instruction table for the external module installation and execution (like python) in ABAP. In the list of preset parameters is defined what scripts or compilation should be saved in which directory on which application server, what are inputs, what are expected outputs, and what should be executed when the module is called.

Values that are stored in the preset list are:

  • HOST - variable specifies on what host files should be installed and executed

  • INPUT- name of the file that serves as input during execution

  • INSTALL_PATH - directory for copying installation files from a repository. It may contain placeholders to provide a unique name to not interfere with parallel executions.

  • MAIN - specifies the name of a file in the installation directory that is the main executable for execution

  • OUTPUT - name of the file that will be created during execution and we need results from this file

  • REPOSITORY - defines repository set of files to load into the installation directory

  • RFC_DEST- RFC destination, serves if we want to do execution on another system

  • WORKDIR_CLEANUP - flag (value 'X’) if the working directory should be cleaned up after each execution

  • WORKDIR_NAME - name of the working directory created on each execution if not exists. It may contain placeholders to provide a unique name to not interfere with parallel executions.

  • WORKDIR_PATH - path to a working directory without a directory name. It may contain placeholders to provide a unique name to not interfere with parallel executions.

Placeholders used in directory names and paths are:

<SYSID> - system ID
<CLIENT> - client
<HOST> - host name
<WPPID> - process ID
<PROGRAM> - name of main program
<REPID> - name of current include
<UNAME> - username
<DATE> - date
<TIME> - time
<TIMESTAMPL> - timestamp
<HASH> - generated hash from all above placeholders
<GUID> - guid

When we launch transaction /DVD/EXT_SETUP we can see general UI. We fill in the Preset ID which we want to Edit/Create and confirm by clicking on Manage preset button.

After clicking on Execute we will be taken to the next screen, which is a modifiable table screen.

Adding or deleting rows is done by standard ALV buttons. All rows we add will be saved under the Preset ID that we entered in the first step. On the example screen above we already have defined some of the variables, like which repository set of files to load, what is the main build should be run at the start of execution, what are the names of inputs that python is expecting to have, and lastly, what are the names of files that will be the main output of execution, so we know in what files should we look for results. After we are done Editing/Creating the preset we press the Save button to save the preset.

Using of preset

After installation of the python comparator, the preset is filled with the corresponding setup and we can use it in SNP Validate. In the SNP Validate report test variant click on Advanced Settings, choose Python Report Comparator from the dropdown menu and fill a field with the name Preset ID. Save the variant. SNP Validate will then use Python comparator with execution setup defined in the preset.