Bitwise AND isn't working for me...

Hi,
I'm trying to do something that would be extremely easy for me in a language like C or C++, but since I know nothing about SAP or ABAP except what I've read in the past few days, this problem is a little harder than I had hoped.
I have some ABAP code written by someone else long ago, which I need to fix.  Here is the part of the code that I'm trying to modify:
IF usr02-uflag = 0.
      zreturn-number = '245'.
      zreturn-message = 'USER IS IN ENABLE STATE'.
      APPEND zreturn TO return.
      CLEAR zreturn.
* value '64' is stored, if input user is in lock state done by
* adminstrator
    ELSEIF <b>usr02-uflag = '64'.</b>
      zreturn-number = '777'.
      zreturn-message = 'USER IS LOCKED BY ADMINISTRATOR'.
      APPEND zreturn TO return.
      CLEAR zreturn.
I want to change the comparison <b>usr02-uflag = '64'.</b> so that it AND's the value with 64 so I can see if that particular bit flag is turned on.
I haven't been able to find any type declaration for usr02 yet, but I'm assuming usr02-uflag is some kind of string or xstring...?
I tried converting the string to a hex number and using the BIT-AND operator, but I didn't get the correct value when I did that.
Can someone please show me the quickest/easiest way to do the following (pseudo-code of course):
ELSEIF ( usr02-uflag BIT-AND 64 ) = 64.

Well as I said, I don't know what the data type of usr02-uflag is, but since it is compared with a number in quotes, I'm assuming that means it's a string?
usr02-uflag holds a SAP user's Locked status.  64 means they were locked by the administrator and 128 means they were locked by themselves when entering the wrong password a few times.  I've noticed that it is possible for a user to be in both states at the same time.  Since that would produce a value of '192' neither of the ELSEIF conditions would catch it and it would fall through to the default.
I could explicitely test for a value of '192', but since I don't know what other bits might be turned on for other user status's, I'd rather AND the value with '64' or '128' to determine if the user is Admin or User Locked...
Here is some more code at the top of the ABAP.  I'm not sure if it helps much?
* tables used for fetching the status of an user
  TABLES: usr02.
  DATA : BEGIN OF zreturn .
          INCLUDE STRUCTURE bapiret2.
  DATA : END OF zreturn.
* Fetch record from system table USR02. This table is used to store User
* data
  TRANSLATE username TO UPPER CASE.
  SELECT SINGLE * FROM usr02 WHERE bname = username.

