
ABAP code templates can be as simple as a string, but, in general, they contain multiple combinations of string elements and variables. The variables can insert elements in your code such as the current date and time up to the name of the system or the logged on user. However, the most useful feature of variables in templates is the ability to create custom variables. These custom variables act as placeholders in your template for which you provide the values when you insert the template.
ABAP Development Tools comes with the following set of variables:
| Variable | Description |
|---|---|
| cursor | Specifies the cursor position after leaving template edit mode. |
| date | Equates to the current date. |
| dollar | Equates to the dollar symbol '$'. |
| line_selection | Equates to content of all currently selected lines. |
| time | Equates to the current time. |
| word_selection | Equates to the content of the current text selection. |
| year | Equates to the current year. |
| Variable | Description |
|---|---|
| enclosing_object | Equates to the development object's name of the current editor, such as name of a class or include. |
| enclosing_package | Equates to the package, which the development object belongs to. |
| system_id | Equates to the ABAP System ID. |
| user | Equates to the name of the user that is currently logged in the ABAP system. |