‎2010 Mar 15 2:55 PM
Hi,
I have an issue with the following code when setting the unicode flag for a Z program.
check usr02-uflag o lock.
check usr02-uflag z lock.
The field usr02-uflag has a data type of INT1and an output length of 3.
The field lock is defined as "lock(1) type x value '40'."
what do I need to do to satisfy unicode?
Is it just a case of defining another variable as type X and copy usr02-uflag to it and then do the comparison. i.e.
DATA: new_var(1) type x.
new_var = usr02-uflag.
check new_var o lock.
check new_var z lock.
pls help.
C
‎2010 Mar 15 3:41 PM
Hi,
Use XSTRING as the type of your variable, i.e.
>
> DATA: new_var type XSTRING.
>
> new_var = usr02-uflag.
> check new_var o lock.
> check new_var z lock.
>
>
Regards,
Mark
‎2010 Mar 15 3:10 PM
hi,
why you don't define LICK type USR02-UFLAG with value '64'. "Locked Locally By Administrator
Int 64 = hex 40 .
Rgds
‎2010 Mar 15 3:41 PM
Hi,
Use XSTRING as the type of your variable, i.e.
>
> DATA: new_var type XSTRING.
>
> new_var = usr02-uflag.
> check new_var o lock.
> check new_var z lock.
>
>
Regards,
Mark
‎2010 Mar 15 7:40 PM
Hi Chris,
I do niot see the issue:
uflag has a data type of INT1 - No change in unicode
lock is defined as "lock(1) type x value '40' - No change in unicode
Only fields of type C or STRING are affected by Unicode.
It should work as it does now [Comparing Bit Sequences|http://help.sap.com/saphelp_webas620/helpdata/EN/fc/eb3523358411d1829f0000e829fbfe/content.htm].
Am I wrong?
Regards,
Clemens
‎2010 Mar 16 9:02 AM
Hi Clemens,
There is an issue, see ABAP help:
In Unicode programs, the data type of operand1 must also be byte-like (x or xstring). Outside of Unicode programs, operand1 can be of any elementary data type or have a flat structure.The bit pattern tests (o, z, m) cause a syntax error if used on an INT or any other non-byte field.
Regards,
Mark
‎2010 Mar 16 7:23 AM
Thanks for your help!
Clemens, in response to your answer I was getting the following message when running transaction UCCHECK
"USR02-UFLAG" must be a byte-type field. (Typ X or XSTRING).
Cheers
C