This website is not affiliated with, sponsored by, or approved by SAP AG.

standardization SAP programming

Development (ABAP Development WorkBench, ABAP/4 programming)

Moderators: Snowy, thx4allthefish, YuriT, Gothmog

standardization SAP programming

Postby jaycee » Mon Nov 11, 2002 12:21 am

hi,

i wld like to know what are the things I need to set for standardization ie program name, v_name for variable name, s_fld1 for select options all that kind sort of things?

what are the things i need to consider in doing naming conventions? in line with progmming? any tips is highly appreciated.


Thanks a lot!
jaycee
 

Postby aussie fatboy » Mon Nov 11, 2002 12:42 am

Lots of things can be included in standards.
It somewhat depends on your system size, number of users, how much development etc. as to how detailed you want to get.

Some of the common (prgramming) standards I have used at various sites:

P_ for parameters
s_ for select options
gv_ for global variables
lv_ for local variables
pv_ for passed variables in forms
gt_ for global itabs
lt_ for local itabs
gs_ for global structures
ls_ for local structures
co_ for constants

Program names need to be something that you and your company are comfortable with. Many sites used to do something like
Z - custome prefix
FI - module
R - report
nnnn

but now that names can be longer, it is really down to your own definitions and how managable the naming needs to be.

Some things I DON'T agree with:
Naming forms F_
I don't see any point to it. It is always apparent in code when a form is being called.
Using pa_ or so_ for parameters and select options. It wastes a char in my opinion.

I'm sure there is a lot more, but this gives you a start at least.
aussie fatboy
 
Posts: 827
Joined: Sun Oct 20, 2002 11:34 pm
Location: Melbourne, Australia

Docs.zip

Postby Rich » Mon Nov 11, 2002 4:04 am

I have some documentation and code aimed at standardising ABAP. The zip contains a programming specification, and a series of include files for standard reporting, BDC programming etc.

E-mail me if you would like an uptodate copy. (Docs.zip in the repository is about 4 years old now).

Rich
Rich
 
Posts: 7112
Joined: Thu Oct 31, 2002 4:47 pm
Location: Liverpool

Postby rudster » Wed Jun 01, 2005 6:27 am

Hi

I have always used descriptive naming standards and prefixes, but never distinguished between Local and Global variables. Cracking idea can't I believe it's taken me over 2 years to discover this!

I've been using an older method...
Code: Select all
w_ = local/global field or structure
i_ = internal table


... but I just stumbled across this post and changed the interface I am currently building!

Oh, don't forget k_ for constants!

Many thanks...

JR
8)
rudster
 
Posts: 133
Joined: Thu Oct 24, 2002 7:25 am
Location: UK

Postby RosieBrent » Wed Jun 01, 2005 6:48 am

I always use CON_ for constants, TAB_ for internal tables, W_ for global program variables and L_ for local program variables.

:shrug: Guess it's just a case of whatever works and what you are used to.
Kind Regards

Rosie Brent

Please remember to search the forum and check the FAQ before posting questions, thank you.

Tuly Idiot most of the time, part-time Guru Image
RosieBrent
 
Posts: 6197
Joined: Mon Oct 21, 2002 3:04 am
Location: Darlington

Postby Baerbel » Wed Jun 01, 2005 7:29 am

We have a set of coding standards which are checked eg. during code-reviews. Naming standards are similar to what was already stated
Code: Select all
I_ = For internal tables
C_ = For Constants.
P_ = For Parameters.
R_ = For Ranges.
S_ = For Select-options.
T_ = For types.
V_ = For local & global Variables; Field Strings.
W_ = For workflow container elements.

Personally, I think that every company should have coding standards to make program maintenance easier for everybody. It sure helps if "all" the programs have the same look and feel!

Cheers
Baerbel
Baerbel
 
Posts: 73
Joined: Mon Oct 21, 2002 2:46 am
Location: Fellbach, Germany


Return to ABAP

Who is online

Users browsing this forum: Google Adsense [Bot] and 10 guests





loading...


This website is not affiliated with, sponsored by, or approved by SAP AG.