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: 

What is an "Include TOP" used for?

Former Member
0 Kudos

I would like if it is advisable to create reports with include TOP. So far, I've seen them used in modulpools.

I think they are used to define all global variables, but I'm not sure.

Thanks.

1 ACCEPTED SOLUTION

VXLozano
Active Contributor
0 Kudos

The "Include TOP" are used to declare global variables, constants, define types and so.

They are not special includes, just named "TOP" ones to make them easy to locate.

I use them when I need to make my report smaller, keeping those declarations out of the main program to make more readable my coding. I use them also when I have two or more programs with the same constants, variables, to make things easy:

- to maintain: if I must change both programs, I just need to update one include

- for naming conventions: if I must use same variables, my programs will be easy to read/understand globally if I use the same names in all them.

2 REPLIES 2

VXLozano
Active Contributor
0 Kudos

The "Include TOP" are used to declare global variables, constants, define types and so.

They are not special includes, just named "TOP" ones to make them easy to locate.

I use them when I need to make my report smaller, keeping those declarations out of the main program to make more readable my coding. I use them also when I have two or more programs with the same constants, variables, to make things easy:

- to maintain: if I must change both programs, I just need to update one include

- for naming conventions: if I must use same variables, my programs will be easy to read/understand globally if I use the same names in all them.

Former Member
0 Kudos

Hi,

You are right : TOP includes are made for global declarations.

For big programs it is advisable to declare global variables in a separate include because in the future if you make changes in your declarations you'll have to transport this include only and not the entire code.

For less large programs this is not necessary.

Regards,

Nicolas.