RAISE for Class-Based
Exceptions
Raises an exception.
A D V E R T I S E M E N T
Syntax
RAISE EXCEPTION TYPE
<class> | <ref>.
Terminates processing and
raises an exception of the exception class <class>. If the reference variable
<ref> points to an object of an exception class, <class> can be specified
instead of TYPE.
RAISE for Exceptions of Function
Modules and Methods
Raises exceptions.
Syntax
RAISE <except>.
Only occurs in function
modules and methods. Terminates processing and raises an exception <except>
defined in the interface.
RAISE for Events
Triggers events in ABAP
Objects.
Syntax
RAISE EVENT <evt>.
Only occurs in methods.
Triggers the event <evt> and calls all registered handler methods.
RANGES
Declares a RANGES table.
Syntax
RANGES <rangetab> FOR <f>.
Declares a RANGES table
for the field <f>. A RANGES table has the same data type as a selection table,
but is not linked to input fields on a selection screen.
READ for Files
Reads a file.
Syntax
READ DATASET <dsn> INTO
<f>
[MAXIMUM LENGTH <maxlen>]
[ACTUAL LENGTH <len>].
Reads the contents of the
file <dsn> on the application server to the variable <f>. The amount of data can
be specified using MAXIMUM LENGTH. The number of bytes transferred can be
written to <len> using ACTUAL LENGTH.
READ for any Internal
Table
Reads a line of an
internal table.
Syntax
READ TABLE <itab> FROM
<wa>
|WITH TABLE KEY <k1> = <f1>� <kn> = <fn>
|WITH KEY = <f>
|WITH KEY <k1> = <f1>� <kn> = <fn>
INTO <wa> [COMPARING <f1> <f2>� |ALL FIELDS]
[TRANSPORTING <f1> <f2>� |ALL FIELDS|NO FIELDS]
|ASSIGNING <FS>
|REFERENCE INTO <dref>.
This statement reads
either the line of the internal table with the same key as specified in the work
area <wa>, the line with the key specified in the TABLE KEY addition, the line
that corresponds fully to <f>, or the one corresponding to the freely-defined
key in the KEY addition. The contents of the line are either written to the work
area <wa>, or the line is assigned to the field symbol <FS>. If you assign the
line to a work area, you can compare field contents and specify the fields that
you want to transport.
READ for Index Tables
Reads a line of an
internal table.
Syntax
READ TABLE <itab> INDEX
<idx> INTO <wa>�
| ASSIGNING <FS>
| REFERENCE INTO <dref>.
The line with index 7 is
read. The result is specified as with any internal table.
READ for Lists
Reads the contents of a
line from a list.
Syntax
READ LINE <n> [INDEX <idx>]
[OF CURRENT PAGE|OF PAGE <p>]
|CURRENT LINE
[FIELD VALUE <f1> [INTO <g1>]� <fn> [INTO <gn>]].
Reads either the line <n>
on the current or specified list or page, or the last line to have been selected
by the user. The addition specifies the fields that you want to read, and the
target fields into which they should be placed. The entire line is always placed
in the system field SY-LISEL, and the HIDE area is filled for the line.
READ for Programs
Reads ABAP programs into
the program library.
Syntax
READ REPORT <prog> INTO <itab>.
Copies the lines of the
program <prog> into the internal table <itab>.
RECEIVE
Receives results from an
asynchronous function module call.
Syntax
RECEIVE RESULTS FROM
FUNCTION <func> [KEEPING TASK]
[IMPORTING � fi = a i� ]
[TABLES � fi = a i� ]
[EXCEPTIONS� ei = r i� ]
Occurs in special
subroutines to receive IMPORTING and TABLES parameters from function modules
called using the STARTING NEW TASK addition
TABLES
Declares an interface work
area.
Syntax
TABLES <dbtab>.
Declares a structure with
the same data type and the same name as a database table, a view, or a structure
from the ABAP Dictionary. Structures in main programs and subroutines declared
using TABLES use a common data area.
TOP-OF-PAGE
Event keywords for
defining event blocks for list events.
Syntax
TOP-OF-PAGE [DURING
LINE-SELECTION].
Whenever a new page begins
while a standard list is being created, the runtime environment triggers the
TOP-OF-PAGE event and the corresponding event block is executed. The addition
DURING LINE-SELECTION has the same function, but for detail lists.
TRANSFER
Writes to a file.
Syntax
TRANSFER <f> TO [LENGTH
<len>].
Writes the field <f> to
the file <dsn> on the application server. You can specify the length of the data
you want to transfer using the LENGTH addition.
TRANSLATE
Converts characters to
strings.
Syntax
TRANSLATE <c> TO
UPPER|LOWER CASE
|USING <r>.
The characters of the
string <c> are converted into upper- or lowercase, or according to a
substitution rule specified in <r>.
TRY
Introduces a TRY block.
Syntax
TRY.
Class-based exceptions can
be handled using the CATCH statement, within the block ended with ENDTRY.
TYPE-POOL
Introduces a type group.
Syntax
TYPE-POOL <tpool>.
The first statement in a
type group. This statement is not entered in the ABAP Editor, but is
automatically generated by the Dictionary in the ABAP Workbench. A type group is
an ABAP program that contains type definitions and constant declarations that
can be used in several programs.
TYPE-POOLS
Declares the types and
constants of a type group to a program.
Syntax
TYPE-POOLS <tpool>.
This statement allows you
to use all the data types and constants defined in the type group <tpool> in
your program.
TYPES for Single Field
Types
Defines a single field
type.
Syntax
TYPES <t>[(<length>)]
[TYPE <type>|LIKE <obj>] [DECIMALS <dec>].
Defines the internal data
type <t> in the program with length <len>, reference to the ABAP Dictionary type
<type> or a data object <obj>, and, where appropriate, with <dec> decimal
places.
Syntax
TYPES <t> TYPE REF TO
<class>|<interface>.
Defines the internal data
type <t> in the program with reference to the class <class> or the interface
<interface>.
Syntax
TYPES <t> TYPE REF TO
DATA|<type>.
Defines the internal data
type <t> as a data reference to a data object.
TYPES for Complex Types
Defines complex types.
Syntax
TYPES: BEGIN OF
<structure>,
�
<ti>�,
�
END OF <structure>.
Combines the data types <ti>
to form the structure <structure>. You can address the individual components of
a structure in a program using a hyphen between the structure name and the
component name as follows: <structure>-<t i>.
Syntax
TYPES <t> TYPE|LIKE <tabkind>
OF <linetype> [WITH <key>].
Defines the local data
type <t> in the program as an internal table with the access type <tabkind>, the
line type <linetype>, and the key <key>.
Syntax
TYPES <t> TYPE|LIKE RANGE
OF <type>|<obj>.
Defines the internal data
type <t> as a RANGES table. A RANGES table has the same data type as a selection
table, but is not linked to input fields on a selection screen.
ULINE
Places horizontal lines in
the display list.
Syntax
ULINE [AT
[/][<pos>][(<len>)]].
Without additions, creates
a new line on the current list and fills it with a horizontal line. The
additions allow you to insert a line break and specify the starting position and
length of the line.
UNPACK
Converts type P variables
to type C.
Syntax
UNPACK <f> TO <g>.
Unpacks the packed field
<f> and places it in the string <g> with leading zeros. This can be reversed
with the PACK statement.
UPDATE
Changes entries in
database tables.
Syntax
UPDATE <dbtab> SET <si>
= <f>
|<si> = <s i> + <f>
|<si> = <s i> - <f> [WHERE <cond>].
The value in the column <si>
is set to the value <f>, increases it by <f>, or decreases it by <f> for all
lines selected. The WHERE clause specifies the lines that are changed. If you
omit the WHERE clause, all lines are changed.
Syntax
UPDATE <dbtab> FROM <wa>.
UPDATE <dbtab> FROM TABLE
<itab>.
This deletes the line that
has the same primary key as the work area <wa>, or deletes all the lines in the
database that have the same primary key as a line in the internal table <itab>.
The work area <wa> or the lines of the internal table <itab> must have at least
the same length and alignment as the lines of the database table.
WHEN
Introduces a statement
block in a CASE control structure.
Syntax
WHEN <f1> [OR
<f 2> OR�] | OTHERS.
The statement block
following a WHEN statement is executed if the contents of the field <f> in the
CASE statement are the same as those of one of the fields <f
i
>. Afterwards, the program
carries on processing after the ENDCASE statement. The statement block after
WHEN OTHERS statement is executed if the contents of <f> does not equal any of
the <f i
> contents.
WHILE
Introduces a loop.
Syntax
WHILE <logexp>
[VARY <f> FROM <f1> NEXT <f2>].
Introduces a statement
block that ends with ENDWHILE. The statement block between WHILE and ENDWHILE is
repeated as long as the logical expression <logexp> is true, or until a
termination statement such as EXIT or CHECK occurs. The VARY addition allows you
to process fields the same distance apart in memory.
WINDOW
Displays a list as a modal
dialog box.
Syntax
WINDOW STARTING AT <x1>
<y1> [ENDING AT <x2> <y2>].
Only occurs in list
processing. The current detail list is displayed as a modal dialog box. The top
left-hand corner of the window is positioned at column <x1> and line <y1>. The
bottom right-hand corner is positioned at column <x2> and line <y2> (if
specified).
WRITE
Displays lists.
Syntax
WRITE [AT [/][<pos>][(<len>)]]
<f> [AS CHECKBOX|SYMBOL|ICON|LINE]
[QUICKINFO <g>].
[<format>]
The contents of the field
<f> are formatted according to their data type and displayed in the current
list. . The additions before the field allow you to specify a line break, the
starting position, and the length of the field. The additions after the field
allow you to display checkboxes, symbols, icons, and lines. The <format>
addition can contain various other formatting options. The QUICKINFO addition
allows you to assign a tool tip <g> to the field.
WRITE TO
Assigns string values.
Syntax
WRITE <f1> TO <f2>
[<format>].
Converts the contents of a
data object <f1> to type C, and assigns the resulting string to the variable
<f2>. You can use the same formatting options available in the WRITE statement
|