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: 

Include data declerations in a method

Former Member
0 Kudos
188

Hello everybody,

my question is, is there any possibility to make an include for a method.

This means is it possible to define some types or datas in a include and involve this in one ore more methods.

I don't want to define this as global attributes of the class, because the values can be changed!

This is the case:

INCLUDE_1:

Data: wa_spfli TYPE spfli,

wa_spflight TYPE spflight.

METHOD_01:

INCLUDE include_01.

(This method should involve the include)

wa_spfli-...

METHOD_02:

(without the include)

it should be not possible to access the work area's!

Is there a possibility?

I have seen i can define the attribiutes only for interfaces. So a "work around" would be to sepparete the methods in different interfaces, isn't it?

But it is not nice to administrate a lot of typse there!

What is the meaning/functionality of "Type group" in "Properites" of a class/interface?

Can I involve a include there anyway?

Have somebody of you a other good idear?

Refards

Christian

5 REPLIES 5

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos
109

The Type group on the properties tab is a way to include a type groups into the class. So if you want to use types from the type group SLIS in different methods, or even in the attribute definitions, you can add the type groups there. You could also use this to satisfy your requirement for the TYPES statements.

Regards,

Rich Heilman

uwe_schieferstein
Active Contributor
0 Kudos
109

Hello Christian

You can define all kinds of types in the "Types definition" section of your class. However, these types can only be used for <b>private </b>attributes methods.

As soon as you required them for <b>public </b>attributes or methods they must be globally known as described by Rich.

Regards

Uwe

Former Member
0 Kudos
109

Hello Rich, hello Uwe,

Thanks for your help, but this is not the solution which I search.

I have found a very easy solution by myself:

- create a include with all data decleration

- INCLUDE Include_name inside the method

So, with each call of the method the work areas will be new initialized and cleaned (if values are inside)

I thought that this is not possible in classes/methods, therefore the question! Sorry

But I have try it and it seems that it works.

Regards

Christian

Former Member
0 Kudos
109

I found the answer by myself

0 Kudos
109

Hi,

this post is longstanding but I'd like to know the answer to the original question.

Cheers.