Application Development and Automation 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: 
Read only

help with error

Former Member
0 Likes
1,280

Hi all,

This is an uniicode error

can anyone tell me how to fix this

data: begin of itab,

BUKRS LIKE BKPF-BUKRS,

AUGDT LIKE BSEG-AUGDT,

WRBTR LIKE BSEG-WRBTR,

end of itab.

CLEAR Itab WITH '/'.

error : "ITAB" must be a character-type data object (data type C, N, D, T or STRING).

1 ACCEPTED SOLUTION
Read only

suresh_datti
Active Contributor
0 Likes
1,219

Change it to

data: begin of itab,
BUKRS LIKE BKPF-BUKRS,
AUGDT LIKE BSEG-AUGDT, 
WRBTR LIKE BSEG-WRBTR,
end of itab.

CLEAR: Itab-bukrs WITH '/',Itab-augdt WITH '/',Itab-wrbtr.

~Suresh

11 REPLIES 11
Read only

suresh_datti
Active Contributor
0 Likes
1,220

Change it to

data: begin of itab,
BUKRS LIKE BKPF-BUKRS,
AUGDT LIKE BSEG-AUGDT, 
WRBTR LIKE BSEG-WRBTR,
end of itab.

CLEAR: Itab-bukrs WITH '/',Itab-augdt WITH '/',Itab-wrbtr.

~Suresh

Read only

Former Member
0 Likes
1,219

Hi,

Instead of WRBTR you need to take TYPE C with the Lenght 17

Regards

Sudheer

Read only

0 Likes
1,219

hi,

so all the currency, quantity fields has to be declarred as character i,.e type c.

Ashok, is there a particular reason who choose to declare

WRBTR you need to take TYPE C with the Lenght 17

,im thinking its always better to a have an extra length than its actual otlength which in this case 16 so you choose 17 .Thats the reason behind it let me know if iam wrong

and one more thing which approach is better i.e decllaring as type c or clearing all fields individually

let me know thanksagain

Read only

0 Likes
1,219

I would say that <i>clearing all fields individually</i> is the way to go, there is not reason to translate the currency fields to character, simply so you can save some lines of code to clear the value. Just clear them individually. You are gonna have to start getting used to this in unicode environments.

Regards,

Rich HEilman

Read only

0 Likes
1,219

Hi Rich,

even when i try to do

CLEAR: Itab-bukrs WITH '/',Itab-augdt WITH '/',Itab-wrbtr WITH '/'.

i gives me an error mess saying

"ITAB-WRBTR" must be a character-type data object (data type C, N, D, T

or STRING).

let me know is there a way to over come this

with changing to character type

Read only

0 Likes
1,219

Hi,

in 4.6c

after

clear : Itab-wrbtr WITH '/'.

itab-wrbtr has a value like this 7<7<7<7<7<7.<7 instead of //////..

let me know

Read only

0 Likes
1,219

What is the use of using the WITH clause for this field? / of course can not be a value of a currency field. This is basic ABAP.

If you want to initialize a currency field it must have a numeric value such as 0.

There is no need for the WITH extension in this case.

clear itab-wrbtr.

Regards,

Rich Heilman

Read only

0 Likes
1,219

If you do want the WRBTR field to have an initial value of /, then of course it must be a character type field.

Regards,

RIch HEilman

Read only

0 Likes
1,219

Hi Rich,

i decided to tojust go with

clear :itab-WRBTR .

now i have a statement

DESCRIBE FIELD Itab LENGTH LEN IN CHARACTER MODE.

data: begin of itab,

BUKRS LIKE BKPF-BUKRS,

AUGDT LIKE BSEG-AUGDT, " CLEARING DATE

WRBTR LIKE BSEG-WRBTR,

end of itab.

error :

"ITAB" must be a character-type field (data type C, N, D, or T).

Rich , ifi change to char would be there anyother issues while the program is being executed

and i should declare a charcter more than its output length if i want to change it to character field.

let me know

Read only

0 Likes
1,219

What happens if you change the DESCRIBE statement to say in BTYE MODE.

DESCRIBE FIELD Itab LENGTH LEN IN BYTE MODE.

Regards,

RIch Heilman

Read only

0 Likes
1,219

HI Rich,

it doesn't give me the error .

The length which we get in byte mode will be different from the length we get in 4.6c version right

Let me know

thanks