cancel
Showing results for 
Search instead for 
Did you mean: 

SELECT-OPTIONS in global class definitions

Former Member
0 Kudos

I'd like to 'type' selection ranges inside a global class created with SE24.

For example:

The data element PRODH_D (Product hierarchy) has no range structure or range table in SE11.

Before I go to the trouble of defining the structure and table type in SE11, I'd like to define them in my global class and then use the 'type' for selection parameters.

For example:

types: begin of ty_kunnr_select,

sign(1) type c,

option(2) type c,

low type kunnr,

high type kunnr,

end of ty_kunnr_select.

data: st_kunnr_range type ty_kunnr_select.

data: ta_kunnr_range type standard table of ty_kunnr_select.

I've tried entering the code in multiple areas of the global class. I can get the code to compile just fine. But, when I try to use the type with a parameter definition of a method it won't compile.

Does anyone know how to do this?

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

A type pool is not needed instead create the type in the classs attributes public section, then this will be available for all method interfaces. Beter than a type-pool is to create a DDIC object directly.

Former Member
0 Kudos

Hi,

Create a TYPE-POOL and store in it your global fields. At your "Properties" screen(SE24) add your type pool. Then you can use your types.

If you find the answers helpful, please assign reward points.

Svetlin

Message was edited by: Svetlin Rusev

Former Member
0 Kudos

Thank you very much Svetlin. That worked perfectly.

I'm a newbie in using global classes and this really cleared up a major stumbling block for me.

Former Member
0 Kudos

Hi Ed,

If your question has been answered, please assign reward points.

Svetlin

ChristianFi
Active Participant
0 Kudos

not direcly related to your problem but you can save some lines by declaring the type with the range statement:

types : ty_kunnr_range type range of kunnr.

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Exactly where have you tried to put this code, in the Types Section.

Regards,

Rich Heilman

Message was edited by: Rich Heilman