Show TOC Start of Content Area

Procedure documentation Inserting Statement Patterns  Locate the document in its SAP Library structure

Use

The pattern function allows you to insert various source code templates in your program. This feature is particularly useful for complex ABAP statements because it reduces the typing effort and ensures that the syntax of the statement is always correct.

Procedure

To insert a statement pattern in the ABAP Editor:

...

       1.      Ensure that you are in change mode and position the cursor at the place where you want to insert the statement.

       2.      Choose Pattern.  

The Insert Statement Pattern dialog box appears. You can insert the following statement patterns:

Statement

Explanation

CALL FUNCTION

Inserts a function call.

ABAP Objects pattern

Inserts the following basic ABAP Objects statements:

CALL METHOD

CREATE OBJECT

RAISE EVENT

RAISE EXCEPTION

MESSAGE

Inserts a MESSAGE statement for a specified message. You need to enter a message ID, a message type and number.

SELECT * FROM

Inserts a SELECT FROM <table> statement. You need to enter a name of an existing table and then select the fields you want to be included in your SELECT statement.

PERFORM

Inserts a PERFORM statement for a specified form.

AUTHORITY-CHECK

Inserts an AUTHORITY-CHECK statement for a specified authorization object.

WRITE

Inserts a WRITE statement for a specified structure or table.

CASE

Inserts a CASE statement for a specified status.

Structured Data Object

·        With fields from structure

·        With TYPE for structure

Inserts a structured data object. 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.

       3.      Choose the required pattern and, if necessary, the statement.

       4.      Choose Continue.

       5.      Fill out the pattern with the required information.

       6.      Choose Continue to confirm your entries.

The system inserts the statement at the cursor position in the program code.

Example

The following source code is an example of the SELECT * FROM statement pattern:

SELECT SINGLE * FROM  spfli CLIENT SPECIFIED

       WHERE  mandt   = ___

       AND    carrid  = ___

       AND    connid  = ___.

The table used here is spfli and the fields containing the necessary data are mandt, carrid and connid.

End of Content Area