10-15-2008 6:19 AM
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.
10-15-2008 6:31 AM
Hi,
Declare as follows:
Tables: Mara.
Data: IT_MARA type standard table of MARA. "For IT_MARA declaration
Regards,
Saba
10-15-2008 6:22 AM
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...
10-15-2008 6:31 AM
Hi,
Declare as follows:
Tables: Mara.
Data: IT_MARA type standard table of MARA. "For IT_MARA declaration
Regards,
Saba
10-15-2008 6:39 AM
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.
04-26-2011 11:01 AM