1

So I got this text of which I can't know the length beforehand because it depends on how many entries there are in an internal table (see below). The table is given to the Smartforms FM in my report. The text itself works fine with a dynamic text variable, but under that text I need a horizontal line. The Line needs to be right beneath the text at all time. So far I only got a line with a fixed position, which does not lead to the result I want.


If it is possible, how can I get the line to change position based on the length of the text? So that it is right under the text at all time, no matter how many lines the text got.


DATA: l_string TYPE string,
      lt_stream_lines TYPE STANDARD TABLE OF string.

loop at i_tab.
* reading one line of i_tab into l_string.

  APPEND l_string TO lt_stream_lines.
  APPEND '' TO lt_stream_lines.
endloop.

CALL FUNCTION 'CONVERT_STREAM_TO_ITF_TEXT'
    EXPORTING
      stream_lines = lt_stream_lines
      lf           = 'X'
    TABLES
      itf_text     = gv_text.

* gv_text then has the full text I want to display
Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
Suimon
  • 271
  • 1
  • 6
  • 15
  • By "horizontal line under the text" do you mean text with underscore? – Jagger Mar 20 '19 at 07:06
  • @Jagger No, I mean just a horizontal line under a section of text in order to seperate it from another section coming further down on the page. – Suimon Mar 20 '19 at 07:08
  • I think it is possible, however I do not have the access to an SAP system at the moment. Have you seen the discussion [here](https://archive.sap.com/discussions/thread/905779)? – Jagger Mar 20 '19 at 07:12
  • @Jagger I tried doing it like described there but it did not work as intended. – Suimon Mar 20 '19 at 07:47
  • @Suimon you must have a Main Window containing your Text element followed by a dummy Template element for the horizontal line (one empty cell with the top horizontal border in black color and other borders transparent). – Sandra Rossi Mar 20 '19 at 10:02
  • @SandraRossi Yes, I did exactly that (which is also just like in the link of Jagger) but it does not display the horizontal border line. – Suimon Mar 20 '19 at 12:01
  • @Suimon it works for me, maybe you didn't successfully draw the border? – Sandra Rossi Mar 20 '19 at 12:59

1 Answers1

2

You must have a Main Window containing your Text element followed by a dummy Template element for the horizontal line (one empty cell with the top horizontal border in black color and other borders transparent).

Create a Template element via the context menu:

enter image description here

Draw the border (here I exaggerate the proportions "a little bit"!):

enter image description here

Preview result:

enter image description here

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48