Similar Messages

  • HT5037 I have downloaded and installed this tool, but it's still telling me I need to update. Any suggestions why this isn't working for me? I have a Macbook Pro.

    I have downloaded and installed the iPhoto tool to update so my pictures transfer over, but it's still telling me I need to update. Any suggestions why this isn't working for me? I have a Macbook Pro.

    You have to download and RUN the iPhoto library upgrade - then launch iPhoto - If you had iPhoto '08 or earlier (version 7.x.x) - the upgrade is installed in the utilities folder of your Applications folder
    LN

  • Hi, I am having trouble using the smooth tool on a logo that I created. I have watched tutorials and something isn't working for me. When trace with the smooth the line just disappears and doesn't smooth anything out. Please help.

    Hi, I am having trouble using the smooth tool on a logo that I created. I have watched tutorials and something isn't working for me. When trace with the smooth the line just disappears and doesn't smooth anything out. Please help.

    Sorry, that's Monika with a k
    On Tue, Nov 18, 2014 at 2:26 PM, Monika Gause <[email protected]>

  • TS3988 i changed my apple id email and when i sign into iCloud on my phone it still comes up with the old email and my password isn't working for it?

    i changed my apple id email and when i sign into iCloud on my phone it still comes up with the old email and my password isn't working for it?

    Try going to https://appleid.apple.com, click Manage my Apple ID and sign in with your current iCloud ID.  Click edit next to the primary email account, change it back to your old email address and save the change.  Then edit the name of the account to change it back to your old email address.  You can now use your current password to turn off Find My iPhone on your device, even though it prompts you for the password for your old account ID. Then save any photo stream photos that you wish to keep to your camera roll.  Then go to Settings>iCloud, tap Delete Account and choose Delete from My iDevice when prompted (your iCloud data will still be in iCloud).  Next, go back to https://appleid.apple.com and change your primary email address and iCloud ID name back to the way it was.  Now you can go to Settings>iCloud and sign in with your current iCloud ID and password.

  • HELP - Website isn't working for me but working for everybody else

    Hey I'm new to this site so I'm sorry if this is in the wrong section!
    So I've been getting annoyed lately because my website (www.curtiskeay.com) isn't working for me and just redirecting me back to my hosting website saying that the website is 'coming soon' but it works for everyone else that has tried loading it, so it just seems to be me that it's not loading for.
    It works every now and then but very rarely for me, so it makes me feel that the site is down but really and truly it's just not loading for ME. It works perfectly fine at home on my wifi on my phone which is android and I use google chrome. I know this isn't probably a Apple related problem but I was unsure where else to post this.
    If anyone can give me any kind of help it would be greatly appreciated!
    Thanks,
    Curtis

    It's working here.
    Try this..   from your Safari menu bar click Safari > Preferences then select the Privacy tab.
    Click:  Remove All Website Data
    Now empty the Safari cache.
    Back to Safari > Preferences. This time select the Advanced tab.
    Click: Show develop menu in menu bar
    Now go to the menu bar, click Develop > Empty Caches
    Quit and relaunch Safari then try your site.

  • After downloading yosemite the sound isn't working for safari

    I have a 13' Macbook Pro Retina and after downloading yosemite the sound isn't working for safari or google chrome, however, sound works for all other applications such as iTunes and notifications as far as I know. How do I get sound back for safari or chrome?

    Reset PRAM.   http://support.apple.com/kb/PH18761
    Reset SMC.     http://support.apple.com/kb/HT3964
    Choose the method for:
    "Resetting SMC on portables with a battery you should not remove on your own".

  • Push isn't working for email on iPhone or iPad using aol

    Push isn't working for my email on iPhone and iPad for aol carrier

    I have the paid AOL accounts, and they were supposed to get back to me today and have not, thus far. It has to be an issue with AOL's email server.  The tech that I spoke to over the weekend said that he thought that it may be an issue with their server.  Almost 3 weeks ago, AOL's email server was hacked.  They said that 2% of their accounts were affected, and one of my AOL accounts was in that 2%.  They didn't admit for over a week that it was their server that had been hacked, and instead made everyone affected think that it had been their own computers that had been hacked.  I have to believe that this is an AOL issue again.  Everything was working fine with my iPhone and my iPad, and suddenly my email was nolonger being pushed on Thurs night/early Friday.  If I get an answer from AOL, I will certainly post it here.

  • HT5595 Parallax feature isn't working for me. Help?

    I have an iPhone 4 that I updated to iOS7. It's supposed to have the parallax feature and it isn't working for me. Games that use motion and tilting the screen still work, so why no parallax effect on my phone?
    It doesn't even have a reduce motion option in my settings-general-accessibility. No option to even turn it on. What's going on?

    The parallax effect is not available on the iPhone 4.

  • HT1476 My iPhone 4S will charge on a laptop but not from a wall plug. I have tried different boxes and different USB cords from the wall but none work. These boxes and USB cords work for other family members with iPhones. I'm stumped :/

    My iPhone 4S will charge on a laptop but not from a wall plug. I have tried different boxes and different USB cords from the wall but none work. These boxes and USB cords work for other family members with iPhones and a USB cord that works from the laptop won't work from 3 or 4 different wall boxes that work for others. I'm stumped :/

    Update: It seems as though the phone will charge if I plug it in and then turn it off.  It will not charge while the phone is on.  Also iTunes will not recognize it, so I can't sync or anything.  I read somewhere that it could be a fuse somewhere?? Or maybe the dock connector. Where is the best place to get this repaired?

  • Hello all,  I bought an iPhone 5 in the US and brought it back to Brasil. Now I'm trying to use Siri, but once I press the "home" button "voice control" appears and it only works for me to call my contacts. The manual guide tells me to go to Settings Gene

    Hello all,
    I bought an iPhone 5 in the US and brought it back to Brasil. Now I'm trying to use Siri, but once I press the "home" button "voice control" appears and it only works for me to call my contacts. The manual guide tells me to go to Settings>General>Siri. At the General menu "Siri" doesn't appear. What should I do to set Siri up if it doesn't appear at settings>general?
    Thank you,
    Melanie.

    Go to Settings>General>Restrictions and make sure Siri is set to On.

  • HT5622 I reset my ID and password for my Mac. How do I get that ID and password to work for my iPhone?

    I reset my ID and password for my Mac. How do I get that ID and password to work for my iPhone? My account is disabled on the iPhone until I have the ID and password synched for both devices.

    You cannot merge iCloud/Apple IDs. You must decide which one ot use, one or the other. Login with your new ID on your computer.
    Be aware that content/apps purchased with the old ID will be forever tied to that ID.

  • I have recently had problems in getting my Adobe Premiere Elements 10 to run. One of the gentlemen was able to take over control of my computer, and got it working for me, however since that time the program will sometimes open but most times it just free

    I have recently had problems in getting my Adobe Premiere Elements 10 to run. One of the gentlemen was able to take over control of my computer, and got it working for me, however since that time the program will sometimes open but most times it just freezes the computer and I have to shut it down and re open without any success with opening the elements program.
    Can you help

    Sosure
    What computer operating system is your Premiere Elements 10 running on?
    What video card/graphics card does your computer use? NVIDIA GeForce? If so, please read the Announcement about the Premiere Elements 10 NVIDIA GeForce issue which is found at the top of this web site. Does that apply to you? The explanation for the situation and the fix (roll back of the driver version) are all included in that Announcement.
    We need to rule in or out this factor at the onset before we get to other questions
    a. non NIVIDIA video card/graphics card driver
    b. project preset and properties of source media
    c. computer details
    More later.
    We will be watching for your reply.
    Thank you.
    ATR

  • I am using iPhone 4s with no sim card. My WiFi turned grey and isn't working. I've tried many methods like freezing and Resetting the network settings, still not working. Now what should I do? (iOS 7.1.2)

    I am using iPhone 4s with no sim card. My WiFi turned grey and isn't working. I've tried many methods like freezing and Resetting the network settings, still not working. Now what should I do? (iOS 7.1.2)

    Put in a micro SIM (SIM need not be active) and
    Restore from backup
    Restore as new
    http://support.apple.com/en-us/HT201252

  • Drivers and Downloads site isn't working for me

    Can anyone see if the site works for you.  When I put in my computer information (either quick name:  G70 or going through the selections) all I get is a note at the bottom to make a selection!  I tried to sign in thinking that might help, but that said  I had "invald creditentials". 
    Thanks.  Libra

    Hi Libra,
    Thanks for posting to the Lenovo Community,
    I’d like to guide you how to search for the drivers for the Drivers for your machine:
    Screen shot1:
    Screen Shot2:
    Hope the information helps. Let us know.
    Regards
    Soha
    Did someone help you today? Press the star on the left to thank them with a Kudo!
    If you find a post helpful and it answers your question, please mark it as an "Accepted Solution"! This will help the rest of the Community with similar issues identify the verified solution and benefit from it.
    Follow @LenovoForums on Twitter!

  • 2 of 4 speakers and Subwoofer not working for Altec Lansing Lucasfilms THX Surround (circa 2003)

    I am attempting to connect my Altec Lansing Lucasfilm THX 5.1 sound system to my HP ENVY All-in-one. I think the original audio card for the sound system came on a Dell with Soundblaster. 
    I have connected the green audio to the jack in the back which only gets 2 of the 4 speakers working (even after configuring the speakers). The subwoofer is connected to the sub jack in the back panel as well and is not working at all. I realize that I am trying to have an ancient sound system work with my fancy new HP Envy. Am I asking too much??  I thought maybe a driver update might be needed. But in theory, if those jacks are available in the back it should work (she says optimistically).
    Any suggestions or advice would be appreciated.

    Not a problem.  Thank you for the additional information.
    It sounds like you have the speakers connected correctly.  If there is only one connector for all of the speakers, it may be that you will only be able to use two of them.  However, I am not certain why the subwoofer isn't working.  Is it selected in the Control Panel / Sound?  I realize that you said the speakers are configured in the Control Panel, but is the subwoofer separate?
    I have an old (2001) Polk Audio set of speakers.  I have only been able to get two of them and the subwoofer to work with my new HP computer.  It sounds fine without the other two speakers.
    Signature:
    HP TouchPad - 1.2 GHz; 1 GB memory; 32 GB storage; WebOS/CyanogenMod 11(Kit Kat)
    HP 10 Plus; Android-Kit Kat; 1.0 GHz Allwinner A31 ARM Cortex A7 Quad Core Processor ; 2GB RAM Memory Long: 2 GB DDR3L SDRAM (1600MHz); 16GB disable eMMC 16GB v4.51
    HP Omen; i7-4710QH; 8 GB memory; 256 GB San Disk SSD; Win 8.1
    HP Photosmart 7520 AIO
    ++++++++++++++++++
    **Click the Thumbs Up+ to say 'Thanks' and the 'Accept as Solution' if I have solved your problem.**
    Intelligence is God given; Wisdom is the sum of our mistakes!
    I am not an HP employee.

Maybe you are looking for