Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Code inspector - check naming

Former Member
0 Kudos

Hello,

i'm using code inspector (trx SCI) for controlling all custom program and I have two questions:

Why in statistic section, in some cases, several objects are classified "not checked" ? There are pre-conditions that have to be satisfied before the inspection was performed ?

How can we check standard naming conventions for internal table (Example TB_INT) in custom object ?

Thanks

Regards

P. Carriero

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Pasquale,

I am not sure whether SCI has such options or not.

But you can definitely enhance your code inspector for checking Auth Group or hardcoding or anything you like..

Check the following article link for [how to enhance code inspector|http://sapignite.com/2010/05/enhancement-of-code-inspector/]

Thanks

Ajay

7 REPLIES 7

Former Member
0 Kudos

Moderator message - Welcome to SCN. Please post in the correct forum (I'm moving it). Also, Please read and and [Asking Good Questions in the Forums to get Good Answers|/people/rob.burbank/blog/2010/05/12/asking-good-questions-in-the-forums-to-get-good-answers] before posting again. Rob

Former Member
0 Kudos

>

> How can we check standard naming conventions for internal table (Example TB_INT) in custom object ?

I do not think it is possible to do this specifically for tables. However, under Programming Conventions --> Naming Conventions --> Program Global --> Data, you can enter all allowed namings for the data types. This is not specific for Tables and variables, but they are all in there as a group...

This would be something like (For allowed data conventions):

TA_* (for Standard tables)

TS_* (for Sorted tables)

TH_* (for Hashed tables)

RA_* (for Ranges)

WA_* (Workarea)

ST_* (Structure)

RF_* (Reference)

etc.

The code inspector will return an error if the naming used is not in this list, it is up to the developer and quality assurance to make sure that the correct naming is used for a specific data type.

0 Kudos

Thanks Edwin but under Programming conventions --> Extended Naming Conventions for Programs I can specify the name conventions for structure, internal table, ecc....

However I don't understand how this work?

During my test, although this field are specified, trx SCI doesn't display any message.

Thanks a lot

P. Carriero

0 Kudos

Oops, okay that changes a lot... And I am in the dark too. It looks as if th Extended Naming Conventions use "Regular Expressions" (RegEx).

That is not something I know a lot about. But maybe a search on Regular Expressions will help you.

Here is a link to a website: [http://www.regular-expressions.info/|http://www.regular-expressions.info/]

Good luck!

Edwin.

PS. Yep. Definately RegEx... See also [http://www.regextester.com/|http://www.regextester.com/]

0 Kudos

Hello Pascale,

The default setting of this Code Inspector test is that local structures should start with "LS_".

There are two relevant sections:

General Procedure(Local)

DATA "(/.*/)?L\[:type:\]_"

Type Prefixes

Structure "S"

The term "(/./)?L\[:type:\]_" encodes can start with a name space "(/./)?" followed by a "L" and a type encoding "\[:type:\]" and an underscore "\_". As the type prefix for strutures is "S" the overall requirement equals to starts with "LS_".

The following form routine can be copied into any report and should cause a warning for "WA_NOT_CORRECT".


form sample_Systems_Hungarian.
  data:
    ls_Correct     type tadir,
    wa_Not_Correct type tadir.
endform.

Hope this helps

Klaus

PS: To my personal opinion system hungarian is a relict of former times. The book "CLEAN CODE" gives lots of inspiration on modern naming scemes.

0 Kudos

Great,very helpful link.. I didn't know it!

I'll try and let you know..

Thanks

Former Member
0 Kudos

Hi Pasquale,

I am not sure whether SCI has such options or not.

But you can definitely enhance your code inspector for checking Auth Group or hardcoding or anything you like..

Check the following article link for [how to enhance code inspector|http://sapignite.com/2010/05/enhancement-of-code-inspector/]

Thanks

Ajay