Quantcast
Channel: ABAP Development
Viewing all articles
Browse latest Browse all 948

Unicode check with Code Inspector

$
0
0

Some companies still run non unicode SAP systems. if you plan to convert your system to unicode, you can run UCCHECK regularly on your system, or add the unicode check to the code inspector framework and perform the check e.g. during release of transports or create a list with links to the source code using code inspector / ATC.

 

The attached document shows how to create an own CI test class performing the unicode check.

 

Create checker classes

Base syntax check class

Copy class CL_CI_SOURCE_SYNTAX_CHECK to your own namespace:

1.png

Set Unicode flag to all the report sources before executing the check in the constructor method.

Either fixed:

2.png

Or – optional - by a parameter:

3.png

4.png

 

Code inspector class

Copy class CI_TEST_SYNTAX_CHECK to your namespace.

Adapt copied CI class:

  1. Replace the class names in your new class.
    1. In the local friend definition of the unit test with your new created class.

      5.png
    2. In the class constructor of the test class

      6.png
    3. In attribute C_MY_NAME:
      7.png
    4. In method IF_CI_TEST~QUERY_ATTRIBUTES

      8.png
    5. In attribute REF_CHECK

      9.png
    6. Optional: modifications for Unicode check as using a parameter.
      1. When using Unicode parameter in constructor of base syntax checker class, you can pass the parameter in the GET method:
        Fixed

        10.png
      2. Or create a parameter in your CI class for the UCCHECK
        1. Create attribute

          11.png
        2. Adapt IF_CI_TEST~QUERY_ATTRIBUTES to provide parameter

          12.png

 

 

 

  1. Adapt data transfer methods
    1. PUT_ATTRIBUTES
      13.png
    2. GET_ATTRIBUTES
      14.png
  2. Change the description of the test in the constructor, to find it afterwards in the CI tree.
    (Length of the text symbol as to be adapted)

15.png

Prepare code inspector

Activate your test (class)

16.png

17.png

Create public check variant

18.png

Activate your check and set attribute for code inspector

19.png

 

Example Use check in AT

The created check variant can be used in various scenarios e.g. during transport release.

 

Prepare ATC

Set check variant & activate inform on errors

  20.png

With this settings, the UC check is performed on release.

21.png

22.png


Viewing all articles
Browse latest Browse all 948

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>