Skip to main content

ABAP fails again, on literal/packed to numeric parameters.

Yet another ABAP packed/literal bug:

CLASS cl_test DEFINITION.
  PUBLIC SECTION.
    CLASS-METHODS test IMPORTING i_num TYPE numeric.
ENDCLASS.
CLASS cl_test IMPLEMENTATION.
  METHOD test.
    WRITE :/ i_num.
  ENDMETHOD.
ENDCLASS.

START-OF-SELECTION.

  DATA: l_f TYPE decfloat34.

  " This works correctly:
  l_f = '10.1231231233'.
  l_f = '10.12312312334234234'.
  l_f = '10.12312312334234234345345'.

  " This has some kind of MOD overflow error on packed's maximum decimals of 16:
  cl_test=>test( '10.1231231233' ).              " OK:   "10.1231231233" P(16) DECIMALS 10
  cl_test=>test( '10.12312312334234234' ).       " FAIL: "10.1"          P(16) DECIMALS 1
  cl_test=>test( '10.12312312334234234345345' ). " FAIL: "10.1231231"    P(16) DECIMALS 7

Comments

Appreciate this blog posst

Popular posts from this blog

My Custom Mechanical 60% Keyboard Build

My Custom Mechanical 60% Keyboard Build All the parts   1x GH60 (Satan) board - $35 61x Cherry Clear switches  - $35 2x Cherry Blue switches - $3 10x Cherry Red switches - $10 1x PCB Stabilizer set (6.25 space) - $6 1x Royal Oak Glam 60% case (Black Walnut) - $78 1x Aluminium 60% plate - $19 1x SA profile Choclatier keycaps - $102 ( base, modifiers, and novelties ) 1x Braided Nylon USB cable - $15 Solder, Tools, Risers, Labor, etc. Total: ± $300 (Other single switch types added as needed) Testing the board I had my helper do the work here. We needed to test the board before applying any solder. Assembling Add the stabilizers first Add the plate (using a few switches as spacers) Then add the rest Solder solder solder... And test again: The casing The casing I received did to have built-in risers: So I added my own: Then Assemble (using temporary spare GMK Carbon Cherry-profile k...

Lock Screen on Mac OS X using keyboard shortcut.

1. Download "Global Hotkey" 2. Create a folder "Global Hotkey" and copy contents of downloaded DMG to that. 3. In a terminal do: cd "/Applications/Global Hotkey" ln -s /System/Library/Frameworks/ScreenSaver.framework/Versions/A/Resources/ScreenSaverEngine.app "command f10" 4. Make sure Screensaver is set to prompt for password (you may need to relog for this to take effect) 5. Preferences -> Accounts -> -> Login Items : Add "Global Hotkey.app" 6. Launch the app as well

So which is better? The Sony PSP or the Nintendo DS?

I recently went on a trip to Japan, and was faced with a choice on a new handheld gaming device to purchase for a friend. So which is better? What are the differences? First-off, I personally own a Gameboy Advance, and I finally chose to buy the PSP. The reason for the choice was that I already owned both an iPod and a Gameboy Advance, but this friend of mine had neither... so for me the DS may have been a better choice, but only slightly. Firstly the DS: This little machine is slightly heavier than the PSP, but folds away neatly, it's more solid and resiliant, the games are cheap, load fast and can use older Advance cartridges. The screen has a huge surface and the touch screen is really nifty. The technology is way behind the PSP, but it is also about $50 less in price. So this device has a huge advantage with current game availability. It also has a good battery life (something I appreciate after my Japan trip on both my iPod and Gameboy). The PSP: This is a slick-looking device...