Contents: Related pages: |
To analyze ABAP code with the Kiuwan Solutions, the source code and information from the SAP system need to be exported before they can be analyzed.
Once the source code is exported, the Kiuwan Solutions let you implement two different approaches on the location where the ABAP code is analyzed.
Depending on your approach, the installation takes different steps. We will use the terms local and remote for specific installation steps, and both for common (mandatory) steps. |
SAPEX installation files are contained in Please visit Kiuwan Local Analyzer for further help on Kiuwan Local Analyzer. |
The following table lists contents of sapex_abap_code.zip
File | Behaviour | Notes |
---|---|---|
Programs: | ||
ZKW_SAPEX_CODE | Export source code | Exports to local or remote directory |
ZKW_SAPEX_METADATA | Export SAP information | Exports to local or remote directory |
ZKW_ANALYSIS | Analyzes source code (after optional previous export) in SAP system | |
RFC-enabled Function modules: | ||
ZKW_SAPEX_CODE_RPC | Export source code | Needed by sapexCode.xml remote script |
ZKW_SAPEX_METADATA_RPC | Export metadata | Needed by sapexMetadata.xml remote script |
ZKW_SAPEX_LOADFILE_RPC | For downloading an exported file | Needed by sapexCode.xml remote script |
ZKW_SAPEX_RMDIR_RPC | For removing directories where source code is exported | |
ZKW_SAPEX_RMDIR_CHECK | Security check for RMDIR calls | |
Classes: | ||
ZKW_CL_*, ZKW_CX_* | Support classes | Add them using class builder or Eclipse ADT |
ZCL_IM_KW_BADI_REQ_CHECK | Implementation BAdI for CTS_REQUEST_CHECK | Sample BAdI for automated audit before release of a transport request |
|
It is recommended to create a package named ZKW_SAPEX
to hold all entities created for SAPEX.
To create the ZKW_SAPEX
package you can use the transaction SE80 as follows:
After creating the ZKW_SAPEX package, you can follow the next steps.
Using the Class Builder (transaction SE24) in source code mode, create and activate all the ZKW_CL_*
classes, and the ZKW_CX_*
exception classes.
Toogle to Source Code - Based Class Builder and paste the content of the source file (substituting any previous content).
Switch back to Form-Based Class Builder to see the complete class.
Do not forget to Activate every class after creation. |
After importing all the classes you will see them under the ZKW_SAPEX package:
Using the ABAP Editor (transaction SE38), create the ZKW_SAPEX_CODE
and ZKW_SAPEX_METADATA
programs
Open the Source view.
and paste the source code provided by SAPEX.
After saving, you will see all the SAPEX objects.
Do not forget to activate all the created objects.
Using transaction SM69, create the following OS commands:
Used for creating directories in the SAP system:
mkdir -p ?
for Unixcmd /C mkdir ?
for Windows
Note: The command configured must create all intermediate directories.
Used for deleting a directory and all its contents in the SAP system:
rm -rf ?
for Unixcmd /C rmdir /s /q ?
for Windows.To ensure that a proper rmdir command is selected, register the ZKW_SAPEX_RMDIR_CHECK to avoid security issues. This ensures that the command is one of the allowed RMDIR commands, and that the target directory is either sapex code or metadata directories, or a raw subdir under these directories.
|
The result of creating the commands should be similar to the following:
If you decide to use the local approach:
ZKW_ANALYSIS
programIt is recommended to use a <DIR_HOME>/sape4k/kla
directory for the Kiuwan Local Analyzer.
Used for launching the Kiuwan Local Analyzer script.
This OS command will be used by ZKW_ANALYSIS
program and CTS_REQUEST_CHECK
BAdI implementation.
Use :
<PATH_TO_KLA>/bin/agent.sh
(Unix), or <PATH_TO_KLA>\bin\agent.cmd
(Windows) as the name of the Operating System Command parameter in transaction SM69.
To run the SAPEX scripts from a remote host (where KLA is deployed), the ZKW_SAPEX_*_RPC
function modules should be created using Function Builder (transaction SE37).
To create the ZKW_SAPEX_FG
function group you can use transaction SE80 as follows:
Before creating the function modules, it is recommended to create the ZKW_SAPEX_FG
function group.
After creating the ZKW_SAPEX_FG function group, create a Function Module for every ZKW_SAPEX_*_RPC function modules included in $(AGENT_HOME)/resources/abap/.../ZKW_SAPEX_FG/functions
Use Function Builder (transaction SE37) as follows:
After created, go to the Source Code tab and paste the content of the associated file.
Make sure that all functions terminated with _RPC
are marked as RFC-enabled, as they will be called remotely from the SAPEX scripts.
Click Save.
Remote scripts use SAP JCo Connector to remotely connect to the SAP server.
SAP JCO Connector must be installed in the remote containing the SAPEX remote scripts that will execute the Kiuwan Local Analyzer.
Download SAP JCo from SAP Service Marketplace Connectors - you need service-marketplace access for it.
Once you have downloaded the corresponding package for your operating system, install it.
file | platform |
---|---|
sapjco3-ntintel-3.0.8.zip | for a 32-bit JRE running on a 32- or 64-bit AMD or INTEL x86 or a 64-bit INTEL Itanium processor |
sapjco3-ntia64-3.0.8.zip | for a 64-bit JRE running on a 64-bit INTEL Itanium processor |
sapjco3-ntamd64-3.0.8.zip | for a 64-bit JRE running on a 64-bit AMD or INTEL x86 processor |
Before installing JCo, please install the latest Microsoft Visual Studio 2005 C/C++ runtime libraries, as described in note 684106.
To install JCo for Windows unzip the appropriate distribution package into an arbitrary directory sapjco3-install-path
.
Do not copy the sapjco3.dll in the WINDIR\system32
nor into the WINDIR\SysWOW64
directory. This will break the operability of other JCo versions that are already installed on the same system. Furthermore, you would risk that the current installation also would not work anymore if the sapjco3.dll gets replaced in the respective Windows system directory in the future.
file | platform |
---|---|
sapjco3-linuxintel-3.0.8.tgz | for a 32-bit JRE running on a 32- or 64-bit AMD or INTEL x86 processor |
sapjco3-linuxia64-3.0.8.tgz | for a 64-bit JRE running on a 64-bit INTEL Itanium processor |
sapjco3-linuxx86_64-3.0.8.tgz | for a 64-bit JRE running on a 64-bit AMD or INTEL x86 processor |
sapjco3-linuxppc64-3.0.8.tgz | for a 64-bit JRE running on a 64-bit PowerPC processor |
sapjco3-linuxs390x-3.0.8.tgz | for a 64-bit JRE running on a 64-bit IBM eServer zSeries processor |
To install JCo for Linux, copy the appropriate distribution package into an arbitrary directory sapjco3-install-path
. Next, change to the installation directory:
cd sapjco3-install-path
and extract the archive:
tar zxvf sapjco3-linux*3.0.8.tgz
The last step is to configure the scripts used for the scripts in KLA for remote extraction.
Scripts for extracting source code (
You can find configuration files at $(AGENT_HOME)/conf/sapex directory of your Kiuwan Local Analyzer installation directory. |
As an alternative, you may use the extractor programs provided in the SAP system, and then either transfer the results to the system where the KLA is deployed, or directly run the KLA in the target SAP system (in particular, when an automated audit should be performed before releasing a transport request/task).
Please note that the extraction programs for code / metadata allows you to specify a local directory (in the user host) where exported contents will be saved.
If the extract operations will be performed manually, remote extraction scripts are not needed.
Please visit SAP Extractor- Remote use - Appendix Configuration Files for further information.
Once completed, you may test the installation:
If the remote sapex was configured, run command line scripts to ensure that the connection properties and extraction filters work.