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 class interface

Former Member
0 Likes
1,112

Moved to correct forum by moderator.

hi ppl,

I have created an interface and assigned that to a class(global class and interface in se24).

Here my problem is in interface->parameters tab,

IT_MARA Exporting Type MARA

P_MATNR_LOW Importing Type MARA-MATNR

P_MATNR_HIGH Importing Type MARA-MATNR

here i want to create a table but from above parametrs first line-

IT_MARA Exporting Type MARA -> its not allowing me declare as LIKE,its throwing an error

ERROR-Type MARA-MATNR cannot be referenced using LIKE

method Z_INTERFACE~SELECT_METHOD.

SELECT * FROM MARA INTO table IT_MARA WHERE MATNR = P_MATNR_LOW AND MATNR = P_MATNR_HIGH.

ENDSELECT.

endmethod.

Edited by: Matt on Nov 24, 2008 10:50 AM

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,025

Hi Priyank,

In OO ABAP you cannot pass ranges or select-options directly.

create a table type in SE11 TCODE and pass it here

try it out.

regards

Ramchander Rao.k

5 REPLIES 5
Read only

Andri
Participant
0 Likes
1,025

Hello Priyank,

You can't use LIKE with ABAP Objects, you need to declare the table using TYPE.

You can no longer use this kind of type reference in ABAP Objects classes.

[http://help.sap.com/saphelp_nw04/helpdata/EN/9b/239fa610de11d295390000e8353423/frameset.htm]

Read only

Former Member
0 Likes
1,026

Hi Priyank,

In OO ABAP you cannot pass ranges or select-options directly.

create a table type in SE11 TCODE and pass it here

try it out.

regards

Ramchander Rao.k

Read only

0 Likes
1,025

hi ramchandra,

Thanks a lot for your vital information.Can you send me the steps how to create the table types as per my above requirement for mara.I have tried a lot but its not working.

Read only

0 Likes
1,025

hi ppl,

Thank you..problem solved

Read only

uwe_schieferstein
Active Contributor
0 Likes
1,025

Hello Priyank

In order to have itabs as method parameter you need to use tables types. In case of MARA you can use either MARA_TT or MARA_TAB.


IT_MARA            TYPE mara_tt
P_MATNR_LOW Importing Type MARA-MATNR
P_MATNR_HIGH Importing Type MARA-MATNR

Regards

Uwe