Code Inspector Development

Hi all,
        We have been assigned to make our own code inspector  in 4.6 right from scratch , at this point of time we are not able to understand how to proceed.Kindly help with the flow.
Regards
Gaurav Mehrotra

Hi try this
To build a new Code Inspector check, you have to do the following:
·     Create a new global class that extends one of the existing Code Inspector classes
·     Implement the instance constructor
·     Implement the actual check routine in the RUN method
·     Implement method GET_ERROR_TEXT to output message texts
·     Include the new check into the check variant tree
Additionally, if your check has user parameters:
·     Add user parameters as private class attributes to your check class
·     Set flag HAS_ATTRIBUTES in the instance constructor
·     Implement methods GET_ATTRIBUTES and PUT_ATTRIBUTES to get and write away attributes
·     Implement method QUERY_ATTRIBUTES of interface IF_CI_TEST to create the Pop-Up for the parameter input
Hope thsi Helps
Anirban

Similar Messages

  • How to exclude the standard Include programs in Code Inspector?

    I am running code inspector (SCi) on all the development objects using a package. But in certain repository objects standard include programs have been used. I want to exclude the standard include programs while running SCI on the package. What are the ways to achieve this?

    Hi,
    while defining an object set choose:(in the menu)
    Edit - Exclude View Maintenance Function Groups.
    This should exclude most or at least some of the includes from being checked.
    Kind regards,
    Hermann

  • Abap code inspector (tx : SCI) to detect certain patterns

    Hello Experts,
    I want to use SAP Code Inspector to detect common problematic ABAP codes for all developed programs.
    But, I don't know how to make the check variant for detecting follwoing three patterns.
    SELECT * FROM
    SELECT * INTO
    SELECT SINGLE * INTO
    I guess I can use "Search for ABAP tokens" or "Search for ABAP statements paterns". But, It did'nt work because ' * ' represents any sequence of characters in the code inspector.
    Anyone can help me?

    I managed to set up the variant, however found a problem.
    I used "Search ABAP Statement Patterns" under "Search Functs" and set the pattern like followings.
    SELECT + INTO *
    SELECT SINGLE + INTO *
    However following statements were detected.
    SELECT * INTO TABLE IT_DRAW FROM DRAW.
    SELECT MANDT INTO TABLE IT_DRAW FROM DRAW.
    SELECT SINGLE * INTO TABLE IT_DRAW FROM DRAW.
    SELECT SINGLE MANDT INTO TABLE IT_DRAW FROM DRAW.
    It's because + means one ABAP token in the code inspector.
    Is there anyway to find only "SELECT SINGLE *" and "SELECT *" ?

  • ABAP Code Inspector & Security

    All:
    I am currently looking into the Code Inspector that is built into SAP that allows developers to run test/checks on their code related to performance, syntax, and as noted "security". I am trying to track down what exactly the "security" is being checked. I am running tests on my internal SAP systems to see how it acts, but I wanted to get any feedback from the security community on a few things
    1) What "security" checks does the Code Inspector actual check for?
    2) Is there an location with updated documentation from SAP (not dated 2002) which speaks to the security componet, not just mentioned it?
    3) Any useful use-cases within the security community that your organization/clients are using?
    Thanks,
    Matt Urban

    Hi,
    if you display a check variant in SCI there is info linked to each node (icon with I). For example calling C-routine is a security risk. Also dynamic statements are good example of security risk. You need to validate input properly before executing dynamic statement. Not sure about documentation but documentation available in SCI seems OK to me.
    On one project we used SCI to check any custom development (not only security). It helped us to increase quality of custom development. Especially, with less skilled developers.
    Cheers

  • CODE INSPECTOR - help

    hi gurus
    I have a misterious error in the CODE INSPECTOR. My function module was already implemented but code inspector show that it is not implemented. I use netweaver 7.10
    in Syntax Check/Generation ->Test of Environment Determ.
    Function Group /PACkGEWEB/PMGF_CARACTERIS Sub-Object Type FUGR Sub-Object Name /PACkGEWEB/PMGF_CARACTE
    Function module /PACkGEWEB/PMFWL_CARACTERIS must be implemented
    When a click in information it´s showed the message below:
    In Release 7.10, the package check for development projects was changed. One major change is the introduction of
    the concept of the object environment. The object environment is,
    simply put, the list of additional object that are needed
    for the correct usability of the current object. The environment is determined by tools provided for the purpose.
    To enable the determination of the environment for function modules, enhancements are needed for the storage of
    function modules in certain cases. This enhancement takes place automatically when the function modules is saved.
    In addition, you can use the RS_REPAIR_FUNC_WITH_TYPE_POOLS report to implement the conversion for a set of function
    groups (and the function modules contained therein).
    To determine whether a conversion is necessary, use the #syntax check/generation>environment determination test#."
    What do I have to do for remove this "error" in my code inspector ?

    I think its better to avoid delete statements inside the loop
    instead of using delete statement inside the loop
    use
    delete table itab where condition
    or
    if u have to use loop at any cost
    modify internal table with flag=X
    and then delete all records from the itab at one shot using above statement
    Regards
    Vikas C

  • Code Inspector: Enhancement / Adding own rules?

    Hi All,
    I wonder whether there is a way to add own rules to the Code Inspector.
    With own rules I mean checking the coding against our development guidelines, just two examples:
    1) Before SELECT ... FOR ALL ENTRIES it needs to be checked, whether the internal table is not initial.
    2) No direct table update to SAP tables.
    I locked to SCII. I believe it is not a solution to define a new check variant, since I haven't found the possibility there to add own rules (just naming conventions, searching for characters).
    Thus, I wonder whether there is any user-exit, BAdI etc. I could use - or do I really have to write my own parser - which would be a nightmare (multiple meanings of statements (INSERT can change an internal table or database table - depending on the table / variable given); considering global variables, method parameters etc.).
    Any advise is welcome!
    Best regards
    Lars

    Hi Lars,
    Check the below link to customize SCI as per your requirement.
    http://sapignite.com/enhancement-of-code-inspector/
    <removed by moderator>
    Thanks
    SA
    Edited by: Thomas Zloch on Feb 18, 2011 5:44 PM - please do not beg for points, age old thread by the way

  • Code inspector, SQL trace

    Hi all,
    Can anyone help me to analyse the output of sql trace and  code inspector that we do for a program.
    Thanks & regards,
    Saroja.

    SQL trace(ST05) provides the developer with the ability to analyse database select statements. Simply execute ST05 to turn on SQL trace, then execute the statement/program you want to analyse. Now turn off SQL trace using ST05
    and click on list trace to view the details.
    If you notice performance issue, you can perform an SQL trace :
    1 - ST05
    2 - Activate trace
    3 - Run your prog.
    4 - Deactivate trace & display it !
    You'll see accessed tables, with runtime, etc...
    You can also perform traces on other items such as authorisation objects.
    Authorisation trace analysis 1. Open two sessions
    2. Execute transaction ST01 in one of the sessions
    3. Select the authorisation checkbox, note the other traces
    you can perform (SQL, RFC, Table Buffer etc)
    4. Click the 'Trace On' button
    5. Within your other session execte the transaction/report
    you want to trace or get the user in question to do it
    6. Return to the session where you turned the trace on and
    click on 'Trace Off' otherwise it will continue to record
    all athorisation checks
    7. Click on the 'Analysis' button
    8. Enter appropriate data into selection screen such as
    Username, type of trace records (i.e. Authorization check)
    9. Click on the Execute button.
    10. Report displaying trace results will now be displayed
    http://www.sapdevelopment.co.uk/perform/perform_sqltrace.htm
    Code inspector is a static check on your code. This check highlights statements that MAY cause long run times or inconsistant results.
    This is new as of 6.10, it can be installed on 4.6C or 4.6D systems.
    Code inspector includes the checks from the earlier 'Extended program check', (also transaction SLIN). The transation code for 'Code inspector' is SCII.
    Regards,
    Amey
    Message was edited by:
            Amey Potale

  • How to remove the warning messages in CODE INSPECTOR of my report......?

    Hi All,
    I am trying to do the check to my program i.e CODE INSPECTOR. i am seeing the following warning messages below.
    1 warning message
    Program zraj0xxx include  zraj0xxx row 000083 Column0000
    %LINR-VBUP contains a hyphen
    (The Hyphen is used as a dereferencing operator! )
    Note: when i double click on the above message its taking me to the below code of my program.
    DATA %COUNT-VBUP(4) TYPE X.
    DATA %LINR-VBUP(2).
    TABLES VBPA.
    DATA %COUNT-VBPA(4) TYPE X.
    DATA %LINR-VBPA(2).
    2 warning message
    Program zraj0xxx include  zraj0xxx row 000079 Column0000
    Field string VLPMA is not referenced statically in the program
    Note: when i double click on the above message its taking me to the below code of my program.
    SELECTION-SCREEN: BEGIN OF BLOCK PROG
                               WITH FRAME TITLE TEXT-F58.
    TABLES: VLPMA,                                             
                  VLKPA.  
    TABLES VBUP.
    3 warning message
    Program zraj0xxx include  zraj0xxx row 000001 Column0000
    TEXT- GOH from the text pool is not used.
    Note: when i double click on the above message its taking me to the below code of my program.
    REPORT ZHYD0147 LINE-SIZE 255 NO STANDARD PAGE HEADING
       MESSAGE-ID ZB                                        
       LINE-COUNT 065(001).
    Thanks in advance.
    Rajesh.

    Hi Rajesh,
    First  warning message.
    DATA %COUNT-VBUP(4) TYPE X.
    DATA %LINR-VBUP(2).
    TABLES VBPA.
    DATA %COUNT-VBPA(4) TYPE X.
    DATA %LINR-VBPA(2).
    Here you are not supposed to use hyphen but instead use '_'.
    Second warning message
    Program zraj0xxx include zraj0xxx row 000079 Column0000
    Field string VLPMA is not referenced statically in the program
    That means you are not using this VLPMA any where in your program so bettr delete fromt he Top Include.
    Note: when i double click on the above message its taking me to the below code of my program.
    Third warning message
    Program zraj0xxx include zraj0xxx row 000001 Column0000
    TEXT- GOH from the text pool is not used.
    this also means that you are not using this Text elemnt anywhere of your program.So delete this one also.
    Thanks
    Rohini.

  • Customizing the code inspector with check for two executable statements in same line

    Hi Everyone,
    I have a reuirement to customize the code inspector.I need to create a check 'Two executable statements should not be in the same line'.
    While doing so i am facing one problem as in internal table it is capturing the report as word by word with same row number nd different line number.
    If anyone have worked on this before then help me out.
    I am using CL_CI_TEST_SCAN as superclass and making the changes in the run method.
    Regards,
    Khushboo

    In the source code you will have this in comment right, use the "#EC ENHOK.

  • Select query gives error in Code inspector and extended program check

    Hi,
    I have a query .
    SELECT pernr
      FROM pa9100
      INTO TABLE t_nca_tab
      WHERE endda EQ c_date AND
      z_nca_required EQ c_yes.
    This query gives me an error in Code inspector like :
    Large table pa0001: No first field of table index in WHERE  condition
    I have one more query that gives error in extended program check
    SELECT SINGLE stell ename
          INTO (g_stell, g_name)
          FROM pa0001
          WHERE pernr EQ wa_nca_tab-pernr AND
                endda EQ c_date.
    The warning says:
    *In "SELECT SINGLE ...", the WHERE condition for the key field "SEQNR" does not
    test for equality. Therefore, the single record in question may not be unique.*
    Its too urgent.
    Please reply.
    Regards,
    Binay.

    The first field is PERNR .. so if UR not giving pernr it will fetch
    all the data from the said table and between the given dates ..
    Check if this is your requirement ...
    write the select as ...
    where r_pernr is a range ...
    SELECT pernr
    FROM pa9100
    INTO TABLE t_nca_tab
    WHERE pernr in r_pernr  <----
                 endda EQ c_date AND
                 z_nca_required EQ c_yes.
    As UR using select single it's expecting to use all the key
    fields in the where condition ...
    U can ignore this warning message

  • Execute ABAP Code Inspector from Outside of SAP

    Hi all...
    For reporting purpose, I would like to use ABAP Code Inspector (transaction SCI) for generating output as a file, it should call from outside of SAP through RFC function module and generate the list (output) as flat file (or XML), does anyone have been done with similar work like this? I wonder if you could share your experience with me...
    thanks in advance,
    yayan irianto.

    I managed to set up the variant, however found a problem.
    I used "Search ABAP Statement Patterns" under "Search Functs" and set the pattern like followings.
    SELECT + INTO *
    SELECT SINGLE + INTO *
    However following statements were detected.
    SELECT * INTO TABLE IT_DRAW FROM DRAW.
    SELECT MANDT INTO TABLE IT_DRAW FROM DRAW.
    SELECT SINGLE * INTO TABLE IT_DRAW FROM DRAW.
    SELECT SINGLE MANDT INTO TABLE IT_DRAW FROM DRAW.
    It's because + means one ABAP token in the code inspector.
    Is there anyway to find only "SELECT SINGLE *" and "SELECT *" ?

  • Error in code inspector

    Hi Abapers,
    I have done recording for Tcode:pa30 in my report and used call transaction method. because of this i'm getting one error in when i check code inspector.
    error message:
    CA CL_CI_TEST_CRITICAL_STATEMENTS0002
    Critical Statements
    Call of Transaction &1
    &1 = Name of Transaction
    For CALL TRANSACTION there must already be a suitable transaction authorization with the calling transaction.
    Kindly help me out to fix this error.
    Thanks in advance.

    Hi
    Goto SE24
    enter this class CL_CI_TEST_CRITICAL_STATEMENTS
    and see its documentation.
    It shows the all critical errors that are there in code.
    Regards
    Anji

  • Code Inspector Checks

    Hi All,
    I am doing Code Inspector Check for my Program.
    Doing this, I am getting an Error Message Indicating to use TYPE TABLE OF instead of OCCURS 0 statement while declaring Internal Tables.
    Question is, Is there any difference between TYPE TABLE OF and  OCCURS 0 (Performance wise) ?
    Helpful answers will be rewarder by points.
    Thanks & Regards
    Swatantra Pathak

    HI,
    Yes.
    OCCURS 0 is obsolete now.
    When we define internal table with OCCURS 0 it will allocate a default memory of 8KB. In TYPE TABLE/STANDARD TABLE OF it is dynamic i.e as and when we get a record memory will be allocated.
    eg: If ur itab is with OCCURS 0 and u have data of size 2kb then 6KB memory is wasted i.e allocated and not used.
    eg2: If ur itab is with OCCURS 0 , Each record accupies 1 KB. Then after filling 8 records and at the time of getting 9 th records another 8KB is allocated. If u have 9 records in ur table then 7KB is wasted.
    If u r getting allocated with some memory(Resource) and not using means performancewise it is bad.
    Hope above examples are clear.
    Thanks,
    Vinod.

  • Differences between SLIN and Code Inspector

    Hi,
    Can anyone tell me the differences between SLIN and Code Inspector(SCI)..?
    and in which cases we use SLIN and  SCI..?
    and as an ABAPer, which one should we prefer..?
    Thanks,
    Pradeep.

    Hi
    Extended syntax check or SLIN is used to check the program in all aspects for the different syntaxes like
    When you use select single whether you have passed all the key fields or not>
    whether you have maintained the text elements texts or not,
    Have you used UNIT...CURRENCY along with the QTY and AMOUNT fields when displayed using the WRITE statement
    and check for all the varities of statements used in the code, and if there is some problem with that statement/command, it will display as error or warning.
    Check following links -
    slin
    can any one tell me abt SLIN T-CODE
    Reward points if useful
    Regards
    Anji

  • Code Inspector Selection

    Hello,
    I am trying to use the Code Inspector and I would like to check only specific Includes from a Function Group.
    In my Object Set I specified the Function Group I wanted to scan (Tab Classes, Function Groups, etc.) and I specified the Include I wanted to specially verify in the Program Tab.
    It takes a lot of time to run and I get a runtime error. I have about 10 Includes to check so it should not take that long.
    Is there a way to combine 2 different selections in the standard selection fields without considering modifying the source code?
    I've checked the Code Inspector documentation but did not really find something that could help me solve my problem.
    Does anyone have a solution?
    Thanks in advance.
    Sylvain

    Hi guys,
    Thanks for the answers but it's not solving my problem.
    Here is an example of the situation I am going through:
    The SAP standard program SAPLYDEVCM contains a lot of standard Includes and some new Customer specific Includes that were added during the project.
    I want to scan only the Customer Includes Y* and Z*. When I enter the specific Include names the Code Inspector scan all Includes of the main program SAPLYDEVCM and that is not what I want.
    Is it possible to scan only the Customer Specific Includes?
    I hope my example was clear enough.
    Thanks for the help.
    Regards,
    Sylvain

Maybe you are looking for