Purpose
With title(), you can change the title of the SAP title bar.
Syntax
To display title on the screen, use the following command.
title("string");
To display title on the screen by appending text from a system variable, use the following command.
title("String" +variable);
To display title on the screen from a system variable, use the following command.
title(variable);
Title command is very useful in customizing existing screen titles after they have been customized, or for adding title for a new user-defined screens.
Options
The title() command does not take any options.
Example
To domonstrate the usage of title() command, we will show the SAP transaction number on the toolbar.
var z_screentitle = [_transaction]; title("Transaction number of the screen:" +z_screentitle);
Usage Details
-
System Variable: _transaction
This system variable holds a string value of what transaction is being used.
if(_transaction == "VA02") { title("ON VA02"); }
Learn more about System Variable: _transactionand how it is very useful when you want a script to run only in a certain transaction.
-
Get the current window size using _windowsize_x, _windowsize_y and title()
-
Get the system ID or database name using _database and with title()
-
Tree based multilevel screens using "name of the variable" and with title()