Skip to Content
author's profile photo Former Member
Former Member

Declaration in include

<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

Add a comment
10|10000 characters needed characters exceeded

Related questions

7 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 21, 2005 at 07:20 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      raja,

      u can maintain for subroutines also. its a good practice. in my earlier mail i had written briefly. u can use the zprog1_fxx for subrotines not for func's.

      rewards points and close the thread if ur satisfied with replies.

      Ateeq

  • author's profile photo Former Member
    Former Member
    Posted on Oct 21, 2005 at 07:19 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 21, 2005 at 08:17 AM

    Kim u opened a new dimension of this thread.

    Can u explain me abt the <b>Naming convention</b> to use for includes?

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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

  • author's profile photo Former Member
    Former Member
    Posted on Oct 21, 2005 at 07:05 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 21, 2005 at 07:07 AM

    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 .

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 21, 2005 at 07:11 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 21, 2005 at 08:13 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.