Skip to Content
Personal Insights

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

13 Comments
You must be Logged on to comment or reply to a post.
  • 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.
  • 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' ) } |.
    
  • /