Skip to Content
author's profile photo Former Member
Former Member

raising a n error message

DATA: BEGIN OF ITAB OCCURS 0,

MATNR LIKE MARA-MATNR,

MTART LIKE MARA-MTART,

MATKL LIKE MARA-MATKL,

UOM LIKE MARA-MEINS,

LAEDA LIKE MARA-LAEDA,

END OF ITAB.

DATA: WA_ITAB LIKE LINE OF ITAB.

SELECT * FROM MARA INTO TABLE ITAB WHERE MATNR = '521196'.

LOOP AT ITAB INTO WA_ITAB.

WRITE : WA_ITAB-MATKL.

ENDLOOP.

messaging is coming as 'The work area "ITAB" is not long enough.'

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

10 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jun 16, 2008 at 06:38 AM
    TYPES: BEGIN OF TY_ITAB,
    MATNR LIKE MARA-MATNR,
    MTART LIKE MARA-MTART,
    MATKL LIKE MARA-MATKL,
    UOM LIKE MARA-MEINS,
    LAEDA LIKE MARA-LAEDA,
    END OF TY_ITAB.
    
    DATA: ITAB TYPE TABLE  OF TY_ITAB,
              WA_ITAB TYPE TY_ITAB.

    Regards

    Kannaiah

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 16, 2008 at 06:33 AM

    Make data declaration as:

    TYPES: BEGIN OF ITAB OCCURS 0,

    MATNR LIKE MARA-MATNR,

    MTART LIKE MARA-MTART,

    MATKL LIKE MARA-MATKL,

    UOM LIKE MARA-MEINS,

    LAEDA LIKE MARA-LAEDA,

    END OF ITAB.

    DATA: WA_ITAB TYPE ITAB.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 16, 2008 at 06:34 AM

    Declare the internal table

    data: itab like mara occurs 0 with header line.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 16, 2008 at 06:37 AM

    Hi,

    Ur selecting all feilds fron mara into ITAB but in Itab there only few filds declared.

    So use

    data itab like mara occurs 0 with header line.

    Or

    SELECT MATNR MTART MATKL UOM LAEDA FROM MARA INTO TABLE ITAB WHERE MATNR = '521196'.

    Reward pts if helpfull.

    Regards,

    Dhan

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 16, 2008 at 06:37 AM

    you are selecting all the columns (using SELECT *) but your itab has only five fields...this is the reason for this error msg...

    either declare your table as

    data itab type table of mara.

    OR

    modify your select statement to select only the fields that are a part of the internal table

    SELECT MATNR MTART MATKL MEINS LAEDA FROM MARA INTO TABLE ITAB WHERE MATNR = '521196'.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 16, 2008 at 06:38 AM

    hi,

    Itab has

    MATNR

    MTART

    MATKL

    UOM

    LAEDA only these fields

    use

    select MATNR

    MTART

    MATKL

    UOM

    LAEDA from mara

    INTO TABLE ITAB WHERE MATNR = '521196'.

    Reward points if helpful

    Regards,

    priya

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 16, 2008 at 06:39 AM

    Hi,

    You have created an internal table with 5 fields and you are trying to fill that table with all the fields from the table MARA.

    SO you either modify the SELECT stmt by changing * to 5 fields or change the structure of the internal table to mara.

    SELECT MATNR MTART MATKL MEINS LAEDA LAEDA,

    FROM MARA INTO TABLE ITAB WHERE MATNR = '521196'

    or

    data : BEGIN OF ITAB OCCURS 0.

    include structure mara.

    data end of itab.

    Thanks and Regards.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 16, 2008 at 06:40 AM

    Hi,

    Chnage the select statement as below :

    
    DATA: BEGIN OF ITAB OCCURS 0,
    MATNR LIKE MARA-MATNR,
    MTART LIKE MARA-MTART,
    MATKL LIKE MARA-MATKL,
    UOM LIKE MARA-MEINS,
    LAEDA LIKE MARA-LAEDA,
    END OF ITAB.
    
    
    DATA: WA_ITAB LIKE LINE OF ITAB.
    
    
    SELECT * FROM MARA INTO corresponding fields of TABLE ITAB WHERE MATNR = '521196'.
    
    LOOP AT ITAB INTO WA_ITAB.
    WRITE : WA_ITAB-MATKL.
    ENDLOOP.
    
    

    Thanks,

    Sriram Ponna.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 16, 2008 at 06:41 AM

    Hi,

    you should use 'CORRESPONDING FIELDS OF 'in the select statement..

    Regards,

    venkat n

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 16, 2008 at 06:45 AM

    hi,

    Tables : mara .

    DATA: BEGIN OF ITAB OCCURS 0,

    MATNR LIKE MARA-MATNR,

    MTART LIKE MARA-MTART,

    MATKL LIKE MARA-MATKL,

    UOM LIKE MARA-MEINS,

    LAEDA LIKE MARA-LAEDA,

    END OF ITAB.

    DATA: WA_ITAB LIKE LINE OF ITAB.

    SELECT * FROM MARA INTO corresponding fields of TABLE ITAB WHERE MATNR = '521196'.

    if sy-subrc = 0.

    LOOP AT ITAB INTO WA_ITAB.

    WRITE : WA_ITAB-MATKL.

    ENDLOOP.

    endif.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.