FORM - subr_identifier

Syntax

... subr
  | {subr|(sname) IN PROGRAM [prog|(pname)] [IF FOUND]}
  | {n OF subr1 subr2 ...}
  | {subr(prog) [IF FOUND]} ... .

Alternatives:

1. ... subr ... .

2. ... subr|(sname) IN PROGRAM [prog|(pname)] [IF FOUND] ... .

3. ... n OF subr1 subr2 ... .

4. ... subr(prog) [IF FOUND] ... .

Effect

These identifiers are used to specify subprograms, whereby subr is the name of the subprogram declared in the statement FORM, and prog is the name of an ABAP program. sname and pname are character-type fields that contain the name of a subprogram or a program during execution of the statement.

Alternative 1

... subr ... .


Effect

: subr can be used to call any subprogram of the same program. The subprogram must be available.

Alternative 2

... subr|(sname) IN PROGRAM [prog|(pname)] [IF FOUND]  ... .


Effect

: This specification is used to call any subprogram of another program or the current program. The subprogram and the program can either be specified statically as subr and prog (static external subprogram call), or dynamically in the character-type fields in parentheses sname and pname. When the statement is executed, sname and pname must contain the name of a subprogram or program in upper case (dynamic external subprogram call). If no entry is made after IN PROGRAM, the system searches for the subprogram within the current program.
If the addition IF FOUND is not specified, and the subprogram or program entered is not found, an untreatable exception occurs.
If the addition IF FOUND is specified and the entered program is not available, the statement PERFORM is ignored. If the specified program is available, if necessary, it is loaded into the internal session and searched for the specified subprogram. The event LOAD-OF-PROGRAM is not triggered. If the subprogram is available, the event LOAD-OF-PROGRAM is triggered (if it hasn't been already) and then the subprogram is executed.

Alternative 3

... n OF subr1 subr2 ... .


Effect

: With this specification, a subprogram subr of the same program is selected from a list. The list subr1 subr2 ... can contain up to 256 directly specified subprograms. For n, a numerical data object must be entered that contains a number between 1 and the specified number of subprograms during execution of the statement. The subprogram subr is called, whose list position is contained in n. In this variant, it is not possible to specify parameter_list and only subprograms without a parameter interface will be called.

Alternative 4

... subr(prog) [IF FOUND] ... .


Effect

: Is used to directly specify a subprogram subr of a program prog. If the specified subprogram or program is not available and the addition IF FOUND is specified, the statement PERFORM is ignored. Otherwise, this leads to an untreatable exception.

Note

: Because the direct program name prog is specified in subr(prog) [IF FOUND] rather than a character-type field in parentheses, this form of the identifier subr_identifier is only permitted outside classes. Instead, the specification should be used with the addition IN PROGRAM.