on 10-21-2005 8:02 AM
<b>Is it good program practice</b> to keep all declaration in an INCLUDE?
If yes <b>what we can we keep in an INCLUDE</b>?
Global declarations??
only global itabs or global variables also.
Thanks,
RAJA
Hi all thanks for replies.
ateeq,
we can maintain includes for subroutine def also?
Please confirm what <b>basic criteria to maintain includes</b>?
what are the <b>other items</b>(other than itabs & variables) we can keep in an include?
ur help will be appreciarted
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
it is a gud practice to segregate data declarations, module definitions, subroutine definitions and the program logic itself....
one advantage you get out of this is that when u r required to make modifications to one of these parts,
you can easily change at one location and do not have to worry about the whole program being affected.
for example, if for some reason the data type of a variable is changed....u need to change only in the data declarations....
...plus the fact that if u club everything together...it gets messy after some time and it will not be very easy for you to locate (say) a particular subroutine or a data variable...
apart from variables and itabs, u can have includes for modules, subroutines, and even you can have whole programs being included in other programs
rgds,
PJ
Kim u opened a new dimension of this thread.
Can u explain me abt the <b>Naming convention</b> to use for includes?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Has been mantined.
If you write a dialog program the naming convention is SAPMZ*****
If you created this in SE80 SAP will automaticly created/propose the following includes :
MZ*****TOP for top include : variables, selection screen
MZ*****F01 for FORM rutines
MZ*****I01 Process before input
MZ*****O01 Process after input
And you can created MZ*****E01 for EVENTS
Here is some text from SAPTechEd CD200 (ABAP Objects Programming Guidelines) by Horst Keller:
Situation:
The source code of a program can be organized with:
Include programs
Macros
Rules
Include programs
Allowed for the source code modularization of exactly one ABAP program
No reuse for type definitions, declarations, or implementations
Must follow naming conventions of the ABAP Workbench
Strongly recommended for large programs (e.g. Top-Include)
Macros
Not allowed
Please Observe that include programs are not meant to be used by servaral program (according to the new guidelines). I guess that SAP has had a lot of problems re-writing old code because include were used (abused) by many programs.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can check any module pool (using SE80) to see what SAP puts into includes.
There can be Data declaration, PBO/PAI includes, selection screens, macros, Subroutines..
Sudha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
It is very much advisable to put global declarations in a include[global internal table,constants,types,variable,workarea].
KIndly reward points by clicking the star on the left of reply,if it helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
its a good programming if u keep the includes..
u can maintain the includes as follows.
suppose ur program is zprog1.
for variable declarations: zprog1_top
for functions: zprog1_fXX.
for pbo:zprog1_oXX.
for pai:zprog1_iXX.
for selection-scr: zprog1_sXX.
its helps u to trace them easily.
hope this answer will helpful. reward points .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Yes it is good practise to keep all the global decleration in an INCLUDE.
You can put all the selection screen in one INCLUDE,and all the function code in one INCLUDE.
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
6 | |
5 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.