2007 Apr 18 9:34 AM
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
2007 Apr 18 9:36 AM
Hi,
It is not possible in unicode system.
Reward all helpful answers..
Regards,
V.Raghavender.
2007 Apr 18 9:37 AM
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...
2007 Apr 18 9:37 AM
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
2007 Apr 18 9:38 AM
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
2007 Apr 18 9:41 AM
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.
2007 Apr 18 9:44 AM
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
2007 Apr 18 9:46 AM
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.
| User | Count |
|---|---|
| 6 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |