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: 

using variables defined in an include or another program

Former Member
0 Kudos

Hi,

i'm trying to use some declarations in my program which are defined in an include or another program.

1. I need to create a class whose definition is in an include

2. i need to declare a variable like this

v_temp TYPE l_temp , l_temp is a structure defined in an include .

I'm trying to use the declarations in another program or an include in my program. however, i dont want to use 'include' statement

your help would be appreciated.

Thanks,

Kranthi.

4 REPLIES 4

former_member181962
Active Contributor
0 Kudos

Hi Kranthi,

You can declare your variables in an include and use them in your program by using the statement.

include zinclude.

write:/ v_temp. "v_temp is declared in zinclude.

BU tif you want to use type definitions to be used, then you must create a type pool in se11.

Choose type grouups radio-button.

give a name to your type-pool.

say create.

Use the type to define your variables.

Regards,

Ravi

Former Member
0 Kudos

Hi Kranti,

If u write the declarationin some other include or program n use it in other program, without using INCLUDE.. how would the complier understand where the declaration has come from?? U need to specify to the compiler the path of declaration and hence the include is included..

If u dont intend to use INCLUDE, declare a data element in ABAP dictionary and use it in ur program..

I dont think its possible to do it the way u have suggested..

BTW, why arent u in favour of using the INCLUDE.. is it because it has a lot of declarations..

Regards,

Tanveer.

Please mark helpful answers

Former Member
0 Kudos

Hi,

the include im trying to use refers to another include and so on. hope im clear.

Thanks,

Kranthi.

0 Kudos

If you want to avoid that, then define a type-pool as Ravi suggested. And if you finally decide to do that, you should award him