Skip to Content
Author's profile photo Horst Keller

Merry, Happy, etc.



cl_demo_output=>display(

  |\n\n\n{ REDUCE string( LET t = replace( val =  REDUCE string(

  INIT l = replace( val = replace( val =  replace( val = replace(

  val = REDUCE string( LET x = cl_abap_random_int=>create( seed =

  CONV i( sy-uzeit ) min = 1 max = 1999 ) IN INIT h = repeat( val

  = ` ` occ = 2000 ) FOR k = 1 UNTIL k > 500 NEXT h = replace( val

  = h off = x->get_next( ) len = 1 with = COND string( WHEN k / 2

  = ( k – 1 ) / 2 THEN `*` ELSE `+` ) ) ) sub = `**` with = `* `

  occ = 0 ) sub = `*+` with = `* ` occ = 0 ) sub = `+*` with = `+ `

  occ = 0 ) sub = `++` with = `+ ` occ = 0 ) FOR j = 0 UNTIL j > 2

  NEXT l = replace( val = l off = 800 + j * 100 + 30 len = 40 with

  = repeat( val = ` ` occ = 40 ) ) ) off = 930 len = 40 with = |{

                      `Season’s Greetings!`

  WIDTH = 40 ALIGN = CENTER }| ) IN INIT s = “ FOR i = 0 UNTIL i >

  19 NEXT s = s && substring( val = t off = i * 100  len = 100 ) &&

  |\n| ) }| ).

(Statement can be executed on ABAP 7.40, SP08 and higher)

Assigned tags

      9 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Raphael Pacheco
      Raphael Pacheco

      Thanks Horst 🙂

      Author's profile photo Former Member
      Former Member

      Thanks. Merry Xmas to you!

      Author's profile photo Uwe Fetzer
      Uwe Fetzer

      Danke  

      Author's profile photo Jelena Perfiljeva
      Jelena Perfiljeva

      This blows up the geek-o-meter. 🙂 Happy Holidays of your choosing!

      Author's profile photo Former Member
      Former Member

      Happy holidays Horst ...

      Seems like the force of ABAP is with you 😉

      Author's profile photo Yuksel AKCINAR
      Yuksel AKCINAR

      Hello,

      Can someone put the result here, please?

      I am not an ABAPer and curious about the result. 🙂

      Thanks and Regards,

      Yuksel AKCINAR

      Author's profile photo swadhin ghatuary
      swadhin ghatuary

      Hi,

      i feel same as you.... eager to waiti for output .

      still we using 7.40 sp06 🙁 ...

      /wp-content/uploads/2015/12/output_856527.png

      Author's profile photo Christian Drumm
      Christian Drumm

      hi Horst,

      Happy holidays to you as well!

      A minor suggestion for improvement. You should have base64 encoded the string 'Seasons Greetings!'  and use CL_HTTP_UTILITY to decode it in the code. That would have made the result less obvious 😀

      Christian

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

      But it should be obviously a greeting card also for those not having 7.40, SP08.