0

I am trying to make a dialogue screen into a reusable message screen, which resizes itself dynamically depending on how long the message is. I'm not sure whether that is even possible. This is my code:

FORM show_messagescreen.
  "Size screen dynamically according to needed space
  DATA out_length TYPE i.
  IF gd_0201_message_output_01 > gd_0201_message_output_01.
    out_length = strlen( gd_0201_message_output_01 ).
  ELSE.
    out_length = strlen( gd_0201_message_output_02 ).
  ENDIF.
  * Code to change visLength of the two output fields here.
  CALL SCREEN 0201
    STARTING AT 01 01
    ENDING AT out_length 05.
ENDFORM.

As you can see I can resize the screen depending on how long the message is, but when the screen appears there is still a scrollbar at the bottom, because the fields are set at around 70 Characters length. Setting the fields length lower just cuts off the message if it is longer than the field. Can I circumvent this scrollbar somehow?

Please tell me if my code is wrong or dirty, I'm a beginner.

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
Elekam
  • 75
  • 1
  • 9
  • 3
    I don't think it's possible because you define a fixed size for a screen (I'm not talking about its contents) and the horizontal scrollbar depends on the width of the screen. Dynpro is a very old technology so you can't do what you want. Eventually, a workaround is to use Control Framework with a dialogbox container (`CL_GUI_DIALOGBOX_CONTAINER`) and a HTML control (`CL_GUI_HTML_VIEWER`) but that's another story... – Sandra Rossi Apr 20 '20 at 14:03

1 Answers1

0

Aparrently not possible, as Dynpro is a very old technology. One might try @Sandra Rossi´s possible workaround, which could be much more effort than this feature is worth.

Elekam
  • 75
  • 1
  • 9