Skip to Content
-1

SELECT ... INTO CORRESPONDING FIELDS OF itab

Jun 06, 2017 at 12:57 PM

704

avatar image
Former Member

Hi,

Please check these codes below :

TYPES: BEGIN OF ty_mara ,
matnr TYPE mara-matnr,
matkl TYPE mara-matkl,
mtart TYPE mara-mtart,
meins TYPE mara-meins,
menge TYPE menge_d,
END OF ty_mara.

DATA: it_mara1 TYPE TABLE OF ty_mara.

SELECT matnr matkl mtart meins FROM mara
INTO CORRESPONDING FIELDS OF TABLE it_mara1
UP TO 100 ROWS.

When I do syntax-checking, it generates this error "The work area 'IT_MARA1' has more fields than selected."

It should not generate this error right, since I am using SELECT ... INTO CORRESPONDING FIELDS OF TABLE itab.

Please help, Thank you.

10 |10000 characters needed characters left characters exceeded

In addition to Matthews comment: you can suppress this warning in the code inspector by adding the pragma ##TOO_MANY_ITAB_FIELDS to your select statement.

1

Further to Uwe's answer,

Though why would you want to suppress something that may be pointing to a potential error in processing ?

1

By suppressing you express that you know what you are doing. But I wonder if this is the case in that case.

4

Horst! <abject shock and horror!!!>

2
Former Member

Thank you all for the comments.

If it is only a warning, it wouldn't matter right? Just as long as I know the purpose of my action.

Since I am new in ABAP, sometimes I am afraid that the warning might lead to a problem in the future. I used to code without any WARNING!! hahaha ...

I really appreciate all the comments. Now I know what I have to do. Thank you so much friends.

Cheers ...

0
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
avatar image
Former Member Jun 06, 2017 at 02:29 PM
-1

Normally that is just a warning we get if the internal table has less fields than that were mentioned in the select. In this case you are not selecting MENGE field. Please check that it is just warning and not error.

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi,

thank you so much for the respond. Yes it is a warning. But sometimes I am afraid that that warning might bite me back in the future. But as long as I know what I am doing with it. It shouldn't be a problem. Right ?

Once again thanks so much. Hesitation answered.

0
Matthew Billingham
Jun 06, 2017 at 12:59 PM
1

The error is not an error, it is a warning, and it is exactly correct. You get this message because you have not selected menge.

Share
10 |10000 characters needed characters left characters exceeded