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: 

Includes in global Class

Former Member
0 Kudos
1,556

Hi all,

I have a global class (created in SE24 - Class builder) and need to use constants and types in its methods, that are defined in an include.

In functional development we just put a "INCLUDE includename." in the function group top-include.

Where can I put that include in the global class?

I tried the "local types" source file, but it doesnt accept the constant definitions inside my include.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
216

Hi,

Create a type pool with your types and constants and enter its name in the property screen of the class.

Svetlin

4 REPLIES 4

Former Member
0 Kudos
217

Hi,

Create a type pool with your types and constants and enter its name in the property screen of the class.

Svetlin

Former Member
0 Kudos
216

Hello,

you can add an include to a class.

Press button (Local) Types (CTRL+F5).

Christian

216

As I wrote in my original post, I tried that, but it failed due to constants being defined in the include I want to add.

Former Member
0 Kudos
216

hi, Frank Besler

If you want to add global (constant)value and type definantion, you can add them in the LXXXXTOP file, the XXXX is the function group name.

if you don't want all of the defination added only one file, you can create a file, named LXXXXFYYY, XXXX is still function group, YYY is the random string you set.

and add the 'include LXXXXFYYY' into the SAPLXXXX. (XXXX is still function group name). SAPLXXXX is the main program for the function group, you can find its name in the 'Attributes' tab 'Program name' fields in se37.

click the SAPLXXXX, you can see a example like this:


*******************************************************************
*   System-defined Include-files.                                 *
*******************************************************************
  INCLUDE LATSVTOP.      " Global Data
  INCLUDE LATSVUXX.      " Function Modules

*******************************************************************
*   User-defined Include-files (if necessary).                    *
*******************************************************************
* INCLUDE LATSVF...      " Subprograms
* INCLUDE LATSVO...      " PBO-Modules
* INCLUDE LATSVI...      " PAI-Modules

* add your include file here
include LATSVF01.

Please aware the your include file name can't be set random, you must follow the rule, otherwise the compile will failed.