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: 

Internal Table Error

Former Member
0 Kudos

Hi All,

I have the code like below in 4.6c version.

data: itab like mara occurs 0 with header line.

select * from mara into table itab.

loop at itab.

write:/ itab.

endloop.

This code is working in 4.6c version.

But if i try the same code in ECC 6.0 version iam getting the error as

"ITAB cannot be converted to charector-type field".

How to overcome this in ECC6.0 without declaring each field.

(ex:I mean itab-matnr)

Thanks in Advance.

15 REPLIES 15

former_member181995
Active Contributor
0 Kudos

this is not an error.

it's just a warning message just activate and ignore this message and run your program.

don't bother much.

Former Member
0 Kudos

Hi,

The error is in this part of code.

loop at itab.

write:/ itab.

endloop.

we can not do it like that we need to display all the fields individually.

try it like that, Hope it will work.

Regards

Rajesh Kumar

Former Member
0 Kudos

Hi Eeshwar,

IN ECC 6.0 version, writing the internal table as a whole is not UNICODE compatible. So what you need to do is, you need to write individual fields for your output.

As follows:

LOOP AT ITAB INTO WA_ITAB.

WRITE:/ WA-ITAB-field1,

WA-ITAB-field2.

ENDLOOP.

This would help you solve that error/ warning.

Best Regards,

Ram.

Former Member
0 Kudos

Hi eeshwar Baddam,

DATA: itab LIKE yyhcobd OCCURS 0 WITH HEADER LINE.

SELECT * FROM yyhcobd INTO TABLE itab.

LOOP AT itab.
  WRITE:/ itab.
ENDLOOP.

This code is working fine in ECC 6.0.

Best regards,

raam

0 Kudos

Hi Raam,

I dont want to write the individual fields, Becuase the table has more than 100 fields.

Also the code is not working in ECC6.0 but you are saying it is working fine?

please clarify...............

0 Kudos

Hi Eeshwar Baddam,

DATA: itab LIKE yyhcobd OCCURS 0 WITH HEADER LINE.

SELECT * FROM yyhcobd INTO TABLE itab.

LOOP AT itab.
  WRITE:/ itab.
ENDLOOP.

yyhcobd ---> this table does not contain the Quantity and currency Fields .

That is the reason it is working fine.

If the table contains the Currency or quantity fields then you need to give the fields also.

Best regards,

raam

Former Member
0 Kudos

hi eshwar.

try this way

data: itab type table of mara.

data:wa_itab type mara.

select * from mara into table itab.

loop at itab into wa_itab.

write:/ wa_itab-matnr.

endloop.

Thanks,

Mahesh.

former_member188685
Active Contributor
0 Kudos

if your internal table contains any qty , decimals, currency fields then it is not possible to use directly using write itab, and it gives error. you need to specify the fields what ever you want to display.

loop at itab.
write:/ itab. "it works only for char/string etc but fails for QTY,currency etc.
endloop.

Former Member
0 Kudos

hi,

IN ECC 6.0, just writing "loop at itab" wont work as its not compatible with the standards.

First declare the workarea for the table, read all records in to the workarea and then indivisually write all the records.

Loop at itab into wa_itab.

write : wa_itab-f1.

endloop.

Regards,

preet

Former Member
0 Kudos

Hi,

Use the below method for creating internal table and work area in the ECC 6.0.

types: begin of y_struc,

field1 type dbtable-field1,

field2 type dbtable-field2,

end of y_struc.

data: itab type standard table of y_struc,

wa type y_struc.

loop at itab into wa.

write: wa-field1, wa-field2.

clear wa.

endloop.

Former Member
0 Kudos

Hi,

write this way.

loop at itab.

write:/ itab-matnr, itab-makt......

endloop.

Or best is to use workarea .

loop at itab into wa_itab

write:/ wa_itab-matn, wa_itab-makt...

endloop.

if your internal table contains any quantity , decimals or currency fields then it is not possible to use write itab, and it gives error so you need to specify the fields that are to be displayed.

thanx.

kesavadas_thekkillath
Active Contributor
0 Kudos

data: itab like mara occurs 0 with header line.

jus t change this as.

data: itab like table of mara occurs 0 with header line.

Former Member
0 Kudos

HI,

I think in mara table i have faced the same problem. the only solution is the fields that are requied should be declared one by one , not by refferrring it to whole table.

Former Member
0 Kudos

I do not want to use individual fields to display.

In there any other option to do without using individual fields in ECC 6.0

Thanks

Former Member
0 Kudos

hi...

u can use an option in pattern where u need to only select the fields that u want, if u r interested i will help you with navigation.