Entering content frameProcedure documentation Inserting Statement Patterns Locate the document in its SAP Library structure

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:

  1. Ensure that you are in change mode, and place the cursor at the position where you want to insert the statement.
  2. Choose Pattern.
  3. The Insert Statement Pattern dialog box appears.

  4. Choose the required pattern and , if necessary, the statement.
  5. Choose This graphic is explained in the accompanying text.
  6. Fill out the pattern with the required information.
  7. Example: Statement pattern for ABAP Objects:

    This graphic is explained in the accompanying text

  8. Choose This graphic is explained in the accompanying text to confirm your entries.

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.

 

 

 

 

Leaving content frame