SET TITLEBAR title [OF PROGRAM prog]
[WITH text1 ... text9].
1. ... OF PROGRAM prog
2. ... WITH text1 ... text9
During screen processing, this statement specifies the GUI title (specified in title) for the subsequent screens. The title is displayed in the title bar from the next sending of one screen until the end of the program or until the next SET TITLEBAR statement. The name of the current GUI title is displayed in the system field sy-title.
A character-type data object that contains the name of a GUI title of the
main program of the current
program group or of the program specified
in prog in upper case is expected for
title. If the title does not exist, sy-subrc is set to 4 and the word "SAP" is displayed in the title bar.
System fields
sy-subrc | Meaning |
0 | GUI title is set. |
4 | GUI title cannot be found. |
... OF PROGRAM prog
By default, a GUI title defined in the current main program is used. When using the addition
OF PROGRAM, a GUI title of the progam specified in prog
can be set. A character-type data object is expected for prog that contains the name of a ABAP program in upper case.
... WITH text1 ... text9
When using the addition WITH, you can replace the placeholders of the GUI title with the contents of data objects text1 to text9. Data objects text1 to text9 must be of a character type flat data type. The placeholders of the GUI title can be defined in the form "&" or "&i", where i can be a number between 1 and 9. The characters are replaced as follows:
If no data object is specified for a placeholder, it is represented by a blank character. Two successive
"&" characters "&&" in the title bar are not replaced with the contents of text1 to text9, but with the character "&".
If a GUI title should be translated into other languages, the numbered placeholder "&i" should be used as the record structure can change.
In the following example, the GUI title TITLE_0100 of the program specified in prog is set in a PBO module, where the placeholders "&1" and "&2" of the title are replaced with the contents p1 and p2.
DATA: title TYPE string,
prog TYPE string,
p1 TYPE c LENGTH 10,
p2 TYPE c LENGTH 10.
...
MODULE status_0100 OUTPUT.
...
title = 'TITLE_0100'.
prog = '...'.
p1 = '...'.
p2 = '...'.
SET TITLEBAR title OF PROGRAM prog WITH p1 p2.
...
ENDMODULE.