can anyone explain me what does the following statement mean :
GET_FRAME_TITLE: 2, 4, 8.</b>
you can find it in the sap standard program <b>RFKORD10</b>. Can anyone expain or guide me with documentation regarding this.
John Jakabcsin replied
This is a MACRO in ABAP terms. Double-click on GET_FRAME_TITLE and you will be taken to this syntax in the program.
PERFORM GET_FRAME_TITLE(SAPDBBRF) USING &1 TEXT&1.
... &1 ... &9 ...
The statement DEFINE defines a macro. Naming conventions apply to the name macro and you cannot use ABAP language elements. Between the statements DEFINE and END-OF-DEFINITION, you can use any number of complete ABAP statements, with the exception of DEFINE, END-OF-DEFINITION, and program-initiating statements. These statements constitute a section of source code that can be inserted into a program under the name macro. The definition of a macro is not restricted to the limits of processing blocks.
The validity of a macro is defined by its position in the source code. It can be inserted at any position after END-OF-DEFINITION. If another macro is defined with the same name, it overwrites the previous macro from its new position.
Within a macro, you can use up to nine placeholders &1 ... &9 instead of language elements and operands. These placeholders must be replaced by fixed words when the macro is inserted.
As well as in the source code of a program, you can also store macros in the database table TRMAC, where they can be used by any program. The system first searches in the current program for a macro, and then in the table TRMAC. Do not define your own macros in TRMAC. One example of a macro in TRMAC is break, which sets a breakpoint in the system field sy-uname, depending on the current user name.
In macros, you cannot set any breakpoints. In the ABAP Debugger, the statements of a macro cannot be performed in individual steps.
Macros must not include more than a few lines, and should be used sparingly, since it is very difficult to analyze macro errors. Instead of macros, use internal procedures or include programs.
macro [p1 p2 ... ].
If a previously defined macro is listed as the first word in an ABAP statement instead of a valid ABAP language element, then these statements are inserted in the source code at this position. Appropriate language elements or operands p1 p2 ... must be specified for all placeholders of the macro. p1 p2 ... replace the placeholders literally, one after the other.
A macro can insert other macros, but not itself.
In this example, a macro write_frame, which draws a frame around a placeholder &1 in a list, is defined and then implemented.
DATA: x TYPE i, y TYPE i, l TYPE i.
x = sy-colno. y = sy-linno.
WRITE: '|' NO-GAP, &1 NO-GAP, '|' NO-GAP.
l = sy-colno - x.
y = y - 1. SKIP TO LINE y. POSITION x.
ULINE AT x(l).
y = y + 2. SKIP TO LINE y. POSITION x.
ULINE AT x(l).
y = y - 1. x = sy-colno. SKIP TO LINE y. POSITION x.
write_frame 'In a frame!'.