‎2010 May 26 4:12 PM
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
‎2010 May 28 9:57 AM
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
‎2010 May 26 7:10 PM
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
‎2010 May 27 9:58 AM
>
> 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.
‎2010 May 27 3:04 PM
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
‎2010 May 28 8:22 AM
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/]
‎2010 May 28 9:35 AM
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.
‎2010 May 28 1:26 PM
Great,very helpful link.. I didn't know it!
I'll try and let you know..
Thanks
‎2010 May 28 9:57 AM
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