Three ABAP Games
Look what I’ve found.
Under the cloak of “Examples of Expression-Oriented Programming” recent versions of the Example Library of the ABAP Keyword Documentation contain three ABAP games.
Jaw Breaker
Not too demanding but colorful …
Mine Sweeper
Time-honored and well known …
2048 Game
A recent smart phone game and a real challenge …
Wanna play?
- If you have a recent ABAP system (7.40, SP09 and higher), you find the programs directly in the system.
(The examples from the 7.50 documentation can rely on 7.50 features. For 7.40, there are 7.40 examples).
- If you have an older 7.40 ABAP system, you can copy the source code from the documentation or from the attached text file.
- If you have a release older than 7.40, you can copy old fashioned 7.00 source code from the attached text file . Maybe you also have to replace the usage of CL_DEMO_INPUT with PARAMETERS then.
Only outside working hours, of course.
Wanna Contribute?
Maybe, the pattern used in these games (usage of CL_ABAP_BROWSER etc.) motivate you to create some other games?
Note
Due to the discussion below (thanks Enno!) I adjusted the HTML output of
- DEMO_JAWBREAKER_HTML_740
- DEMO_JAWBREAKER_HTML_700
- DEMO_MINESWEEPER_740
- DEMO_MINESWEEPER_700
in Release 7.50, SP03. You find the new sources in the attached text file .
Hopefully, those run for all combinations of SAP GUI and IE. If not, next round …
Horst,
guess you compiled those games outside your working hours, too, right? Or was it just for demonstration purposes to explain new features of the ABAP language. 😉
Michael
Once my boss explained to me, that I'm working in the moment I'm doing something that is related to ABAP or SAP ...
That's a good reason and explanation 😎
A company can save money everytime a program becomes faster or better or deeper in giving details or functionalities .
Games are among first sources of alghorytm of efficiency example applications and often they're the best way to achieve a complex result.
So we should study Games and alghorytm and save money and time for the company or instead we should change job = GAME OVER 🙂
Waiting for the day the canteen will offer ABAP noodles with SELECTed dressing... 😉
Time to brush up JavaScript? 🙂
Copy&Paste ... 😉
Woo-hoo, next time I need to do a copy-paste I'll explain that Horst advised me to do that 😆
Only for HTML/JS of course, in ABAP we're good enough 😈
Hello Horst,
"Click" is not working... 🙁
I did test it on two systems now.
At least a fine, compact and much to small demo (on high resolution displays) 😉
Greetings Enno
Makes me wonder. Never had problems with that.
Can you check SAPEVENT in program DEMO_HTML_BROWSER?
CL_ABAP_BROWSER should work since 702.
Horst
The Demo_HTML_Browser works. In Jawbreaker I have no pointing hand on "Mouse Over". There is no link...
Unless I adjust the demo and put something in the table cell:
...
Now that's amazing ...
The Jawbreaker game seemed to work fine in the HTML control of SAP GUI since I implemented it, and now that.
In order to check, I extracted an HTML file to the disk:
And yes, it looks bad in all browsers ...
Oh my!
Don't ask me, why it works fine in most (?) SAP GUI controls but not in yours.
Found a correction that works for me:
Does it work for you? If this is the case, I think about adjusting DEMO_JAWBREAKER_HTML_... (and Mine Sweeper) in 751.
Thanks for notifying!
Horst
Yes, it does! Thanks. The report needs some more changes than just adding bx and div. LINE (C255) is too small to take the changes...
I always cause trouble with my computers configuration. 🙂
It depends on the GUI version. I had to add a ";cursor:hand" to the bx class above otherwise it would not work in recent GUIs any more!
What SAP GUI version are you using?
740 Final Release
Dateiversion 7400.1.4.1106
Build 1598106
Same as I 😐
Isn't it relevant which IE version is taken by the GUI?
Maybe these are different?
I do not know how to identify the internal version...
It's both, SAP GUI and IE, because SAP GUI influences the browser's standard CSS.
In order to work out right in my SAP GUI as well as other browsers, I finally will combine an a-style and an bx-style.
Oh boy ...
(In fact I'm fighting with that crap everyday for providing the ADT version of the ABAP Docu ...)
Thanks for the correction. Got the same Problem with jawbreaker and minesweeper, too.
With the correction it works fine 😉
Nice,
I copied the code but get an error during activation:
I didn't change anything in the declarations ...
Regards.
Kris
Hey, some 7.50 features crept in ...
Object Component Selector After Table Expressions
In the 7.40 documentation, there's a 740 runnable code.
😛
OK.
Problem solved!
Kris
This reminds me. 17 years ago just before Christmas 1999 things were a little slow at work, so, on a 31H system, I wrote a game in ABAP using this report's autorefresh technique.
There was a ship going across the top of the screen from which you could drop depth charges on the submarine moving randomly at the bottom of the screen.
It was a rehash of a game I first wrote in 1982 for a ZX81. Autorefresh there was bit easier!
Missing (and not in action): Classical Dynpro as APC-client.
"Missing (and not in action)"?
Not available up to now, APC for refreshing dynpro screens. You need user interaction on a dynpro screen in order to pass contol to ABAP.
Oh, that minor issue.
Who uses classic SAP GUI anyway? 😉
Once a User requested a report ALV, the result should be updated without user action.
Immediately I used the functionality of my ZTETRIS.
did you thought about putting it on GitHub?
SCN should be sufficient ...
I cannot access the code for systems below 7.4. Would you be so kind and update the link, or upload the code somewhere else?
Nice stuff 🙂
Thanks for sharing it.
Hi,
It seems program DEMO_GAME_2048_700 has some dependencies on version of cl_demo_input=>add_field( ). In 7.40 SP7 parameter as_checkbox is missing.
After commenting it out, it works fine however 🙂
Best regards,
Peter
Yes, its all about demos and games, delivered, but not under the constraints for productive coding ...
Among Us is a game that is being played by a lot of people today. The game is easy to play with beautiful and funny graphics that attract a lot of users. I think you will like it.