Application Development and Automation 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: 
Read only

Range type in ABAP OO.

Former Member
0 Likes
4,047

Hi,

Having problem in ABAP OO.

I have defined a working range. (r_vkorg)

But what kind of associated type should I use for this in my method.

In other words: what type should "vkorg_in" be ?

DATA r_vkorg TYPE RANGE OF A004-vkorg.

data: wa_vkorg like line of r_vkorg.

case werks_in.

when 3100.

wa_vkorg-sign = 'I'.

wa_vkorg-option = 'EQ'.

wa_vkorg-low = '2000'.

append wa_vkorg to r_vkorg.

wa_vkorg-sign = 'I'.

wa_vkorg-option = 'EQ'.

wa_vkorg-low = '3000'.

append wa_vkorg to r_vkorg.

when 4100.

wa_vkorg-sign = 'I'.

wa_vkorg-option = 'EQ'.

wa_vkorg-low = '4000'.

append wa_vkorg to r_vkorg.

when others.

exit.

endcase.

call method me->getpricecondition

exporting

vkorg_in = r_vkorg ' PROBLEM

date_in = sy-datum

changing

price_inout = i_PriceTab.

//Martin

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,359

Hi,

You can define a range type in your global / local class, for example you can define a type

TYPE : gtyp_vkorg_range type range of vkork and use this type both in your range and method parameter definition.

Regards,

Sükrü

Hi,

Having problem in ABAP OO.

I have defined a working range. (r_vkorg)

But what kind of associated type should I use for this in my method.

In other words: what type should "vkorg_in" be ?

DATA r_vkorg TYPE RANGE OF A004-vkorg.

data: wa_vkorg like line of r_vkorg.

case werks_in.

when 3100.

wa_vkorg-sign = 'I'.

wa_vkorg-option = 'EQ'.

wa_vkorg-low = '2000'.

append wa_vkorg to r_vkorg.

wa_vkorg-sign = 'I'.

wa_vkorg-option = 'EQ'.

wa_vkorg-low = '3000'.

append wa_vkorg to r_vkorg.

when 4100.

wa_vkorg-sign = 'I'.

wa_vkorg-option = 'EQ'.

wa_vkorg-low = '4000'.

append wa_vkorg to r_vkorg.

when others.

exit.

endcase.

call method me->getpricecondition

exporting

vkorg_in = r_vkorg ' PROBLEM

date_in = sy-datum

changing

price_inout = i_PriceTab.

//Martin

3 REPLIES 3
Read only

Former Member
0 Likes
1,360

Hi,

You can define a range type in your global / local class, for example you can define a type

TYPE : gtyp_vkorg_range type range of vkork and use this type both in your range and method parameter definition.

Regards,

Sükrü

Read only

Former Member
0 Likes
1,359

Hello Martin,

Obviously, R_VKORG is an internal table. So VKORG_IN should be an internal table too.

The line type can be something like : VORG_RANGE or VKO_RANGE.

You can also refer it to a table type defined in the ABAP Dictionary like, GDS_SELRANGE_VKORG_TAB.

Finallly, you can have a local types declaration for the class, with the suitable structure.

Regards,

Anand Mandalika.

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
1,359

hi,

I am not sure.Just try this.

RANGES: r_vkorg FOR A004-vkorg.

Regards,

J.Jayanthi