Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Data Object does not have a component called MATNR

Hi Everyone,

I am battling with a small program for 2 days as to why any output is not getting on to the list.

On CHECK, the error being shown is the

'THE DATA OBJECT "WA_ITAB" DOES NOT HAVE A COMPONENT CALLED "MATNR".

Report ZTR_REP1.

tables:mara.

select-options:s_matnr for mara-matnr.

types:begin of itab,

matnr like mara-matnr,

ersda like mara-ersda,

ernam like mara-ernam,

  • ekgrp like marc-ekgrp,

end of itab.

data: wa_itab like itab,

itab1 like itab occurs 0 .

select matnr ersda ernam

from mara

into wa_itab

where matnr in s_matnr.

append wa_itab to itab1.

loop at itab1 into wa_itab.

write:/ wa_itab-matnr,

endloop.

Edited by: Alvaro Tejada Galindo on Apr 21, 2008 5:34 PM

Tags:
Former Member
Former Member replied

Hi Ranjith,

Use this code it will work fine:

tables: mara.

select-options : s_matnr for mara-matnr.

types: begin of itab,

matnr like mara-matnr,

ersda like mara-ersda,

ernam like mara-ernam,

ekgrp like marc-ekgrp,

end of itab.

data: wa_itab type itab,

itab1 like itab occurs 0 .

select matnr ersda ernam

from mara

into corresponding fields of wa_itab

where matnr in s_matnr.

append wa_itab to itab1.

Endselect.

loop at itab1 into wa_itab.

write:/ wa_itab-matnr.

endloop.

<REMOVED BY MODERATOR>

Regards

Hemant Khemani

Edited by: Alvaro Tejada Galindo on Apr 21, 2008 5:35 PM

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question