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

Character string mapped to structure?

Former Member
0 Likes
704

Hi,

I hav a work structure WA_MARA LIKE MARA, and a 4000-character variable DATA(4000) TYPE C.

Now, the data from DATA needs to be copied into the fields of WA_MARA, but a statemnt like WA_MARA = DATA gives a Unicode error.

Ne ideas how to solve this?

4 REPLIES 4
Read only

Former Member
0 Likes
572

This is not possible in unicode systems. Maybe, you can solve the problem using Field-Symbols...

Reward points if helpful...

Regards

Read only

Former Member
0 Likes
572

Hi Shailesh,

Try using move statement and if this still persists then go to attributes and uncheck "unicode checks active".

This would solve your problem.

BR

Rakesh

Read only

Former Member
0 Likes
572

I've got a solution to your problem; As bluemoon has suggested, you must use field-symbols. You must also cast it.

DATA: wa_mara LIKE mara,

DATA(4000) TYPE c.

FIELD-SYMBOLS: <fs> TYPE mara.

ASSIGN DATA TO <fs> CASTING.

wa_mara = <fs>.

  • This will solve your problem

~arman

Read only

0 Likes
572

But be careful here, it could happen that there will be a problem with the type P fields here.

Regards,

RIch Heilman