Skip to Content
Author's profile photo Horst Keller

ABAP Obfuscation Riddle

Tobias Trapp wants to start an ABAP obfuscation contest.

For warming up a small riddle:

INCLUDE

NOT. IF
NOT  NOT  NOT  NOT  NOT  NOT  NOT  NOT  NOT
NOT  NOT !NOT  OR   NOT  NOT  NOT  NOT  NOT
NOT  NOT  NOT  NOT  NOT  NOT  NOT  NOT  NOT
NOT  NOT  NOT=>NOT( NOT ) OR  NOT  NOT  NOT
NOT  NOT  NOT  NOT  NOT  NOT !NOT  …  NOT.

This program is syntactically correct (as of 7.40, SP08).

Now tell me how that?

Assigned Tags

      12 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Christian Guenter
      Christian Guenter

      *&---------------------------------------------------------------*

      *&  Include          NOT

      *&---------------------------------------------------------------*

      DATA: number TYPE i.

      SELECT-OPTIONS: not FOR number NO-DISPLAY.

      DEFINE not.

        endif.

      END-OF-DEFINITION.

      CLASS not DEFINITION.

        PUBLIC SECTION.

          CLASS-METHODS: not

            IMPORTING i_not        TYPE any

            RETURNING VALUE(r_not) TYPE abap_bool.

      ENDCLASS.

      CLASS not IMPLEMENTATION.

        METHOD not.

        ENDMETHOD.

      ENDCLASS.

      START-OF-SELECTION.

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

      Correct answer, that was (too) fast 😉

      Author's profile photo Nikolay Evstigneev
      Nikolay Evstigneev

      Oh, man, I'm just several minutes late.

      It's funny that omitting variable and parameters names I came to exactly the same text =)

      !NOT was the most difficult part for me, another is done in about 10 minutes.

      P.S. Horst, there were not less than 4 versions of the task 🙂

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

      !NOT was the most difficult part

      Yep, a pity that I had to place the ! in front of it. Otherwise ...

      BTW, In my include I have also the REPORT statement.

      Author's profile photo Nikolay Evstigneev
      Nikolay Evstigneev

      Yep, a pity that I had to place the ! in front of it. Otherwise ...

      No, it was the only part that made me wake up 🙂
      Otherwise it would be easy.

      I think, REPORT is not the main point, I had it in the main program.

      Author's profile photo Custodio de Oliveira
      Custodio de Oliveira

      Not sure if I'm more impressed by the problem or by the absurdly quick solution.

      Author's profile photo Dominik Di Lorenzo
      Dominik Di Lorenzo

      Hello Horst,

      somehow when looking at your source code the BF programming language came into my mind 🙂

      Brainfuck - Wikipedia, the free encyclopedia

      Best regards,

      Dominik

      Author's profile photo Nikolay Evstigneev
      Nikolay Evstigneev

      BF for kiddies, Malbolge rules! 😆

      Author's profile photo Tobias Trapp
      Tobias Trapp

      I really love it 🙂

      Perhaps you should start the contest - and the winner gets a price - maybe a one of your book Official ABAP Programming Guidelines. von Horst Keller, Wolf Hagen Thümmel or a meeting with the ABAP language group to discuss new features of ABAP language.

      Cheers,

      Tobias

      Author's profile photo Nikolay Evstigneev
      Nikolay Evstigneev
      Author's profile photo Christian Guenter
      Christian Guenter

      great idea 😆

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

      Nice try ...