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

Moving work area to a string type variable gives unicode error

Former Member
0 Likes
3,332

Dear All,

I have a work area of type sflight. I want to move this work area into a variable of type string. But it gives me a syntax error saying that it is not possible in unicode programs. Is there any way to move a work area to a string or char type variable.

Example Code:

DATA : l_str type string.

DATA : wa_sflight type sflight.

move wa_sflight to l_str. "This line gives me a syntax error.

Regards,

Koushik

Dear All,

I have a work area of type sflight. I want to move this work area into a variable of type string. But it gives me a syntax error saying that it is not possible in unicode programs. Is there any way to move a work area to a string or char type variable.

Example Code:

DATA : l_str type string.

DATA : wa_sflight type sflight.

move wa_sflight to l_str. "This line gives me a syntax error.

Regards,

Koushik

7 REPLIES 7
Read only

Former Member
0 Likes
1,762

Hi,

It is not possible in unicode system.

Reward all helpful answers..

Regards,

V.Raghavender.

Read only

Former Member
0 Likes
1,762

In your work area all the fields must be of character or convertable to character type.

then only you can do like that.

In SFLIGHT some fields are of non-character (not convertable to character also).. so you are unable to do like that.

If you do the same in any method also the data will be moved as junk characters )non-character data)

so ... only move character or compatible data...

Read only

Former Member
0 Likes
1,762

Hi Koushik,

You shoul move the fields field by field.

Whenever there are non char like fields, yoy hsould use write statement nstead.

regards,

ravi

Read only

Former Member
0 Likes
1,762

Hi,

How you will move Sflight structure to a string?

Sflight structure is different.

String may be a length CHAR field.

So you can't move.

If you need to move, then fetch all the fields of Sflight into some CHAR fields and concatenate them and move to STRING.

reward if useful

regards,

ANJI

Read only

Former Member
0 Likes
1,762

Hello Koushik,

You cannot directly pass work area to string.

try this.

concatenate wa_sflight-carrid wa_sflight-connid into l_str separated by space.

you can concatenate any no. of fields as per your requirement.

Read only

Former Member
0 Likes
1,762

hi,

if you want to concatenate all the values in the work area to a string , USE commant 'CONCATENATE'.

concatenate wa_sfight-fld1

wa_sfight-fld1

wa_sfight-fld1

wa_sfight-fld1

to l_str.

regards,

Tanmay

Read only

0 Likes
1,762

hi,

if you want to concatenate all the values in the work area to a string , USE commant 'CONCATENATE'.

concatenate wa_sfight-fld1

wa_sfight-fld1

wa_sfight-fld1

wa_sfight-fld1

into l_str.

SEPARATED BY

space.