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: 

unicode problem: the data object cannot be converted to character type

Former Member
0 Kudos

Hi All,

Iam facing a problem with unicode compatible...

I have a table ZVENDOR with field packed...

and all the other fields are character types...

Here Iam getting the values to the Internal Table from the flat file and am updating those to the Ztable...

now when am going to write the field symbol..it is showing the error : " The data object cannot converted to

Character Type"...

Field-Symbols: <FS_VN> type ANY.

LOOP AT IT_VEND.

MOVE-CORRESPONDING IT_VEND TO ZVENDor.

INSERT INTO ZVENDor VALUES ZVENDor.

ASSIGN ZVENDor TO <FS_VN> CASTING type ZVENDor.

WRITE 😕 <FS_VN>.

ENDLOOP.

I would be glad if any one find the solution...

thanks and regards

raghu

6 REPLIES 6

Former Member
0 Kudos

Hi Raghu,

Until now, in the ASSIGN field TO <f> CASTING... statement, the system checked to ensure that field was at least as long as the type that was assigned to the field symbol, <f>. (Field symbols can either be typed at declaration or the type specified in an ASSIGN statement using CASTING TYPE). The syntax check is now more thorough. Now, you can only assign the field provided it is at least as long as the type assigned to the field symbol <f>. Otherwise, the system returns a syntax error. At runtime, the system only checks to see whether or not the lengths are compatible in the current system (as before).

If the field type or field symbol type is a deep structure, the system also checks that the offset and type of all the reference components match in the area of field that is covered by <f>. The syntax check is now more thorough. Now, the system checks that these components must be compatible in all systems, whether they have a one-byte, double-byte, or four-byte character length. At runtime, the system only checks to see whether or not the reference components are compatible in the current system.

In Unicode System, in the ASSIGN str TO <f> TYPE C/N and ASSIGN str TO <fs> CASTING TYPE C/N statements, the length of str may not always be a multiple of the character length, in which case the program aborts at runtime.

hope this helps,

priya

0 Kudos

Hi Priya,

thanks for reply...

I need the solution for that...

Do we have any chances of to run that...

without going to dump...

regards

raghu

Former Member
0 Kudos

Hi,

Make sure that IT_VEND and ZVENDOR has the same structure. Unicode errors generally occurs when there is a structure mismatch.

Hope it helps.

Regards,

Shashank

former_member186741
Active Contributor
0 Kudos

I think the problem is actually with your write statement. As you have 'WRITE 😕 <FS_VN>.', it is trying to output that as a 'string' and because there is a packed field it gets upset.

What are you tring to achive with the write? Can you expand the write to specify the actual fields you are interested in?

0 Kudos

Hi,

previously it was like this:

wrtie:/ zvendor

It is working good in 4.6c...

now in 5.0 ECC it throws as a unicode error...

So am trying to get the same functionality like what is before...

hope you got it now..

regards

raghu

0 Kudos

sorry Raghu but you will have to change it. Unicode will not let you 'write zvendor' (or a field-symbol in it's image). You will have to expand it to something like:

write:/ zvendor-matnr,zvendor-ebeln....etc