Skip to Content



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)

To report this post you need to login first.

9 Comments

You must be Logged on to comment or reply to a post.

  1. Christian Dr. 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

    (0) 

Leave a Reply