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

problem in using methods of interface in a class

Former Member
0 Likes
861

while using the code.

method ZIF_INTERFACE~SELECT_METHOD.

*select * from mara into table it_mara*

where matnr between p_matnr_low and p_matnr_high.

endmethod.

error generated : "IT_MARA" is not an internal table - the "OCCURS n" specification is missing

although i hav declared it_mara in parameter section while creating interface.

Kindly Suggest.

thanks in advance

while using the code.

method ZIF_INTERFACE~SELECT_METHOD.

*select * from mara into table it_mara*

where matnr between p_matnr_low and p_matnr_high.

endmethod.

error generated : "IT_MARA" is not an internal table - the "OCCURS n" specification is missing

although i hav declared it_mara in parameter section while creating interface.

Kindly Suggest.

thanks in advance

6 REPLIES 6
Read only

RaymondGiuseppi
Active Contributor
0 Likes
814

How did you define the parameter, you should define it TYPE Zxxx where Zxxx is an internal table (with OCCURS clause), else this is a single field/structure. Define your own or use a type-pools or a table type like EXPO_MARA_T.

Regards,

Raymond

Read only

Former Member
0 Likes
814

you have to declare your parameter as reference to a table type. Pls declare it_mara TYPE MARA_TT where MARA_TT is a table type.

Regards

Sathar

Read only

0 Likes
814

I hav defined in paramter in this manner.

parameter type typing method associated type

it_mara exporting type mara.

but its generating problem..that i cant use it as internal

Read only

0 Likes
814

Hi!

Create a tabletype in SE11.

Choose datatype radiobutton, give the name, like ZZMARA and click create.

Choose the tabletype from the popup and enter

Give MARA to the type of the line.

Save and activate it.

And of course use it in your method's parameters.

Regards

Tamá

Read only

matt
Active Contributor
0 Likes
814

>

> I hav defined in paramter in this manner.

>

> parameter type typing method associated type

> it_mara exporting type mara.

>

> but its generating problem..that i cant use it as internal

First of all, read the ABAP help, and SAP Help, specifically about "table types".

In this context mara is NOT a table type. It is a structure. As everyone has so far suggested: use a table type. You have a few choices

1. Define an appropriate table type in your class

2. Define an appropriate table type in the data dictionary

3. Use an appropriate table type already defined in the data dictionary

4. Define it_mara in the method, as being TYPE STANDARD TABLE, and define its actual type in the calling program.

matt

Read only

0 Likes
814

Dear All,

Thanks A lot.

Problem has been solved now.