Contents:


Resolved deliveries - automated audit before release of a transport order

A transport order for a Change Request/Task in SAP Change Transport System (CTS) could be released using the transaction SE10 (among others).

SAP provides an enhancement to hook the release action with custom code to check the contents of the transport order. You may register an implementation for it, and activate it.


The implementation may leverage Kiuwan audits for checking that the source code in the transport order to be released satisfies quality / security constraints.


The Kiuwan Local Analyzer should be deployed in the SAP system, with the ZKW_KLA_AGENT OS command registered.

See Install programs for details.

 This uses the Classic BAdI CTS_REQUEST_CHECK

SAPEX provides an implementation for it that leverages Kiuwan audits to check that the source code in the transport order to be released satisfies quality / security constraints.

Such an implementation will:

  1. Extract source code for objects in the transport order. 
  2. Run the analysis with Kiuwan Local Analyzer. 
  3. Check that the audit checkpoints passes. 
  4. Cancel the release when the audit does not pass.

To use it, you must follow the two steps: 

  1. Registration of SAPEX Implementation
  2. Activation of SAPEX Implementation

Registration of SAPEX Implementation 

If you have installed SAPEX as a Transport Order, you can omit this step (because it was already done when importing the Transport Order) and go directly to the activation. 

A candidate implementation for the CTS_REQUEST_CHECK is provided in the ZCL_IM_KW_BADI_REQ_CHECK.

For registration,

  1. Open transaction SE19.
  2. In the Create implementation section, choose under Classic BAdI the CTS_REQUEST_CHECK. 



  3. Click Create.
  4. Give ZKW_BADI_REQ_CHECK an implementation name (so the generated implementation class will be named ZCL_IM_KW_BADI_REQ_CHECK)



  5. Replace the source with the one in the provided ZCL_IM_KW_BADI_REQ_CHECK.abap codes.
  6. Click save.

Activation of SAPEX Implementation 

  1. Open transaction SE19.
  2. Choose Edit Implementation and Classic BAdI Implementation, specifying ZKW_BADI_REQ_CHECK.



  3. Click Change



  4. Click the Activate icon

Automatic analysis before releasing a Change Request 

Once activated, the automatic Kiuwan analysis is triggered as soon as a CR is to be released. The process can be depicted as follows:

  1. Source code associated to CR is downloaded
    1. Download directory is <DIR_HOME>/sape4k/code/<CR_ID> (you can use the AL11 transaction to inspect the DIR_HOME value)
      1. in linux,typically  /usr/sap/<SAP_SID>/D<Instance_Number>/work
      2. in windows, change / by <drive>:\
    2. Under <DIR_HOME>/sape4k/code/<CR_ID>, there will be a directory for every SAP Package involved in the CR
    3. Important: Only Active objects will be exported and analyzed

  2. For every SAP package contained into the Request/Task, a Kiuwan analysis is executed:
    1. using SAP package name as Kiuwan application name (-n <SAP_package_name>, see Kiuwan Local Analyzer CLI - Command Line Interface)
    2. using <DIR_HOME>/sape4k/code/<CR_ID>/<SAP_Package_Name> as source dir ( -s <DIR_HOME>/sape4k/code/<CR_ID>/<SAP_Package_Name>)
    3. using CR description plus SAP package as a Kiuwan analysis lable (-l <CR desciption-Analysis label>)
    4. the analysis is executed as a Partial Delivery (-as partialDelivery
    5. the analysis will use Request/Task ID as Kiuwan Change Request name (-cr <CR_ID>)
    6. the delivery will be marked in Kiuwan as Resolved (-crs resolved)
    7. the analysis will wait for the results (-wr) from the Kiuwan cloud (i.e. it will be blocked until the cloud analysis finishes) 

  3. The process will analyze every SAP package unless an unsuccessful return code is received (ret code != 0
    1. In case of an unsuccessful analysis (ret code != 0), the release does not proceed and a window is displayed with the message
    2. Bear in mind that a special case is when the Audit associated with the analysis of a package fails. This condition will stop the release process.