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

Question on OOPS

Former Member
0 Likes
504

Hi

I am trying to write a program in OOPS. I have defined class & methods & their implementations in a program in SE38. I am trying to pass the select-options that I get in the input in one of the public methods.

I have declared that in my method like this:

TYPES: t_vkorg TYPE RANGE OF vkorg.

;

;

;

METHOD: get_deliveries IMPORTING imt_vkorg TYPE t_vkorg.

ENDMETHOD.

SELECT-OPTIONS: s_vkorg FOR likp-vkorg.

When I call this method...

<objectname>->get_deliveries EXPORTING imt_vkorg = s_vkorg.

When I do this I get syntax error that imt_vkorg is not type-compatible with s_vkorg..

.. I have also tried to use

TYPES: t_vkorg TYPE STANDARD TABLE OF selopt.

Still it doesn't work.. Can anyone help..

Thanks

Geetha

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
473

Hi,

You have to declare TYPE RANGE OF.

Ex..

TYPES: t_vkorg TYPE RANGE OF vkorg.

Use the above in your METHOD declaration..

When calling use the body operator.

<objectname>->get_deliveries EXPORTING imt_vkorg = s_vkorg[]

.

Thanks

Naren

3 REPLIES 3
Read only

Former Member
0 Likes
474

Hi,

You have to declare TYPE RANGE OF.

Ex..

TYPES: t_vkorg TYPE RANGE OF vkorg.

Use the above in your METHOD declaration..

When calling use the body operator.

<objectname>->get_deliveries EXPORTING imt_vkorg = s_vkorg[]

.

Thanks

Naren

Read only

0 Likes
473

Hi Naren,

Perfect.. I missed [].. Thanks

Geetha

Read only

awin_prabhu
Active Contributor
0 Likes
473

Hi

I class definition change data type of 'imt_vkorg' to 'likp-vkorg'.

Both data types of 'imt_vkorg' and 's_vkorg' should be same.

Thanks..

Edited by: Sap Fan on Mar 18, 2009 3:34 PM