Use
The Pattern function allows you to insert various statement templates in your program. This is particularly useful with complex ABAP statements, since it saves excessive typing and ensures that the syntax of the statement you are inserting is always correct.
Features
You can insert the following statement patterns:
Statement |
Explanation |
CALL FUNCTION |
Inserts a function call. |
ABAP Objects pattern |
You can insert the following basic ABAP Objects statements: CALL METHOD CREATE OBJECT RAISE EVENT |
MESSAGE |
A MESSAGE statement for a specified message. Enter a message ID, message type and a number. The choose ENTER to continue. |
SELECT * FROM |
Inserts a SELECT FROM <table> statement. Enter a table name in the field provided and choose ENTER. The system queries you for the table fields. |
PERFORM |
A PERFORM statement for a specified form. |
AUTHORITY-CHECK |
An AUTHORITY-CHECK statement for a specified authorization object. Choose ENTER to continue. |
WRITE |
A WRITE statement for a specified structure or table. |
CASE |
Inserts a CASE statement for a specified status. |
Internal Table |
Inserts an internal table. You can copy the fields or the structure of an existing table. |
CALL DIALOG |
A CALL DIALOG statement for a specified dialog module. |
Other pattern |
Inserts a predefined or user-defined ABAP statement. |
Procedure
To insert a statement pattern in the ABAP Editor:
The Insert Statement Pattern dialog box appears.
Example: Statement pattern for ABAP Objects:
The system inserts the statement at the cursor position in the program code.
In the above example, the following lines would be inserted:
CALL METHOD picture->set_display_mode
EXPORTING
display_mode =
* EXCEPTIONS
* ERROR = 1
* others = 2
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.