SAP NetWeaver AS ABAP Release 751, ©Copyright 2017 SAP AG. All rights reserved.
ABAP - Keyword Documentation → ABAP - Reference → Calling and leaving program units → Calling Processing Blocks → Calling Procedures → PERFORM →
PERFORM - parameter_list
Syntax
... [TABLES itab1 itab2 ...]
[USING a1 a2 ...]
[CHANGING a1 a2 ...].
Extras:
1. ... TABLES itab1 itab2 ...
2. ... USING a1 a2 ...
3. ... CHANGING a1 a2 ...
Effect
These additions assign actual parameters to the formal parameters of the parameter interface of the subroutine subr. All data objects whose data type matches the
typing of the corresponding formal parameter can be specified (see
Check Typing) as actual parameters. Each formal parameter
assumes all the properties of the actual parameter assigned to it when it is called. The order of the additions is fixed.
... TABLES itab1 itab2 ...
Effect
The addition TABLES must be used to assign an internal table itab as the actual parameter to each table parameter t1 t2 ... (of the called subroutine) defined using the addition TABLES of the statement FORM. The assignment of the actual parameters to the formal parameters takes place using their positions in the lists t1 t2 ... and itab1 itab2 ....
Only standard tables
can be specified for itab. The pass is made by reference. If a specified table itab has a
header line, this is also
passed. If not, the header line in the corresponding table parameter t is initial when it is called.
Note
The use of table parameters in the interface for subroutines is obsolete, but a large number of subroutines
have not yet been switched to appropriately typed USING parameters or
CHANGING parameters. This means that they must still be filled by the addition TABLES of the statement PERFORM.
Example
Static call of the internal subroutine select_sflight while passing a table parameter.
PARAMETERS: p_carr TYPE sflight-carrid,
p_conn TYPE sflight-connid.
DATA sflight_tab TYPE STANDARD TABLE OF sflight.
...
PERFORM select_sflight TABLES sflight_tab
USING p_carr p_conn.
...
FORM select_sflight TABLES flight_tab LIKE sflight_tab
USING f_carr TYPE sflight-carrid
f_conn TYPE sflight-connid.
SELECT *
FROM sflight
WHERE carrid = @f_carr AND
connid = @f_conn
INTO TABLE @flight_tab.
ENDFORM.
... USING a1 a2 ...
... CHANGING a1 a2 ...
Effect
If the additions USING and CHANGING are specified,
a type-friendly actual parameter a1 a2 ... must be assigned to each of the
formal parameters u1 u2 ... and c1 c2 ... defined
using the same additions of the statement FORM.
Together, the actual parameters specified after USING and CHANGING
are a single shared list. They are assigned to the formal parameters using the position in the shared
list. The type of parameter passing is defined by the additions USING and
CHANGING of the statement FORM. The addition
USING must be in front of CHANGING. If not, the assignment of the
actual parameters to the additions USING and CHANGING
is ignored by the statement PERFORM. In addition, it does not matter whether both of the additions are specified or only one.
Notes
Example
The following five PERFORM statements have the same semantics but only the fourth is recommended, since it is the only one that documents the interface of the called subroutine.
DATA: a1 TYPE string,
a2 TYPE string,
a3 TYPE string,
a4 TYPE string.
PERFORM test USING a1 a2 a3 a4.
PERFORM test CHANGING a1 a2 a3 a4.
PERFORM test USING a1 CHANGING a2 a3 a4.
PERFORM test USING a1 a2 CHANGING a3 a4.
PERFORM test USING a1 a2 a3 CHANGING a4.
...
FORM test USING p1 TYPE string
p2 TYPE string
CHANGING value(p3) TYPE string
value(p4) TYPE string.
...
ENDFORM.