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: 

Internal tables in Interfaces

Former Member
0 Kudos

Hi,

Is it possible to declare an internal table in a Interface class?

Thanks.

Morten

1 ACCEPTED SOLUTION

former_member181962
Active Contributor
0 Kudos

An Interface doesn't have attributes.

And the methids it has are un implemented. Then where can you declare the Internal table?

5 REPLIES 5

Former Member
0 Kudos

Hi Morten,

It is possible to declare any thing in Interface class as an attribute. Interface class hold the method definition only not the implmentation.

So you can declare the internal table as attrubute in Interface class. But you can't declared it in the method because they don't have the implementation phase.

Warm Regards,

Vijay

0 Kudos

Hi Vijay,

Thanks for your quick answer.

Yes I am aware that I can´t do any implementation in the Interface.

But generally you use the implemtation phase to declare your internal table like the example shown below:

types:

it_file_data_records TYPE STANDARD TABLE OF t_upload.

Then you use the type "it_file_data_records" as associated type when declaring your attribute. And that is not possible in Interfaces.

Morten

former_member181962
Active Contributor
0 Kudos

An Interface doesn't have attributes.

And the methids it has are un implemented. Then where can you declare the Internal table?

0 Kudos

Hello Morten

Of couse interfaces can have attributes (e.g. IF_RECA_MESSAGE_LIST). However, since all interface attributes are <b>public</b> you cannot use type definitions for defining a table type attribute. Thus, you have to use <b>table types defined in the DDIC</b> for your itab attributes.

Example: If your interface should have a BAPI message itab define the attribute (e.g. MT_RETURN) of TYPE bapirettab.

Regards

Uwe

0 Kudos

Hello Uwe,

Thanks, just what I was looking fore.

Regards,

Morten