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: 

errors in exceuting a small oops report

Former Member
0 Kudos

Hi Experts,

when executing the following report. couple of errors r displayed..pls correct the code.

1) "IT_MARA" is not type-compatible with formal parameter "IT_MARA".

2) "IT_MARA" is neither specified under "TABLES" nor defined as an internal table.

DATA: MARA TYPE MARA.

*provide data objects

DATA: OBJ TYPE REF TO Y_CL_INTERFACE,

IT_MARA TYPE ZMARA,

WA_MARA TYPE MARA.

*provide selection screen

SELECT-OPTIONS: S_MATNR FOR MARA-MATNR.

*provide object

START-OF-SELECTION.

CREATE OBJECT OBJ.

*call the method.

CALL METHOD OBJ->Y_IF_INTERFACE~SELECT_METHOD

EXPORTING

P_MATNR_LOW = S_MATNR-LOW

P_MATNR_HIGH = S_MATNR-HIGH

IMPORTING

IT_MARA = IT_MARA

WA_MARA = WA_MARA.

*display the data

LOOP AT IT_MARA INTO WA_MARA.

WRITE:/ WA_MARA-MATNR,

WA_MARA-ERSDA,

WA_MARA-ERNAM,

WA_MARA-MATKL,

WA_MARA-MEINS.

ENDLOOP.

and also when trying to activate the class too the following error is diplayed

"IT_MARA" is not an internal table - the "OCCURS n" specification is missing".

please guide me.

Advance thanks

nani.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Declare as follows:

Tables: Mara.

Data: IT_MARA type standard table of MARA. "For IT_MARA declaration

Regards,

Saba

4 REPLIES 4

madan_ullasa
Contributor
0 Kudos

hi,

Your table declaration part is wrong....

wherez that zmara coming from ? And for internal table you should have ' type standard table ' in your table declaration....

These are simple errors. Fundamentals...

regds,

Madan...

Former Member
0 Kudos

Hi,

Declare as follows:

Tables: Mara.

Data: IT_MARA type standard table of MARA. "For IT_MARA declaration

Regards,

Saba

Former Member
0 Kudos

hi

DATA: MARA TYPE MARA.

*provide data objects

DATA: OBJ TYPE REF TO Y_CL_INTERFACE,

IT_MARA TYPE ZMARA,

WA_MARA TYPE MARA.

change this code as below

--->remove this (DATA: MARA TYPE MARA.)

*provide data objects

DATA: OBJ TYPE REF TO Y_CL_INTERFACE,

IT_MARA TYPE standard table of MARA,

WA_MARA TYPE MARA.

Former Member
0 Kudos

This message was moderated.