Skip to Content
Personal Insights
Author's profile photo Michael Keller

Happy Halloween

Dear Community, Halloween is coming. That inspired me to write a little fun blog with some seriousness. I hope you enjoy it. And please participate in the challenge. Even there is nothing to win except fun 🙂

Lights off

It should be a bit dark for the right atmosphere for Halloween. A few days ago I read the right blog from Sascha Waechter. At this point many thanks to him. The blog is about the “Darkest Dark Theme for Eclipse”. Unfortunately, I cannot use it with my Eclipse yet, but at least I switched to the default theme “Dark”.

Wow, what an effect. The source code can be read much better in my opinion. Try it. Since I found it really useful and handy, I also changed my Microsoft Office (Outlook, Word and more) to the theme “Dark Gray”. Very pleasant. Now I have to change Google Chrome to a corresponding theme, too. And to solve the problem with installing Darkest Dark Theme.

Zombies

Ok, we have the right ambience. What is typical for Halloween? Witches, sweets, zombies? Brave people can take a look at the T163X database table. How many zombies are hanging around there?

Scare with ABAP

How can you “scare” an ABAP developer? Maybe with an unnecessarily complicated or even nonsensical source code? Some will run away screaming, others will take the challenge. What are the rules? Write a little source code in ABAP that’s hard to understand. Yes, from now on, not only C can be difficult to understand 🙂

I made a little example with string functions. Not scary enough? Well, make your own proposal and have fun. Perhaps something with Method Chaining or regular expressions?

DATA(text) = |{ translate( val = shift_left( val = condense( val = replace( val = replace( val = '00x0#!?&1#!? #!?&2#!?' sub = '&1' with = reverse( val = 'yppah' ) ) sub = '&2' with = reverse( val = 'neewollah' ) )
                del = '#!?' from = '#!?' to = ' ' ) places = 4 ) from = 'h' to = 'H' ) } |.
WRITE text.

 

Best regards and thanks for reading

Michael

Assigned tags

      13 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Michelle Crapo
      Michelle Crapo

      I'm cheating.   I'm pulling this fun code from a generated program from BRF+.  Pretty much any generated code is horrible to read.  I'm debugging today.

      Happy  Halloween to those who celebrate it!

          TRY.
          TRY.
            CALL METHOD (_v_classname)=>HAS_TRANSIENT_DATA
                 RECEIVING
                         RV_TRANSIENT = _v_ap_RV_TRANSIENT
                  .
           CATCH cx_sy_no_handler INTO /FDT/00O2TP935CAW4JZU4T1XYE566=>_V_CX_ROOT.
           /FDT/00O2TP935CAW4JZU4T1XYE566=>_V_CX_ROOT = /FDT/00O2TP935CAW4JZU4T1XYE566=>_V_CX_ROOT->previous.
             RAISE EXCEPTION /FDT/00O2TP935CAW4JZU4T1XYE566=>_V_CX_ROOT.
          ENDTRY.
            CATCH cx_root INTO _v_ex_root1.
             _v_message = _v_ex_root1->if_message~get_text( ).
            MESSAGE x828(fdt_expressions) WITH _v_message 'HAS_TRANSIENT_APPL_DATA'  INTO /FDT/00O2TP935CAW4JZU4T1XYE566=>_V_MS_MSG-text.
            MOVE-CORRESPONDING sy TO /FDT/00O2TP935CAW4JZU4T1XYE566=>_V_MS_MSG.
            /FDT/00O2TP935CAW4JZU4T1XYE566=>_V_MS_MSG-id = '005056B2370E1ED58B8B8A6F827F36C7'.
            APPEND /FDT/00O2TP935CAW4JZU4T1XYE566=>_V_MS_MSG TO /FDT/00O2TP935CAW4JZU4T1XYE566=>_V_MT_MSG.
            RAISE EXCEPTION TYPE cx_fdt_processing EXPORTING mt_message = /FDT/00O2TP935CAW4JZU4T1XYE566=>_V_MT_MSG
                                                               PREVIOUS = _v_ex_root1.
          ENDTRY.
      Author's profile photo Michael Keller
      Michael Keller
      Blog Post Author

      Some parts of the generated code look like encrypted 😉

      Author's profile photo Enno Wulff
      Enno Wulff

      Any regular expression scares me again when I see one... 🙂

      Author's profile photo Michael Keller
      Michael Keller
      Blog Post Author

      Like an argot.

      Author's profile photo Christian Guenter
      Christian Guenter

      There was once an ABAP obfuscation riddle with very scary ABAP code 😉

      https://blogs.sap.com/2015/04/10/abap-obfuscation-riddle/

       

      Can't remember who solved it first 🙂

      Author's profile photo Michael Keller
      Michael Keller
      Blog Post Author

      Haha, we should have more fun blogs like that one. By the way: Congratulations. You probably scared Horst Keller 😉

      Author's profile photo Matthew Billingham
      Matthew Billingham

      You can obfuscate even more with macros.

      Author's profile photo Sandra Rossi
      Sandra Rossi

      Humans are scared when they see something different, even not dangerous, and if they adapt their way of thinking (if they are educated to do so), the fear vanishes (now it's easy to see what your expression will produce):

      DATA(text) = |{ 
      	translate( 
      		val = shift_left( 
      			val = condense( 
      				val = replace( 
      					val = replace( val = '00x0#!?&1#!? #!?&2#!?' 
      						sub = '&1' 
      						with = reverse( val = 'yppah' ) ) 
      					sub = '&2' 
      					with = reverse( val = 'neewollah' ) )
                      del = '#!?'
      				from = '#!?' 
      				to = ' ' ) 
      			places = 4 ) 
      		from = 'h' to = 'H' ) } |.
      
      Author's profile photo Michael Keller
      Michael Keller
      Blog Post Author

      You may remember that I have been punished with SAPscript forms from time to time 🙂 With my "SAPscript forms breakdown helper" the SAPscript statements are indented for a better and faster understanding. Indentation is one of the keys ... along with colors.

      Author's profile photo Matthew Billingham
      Matthew Billingham

      Aha. Write once, read never code.

      Author's profile photo Jelena Perfiljeva
      Jelena Perfiljeva

      Happy Halloween!

      Seems like a perfect day to pay a visit to ABAP Haunted House right here on SCN. 🙂

      Author's profile photo Enno Wulff
      Enno Wulff

      I found something this week that really scared me:

      Author's profile photo Michael Keller
      Michael Keller
      Blog Post Author

      Don't press "+" symbol ... or you open the gate to another dimension ...