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

Help needed with bit & unicode

Former Member
0 Likes
934

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
801

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

5 REPLIES 5
Read only

StMou
Active Participant
0 Likes
801

hi,

why you don't define LICK type USR02-UFLAG with value '64'. "Locked Locally By Administrator

Int 64 = hex 40 .

Rgds

Read only

Former Member
0 Likes
802

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

Read only

Clemenss
Active Contributor
0 Likes
801

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

Read only

Former Member
0 Likes
801

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

Read only

Former Member
0 Likes
801

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