You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

 

 

SAPEX Installation

 

Local vs Remote Kiuwan Analysis

 

To analyze ABAP code in Kiuwan, source code and information from SAP system need to be exported previously to be analyzed by Kiuwan.

Once source code is exported, Kiuwan lets you to implement two different approaches on the location where the ABAP code is analyzed.

  • To execute Kiuwan analyses within the SAP server (local), or
  • To execute analyses from an external server (remote)

Depending on your approach, installation takes different steps

We will use terms "local" and "remote" for specific installation steps, and "both" for common (mandatory) steps.

 

 

SAPEX Installation Files

SAPEX installation files are contained in sapex_abap_code.zip, located at $(AGENT_HOME/resources/abap directory of your Kiuwan Local Analyzer installation

Please visit Installation and Network Configuration for further help on Kiuwan Local Analyzer.

 

The following table lists contents of sapex_abap_code.zip

FileBehaviourNotes
Programs:  
ZKW_SAPEX_CODEExport source codeExports to local or remote directory
ZKW_SAPEX_METADATAExport SAP informationExports to local or remote directory
ZKW_ANALYSISAnalyzes source code (after optional previous export) in SAP system 
RFC-enabled Function modules:  
ZKW_SAPEX_CODE_RPCExport source codeNeeded by sapexCode.xmlremote script
ZKW_SAPEX_METADATA_RPCExport metadataNeeded by sapexMetadata.xmlremote script
ZKW_SAPEX_LOADFILE_RPCFor downloading an exported fileNeeded by sapexCode.xmlremote script
ZKW_SAPEX_RMDIR_RPCFor removing directories where source code is exported 
ZKW_SAPEX_RMDIR_CHECKSecurity check for RMDIR calls 
Classes:  
ZKW_CL_*, ZKW_CX_*Support classesAdd them using class builder or Eclipse ADT
ZCL_IM_KW_BADI_REQ_CHECKImplementation BAdI for CTS_REQUEST_CHECKSample BAdI for automated audit before release of a transport request
  • Note 1: It is recommended to create a package named ZKW_SAPEX to hold all entities created for SAPEX.

  • Note 2: You may use ABAP Workbench / ABAP Editor or Eclipse-based ABAP Development Tool for creating the SAPEX elements from the provided code.

  • Note 3: Remember to activate all ABAP elements installed, for enabling execution.

 

Common steps for Local and Remote scenarios

1.Install support classes 

Using the Class Builder (transaction SE24) in source code mode, create and activate all the ZKW_CL_* classes, and the ZKW_CX_* exception classes.


2.Install programs

Using the ABAP Editor (transaction SE38), create the ZKW_SAPEX_CODE and ZKW_SAPEX_METADATA.

In case you decide to use the local approach:

 

3.Create OS commands

Using transaction SM69, create the following OS commands:

  • ZWK_MKDIR
  • ZWK_RMDIR

 

ZWK_MKDIR

Used for creating directories in the SAP system

  • mkdir -p <dir> for Unix
  • mkdir <dir> for Windows

 

Note: The command configured must create all intermediate directories.

 

ZKW_RMDIR

Used for deleting a directory and all its contents in the SAP system

  • rm -rf <dir> for Unix
  • rmdir /s /q <dir> for Windows.

 

For ensuring that a proper rmdir command is selected, register the ZKW_SAPEX_RMDIR_CHECK for avoiding 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.

 

ZKW_RMDIR performs a recursive deletion!

To avoid unintended deletions, be sure the target directory does not contain directories out of the SAPEX code/metadata directories.


 


ZKW_KLA_AGENT (optional)

Used for launching the Kiuwan Local Analyzer script.

Optional, if the analyzer is to be run within the SAP system (either from the ZKW_SAPEX_CODE program or from the CTS_REQUEST_CHECK BAdI implementation).

First, install Kiuwan Local Agent in the target SAP system.

It is recommended to use a <DIR_HOME>/sape4k/kla directory for the Kiuwan Local Analyzer.

 

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.

 

The result of creating the commands should be similar to the following:

 

 

Configure remote scripts (optional)

Install RFC-enabled function modules

For running the SAPEX scripts from a remote host (where KLA is deployed), the ZKW_SAPEX_*_RFC function modules should be created using Function Builder (transaction SE37).

It is recommended to create a KWN_SAPEX_FG function group, and include the LZKW_SAPEX_FGDNN in the function group (contains classes used by RFC functions).

Make sure that all functions terminated with _RFC are marked as RFC-enabled, as they will be called remotely from the SAPEX scripts.

 

Install SAP JCo Connector library

The remote scripts use SAP JCo Connector.

This needs to be installed in the machine containing the SAPEX remote scripts provided with Kiuwan Local Analyzer.

 You may 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.

 

Full details for installing SAP JCo library

 

  • Windows: There are different distribution packages for various JRE versions and hardware processors available:

 

fileplatform
sapjco3-ntintel-3.0.8.zipfor 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.zipfor a 64-bit JRE running on a 64-bit INTEL Itanium processor
sapjco3-ntamd64-3.0.8.zipfor 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.

 

  • Linux: There are different distribution packages for various JRE versions and hardware processors available:

 

fileplatform
sapjco3-linuxintel-3.0.8.tgzfor a 32-bit JRE running on a 32- or 64-bit AMD or INTEL x86 processor
sapjco3-linuxia64-3.0.8.tgzfor a 64-bit JRE running on a 64-bit INTEL Itanium processor
sapjco3-linuxx86_64-3.0.8.tgzfor a 64-bit JRE running on a 64-bit AMD or INTEL x86 processor
sapjco3-linuxppc64-3.0.8.tgzfor a 64-bit JRE running on a 64-bit PowerPC processor
sapjco3-linuxs390x-3.0.8.tgzfor 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

 

Configure SAPEX scripts in Kiuwan Local Analyzer

The last step is to configure the scripts used for the scripts in KLA for remote extraction.

As an alternative, you may use the extractor programs provided in 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 extract operations will be performed manually, remote extraction scripts are not needed.

 

5.1. Connection parameters: sapex.properties

 

sapex.properties
# ---------------------------------------------
# Configuration for SAP/R3 ABAP code extraction
# ---------------------------------------------

# Location where the SAP/R3 JCO (Java COnnector) library is placed.
# Make sure that the native library (sapjco3.dll or libsapjco3.so) is placed in the PATH of the account running SAP Connector.
sap.connector=${env.JKQA_HOME}/lib

# Host with SAP/R3 repository
host=HOSTNAME_OR_IP_ADDRESS

# SAP System number
sysnr=00

# SAP Client number
client=000

# SAP/R3 username
user=USERNAME_HERE

# SAP/R3 password to use for code extraction
pass=PASSWORD_HERE

 

5.2. Code extractor parameters: sapexCode.properties

 

sapexCode.properties
# --------------------------------------------------
# Kiuwan Extractor for SAP (sapexCode) configuration
# --------------------------------------------------

# Local directory where exported code will be saved
dir.code=${basedir}

# Name or pattern for the id of the request/task transport order to export.
transportPattern=

# if true, export sub request/task transport orders for matching request/tasks.
subTransports=false

# Name or pattern for the package to export.
packagePattern=

# if true, export sub packages for matching packages.
subPackages=false

# if true, export matching programs
programs=true

# Pattern for the programs to export. If empty, no filter on programs.
programPattern=

# If true, export matching functions.
functions=true

# Pattern for the function modules to export. If empty, no filter on function modules.
functionPattern=

# Pattern for the function groups to export. If empty, no filter on function groups.
fgroupPattern=

# If true, export matching classes
classes=true

# Pattern for the classes to export. If empty, no filter on classes.
classPattern=

# If true, export matching web dynpro components
webdynpros=true

# Pattern for the web dynpro components to export. If empty, no filter on WD components
webdynproPattern=

# Language to use for object titles and locale-specific content. Use E for english.
language=E

# If true, dialog modules (for dynpro screens) will be exported.
screens=true

# If true, texts (for text-pools in code objects) will be exported.
texts=false

# if true, only custom (Z* or Y*) objects will be exported. If false, no filter for custom objects.
customObjectsOnly=true

# Custom namespace to use for exporting objects (for example, /myorg/ ). If none provided, no filter with custom namepsace.
customNamespace=

 

5.2. Metadata extractor parameters: sapexMetadata.properties

 
sapexMetadata.properties
# --------------------------------------------------
# Kiuwan Extractor for SAP (sapexMetadata) configuration
# --------------------------------------------------

# Local directory where exported metadata files will be saved.
dir.metadata=${basedir}

# If true, extract metadata for transaction codes
tcodes=true

# If true, extract metadata for authorization objects
authObjects=true

# If true, extract metadata for messages
messages=true

# If true, extract metadata for memory parameters
memoryParams=true

# If true, extract metadata for executable programs/reports
programs=true

# If true, extract metadata for function modules
functions=true

# If true, extract metadata for parameters in custom function modules
funcParams=true

# If true, extract metadata for dynpros (dialog modules)
dynpros=true

# If true, extract metadata for web dynpros
webDynpros=true

# If true, extract metadata for database tables properties
tableProperties=true

# If true, extract metadata for indexes on database tables
tableIndexes=true

# If true, extract metadata for fields in custom tables
tableFields=true

# If true, extract metadata for table authorization objects
tableAuthObjects=true

# If true, extract metadata for append structures for DB tables
tableAppendStructs=true

# If true, extract size (number of rows) for database tables matching tablePattern
tableSizes=true

# The pattern for table names whose size will be analyzed when tableSizes=true
tablePattern=Z*

 

Test SAPEX installation

Once completed, you may test the installation:

 

 

 

  • No labels