DEFINE (ABAP Keyword) introduction and details and syntax
DEFINE
Basic
form
DEFINE macro.
Effect
Defines a program component (macro) under
the name macro . It must consist only of ABAP/4 statements and is expanded at
compilation time.
A macro should always be concluded with the
END-OF-DEFINITION statement.
In the definition, you can use &n to
reference positional parameters (n = 0 .. 9). When the macro is called, &n
is replaced by the n-th actual parameter.
Example
Define a macro
called "++" for use in the program.
DEFINE ++.
ADD 1 TO
&1.
END-OF-DEFINITION.
DATA: NUMBER TYPE I VALUE 1.
...
++
NUMBER.
Notes
In general, it is better to use subroutines
(FORM , FUNCTION ) rather than macros because subroutines - unlike macros - are
supported by all the ABAP/4 Development Workbench tools (including debugging,
runtime analysis, runtime error handling, ...).
You cannot nest macro
definitions.
Related 10 ABAP Syntax Tutorials
Most readed SAP Tutorials
- WRITE - Output to a list ( SAP ABAP Keyword)
WRITE ( Output to a list ) is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. - List of SAP HR TABLES and Infotypes tables
Detailed full list of tables and infotypes used in SAP HR module. - List of SAP MM Transaction codes
This documentation covers the details of SAP MM Transaction codes - SELECT-OPTIONS ( SAP ABAP Keyword)
SELECT-OPTIONS is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. - FI Accounts Receivable and Accounts Payable | SAP FI PDF manual
The following topics are an introduction to the Accounts Receivable and Accounts Payable application components. - SAP MM Process Flow
The typical procurement cycle for a service or material consists of the following phases: - SELECT clause ( SAP ABAP Keyword)
SELECT clause is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details.
Latest Added SAP documents
- 9KE9 Transaction code
Details about SAP transaction code 9KE9 - 9KE8 Transaction code
Details about SAP transaction code 9KE8 - 9KE7 Transaction code
Details about SAP transaction code 9KE7 - 9KE6 Transaction code
Details about SAP transaction code 9KE6 - 9KE5 Transaction code
Details about SAP transaction code 9KE5 - 9KE4 Transaction code
Details about SAP transaction code 9KE4 - 9KE3 Transaction code
Details about SAP transaction code 9KE3 - 9KE2 Transaction code
Details about SAP transaction code 9KE2 - 9KE1 Transaction code
Details about SAP transaction code 9KE1 - 9KE0 Transaction code
Details about SAP transaction code 9KE0