ABAPEXEC_IMPLICIT - EXEC IMPLICIT

SUBST_MERGE_LIST - merge external lists to one complete list with #if... logic for R3up   General Data in Customer Master  
This documentation is copyright by SAP AG.

EXEC SQL - PERFORMING

Short Reference



Obsolete Syntax

EXEC SQL PERFORMING subr./>
  SELECT ... INTO :wa1 :wa2 ...
ENDEXEC.

Effect

If the PERFORMING addition that is forbidden in classes is specified after EXEC SQL, thenative SQL interface performs an implicit cursor processing.

Only a SELECT statement can be used as a native SQL statement. The native SQL interface startsa cursor for the SELECT statement and reads the appropriate data, row by row. After each successfulread of a row, the subr subroutine is called. The subr subroutine must be defined in the same ABAP program and must not have any parameter interface.

When the host variablesspecified in the SELECT statement after INTO are global data objects of the ABAP program,they can be evaluated in the subroutine. In the subroutine, sy-dbcnt gets the number of rowsread so far and sy-subrc is set to the value 0. After the ENDEXEC statement, sy-dbcntcontains the number of rows read altogether so far and sy-subrc is set to value 4 since no more lines could be read using the implicit cursor.

Note

Implicit cursor processing using the PERFORMING addition is obsolete and not allowed in classes since methods of global classes do not have any access to the global data and the subroutines of the calling ABAP program. Instead,explicit cursor processing should be used.

  • The likewise obsolete EXIT FROM SQL statement can also be used to exit implicit cursor processing.


Example

Reading several rows from the database table SCARR and calling the subroutine evaluate for each row read.

DATA wa TYPE spfli-carrid.

EXEC SQL PERFORMING evaluate.
  SELECT carrid FROM spfli INTO :wa
ENDEXEC.

FORM evaluate.
  WRITE / wa.
ENDFORM.


General Data in Customer Master   General Data in Customer Master  
This documentation is copyright by SAP AG.


Length: 2751 Date: 20120522 Time: 053459     triton ( 95 ms )