SAP REFRESH - Obsolete ABAP Statements

Get Example source ABAP code based on a different SAP table
  


Standard SAP Help for REFRESH_ITAB

REFRESH itab FROM

Short Reference
• REFRESH FROM TABLE ABAP Statement

ABAP Syntax(Obsolete)REFRESH itab FROM TABLE { dbtab | *dbtab }.

What does it do? The variant of the statement REFRESH that is forbidden in classes initializes the internal table itab, reads several rows from the database table dbtab, and adds their contents to the internal table itab. The row contents are cast to the row type of the internal table. If the row type of the internal is too short, then it is truncated from the right.

For dbtab, you must specify a database table that begins with 'T' and has a maximum length of five characters. For the database table dbtab, a table work area or an additional table work area must be declared using the statement TABLES. The internal table itab must be an index table. All components of the table work area that match the primary key fields of the database table dbtab must be character-type.

The lines to be read are determined by the content of the components of the table work area, which correspond with the primary key fields of the database table dbtab. The content of these components is taken, flush left, as a search key, and the system makes a generic search for suitable entries in the database table. The search key handles blanks as if they match all values.

If the database table does not match the specified naming conventions, then the statement's behavior is undefined.

System Fields This statement always sets sy-subrc to 0.

Latest notes:This form of the REFRESH statement must be replaced by the SELECT statement.
ABAP Code Snippet The obsolete access statements do not support automatic client handling. The client identifier of a database table must be specified explicitly. The application programs are only to work with data for the current client. In systems with multitenancy, this is checked by the ABAP runtime environment.
ABAP Code Snippet



Example ABAP Coding
Reads multiple ows from the database table T100
into an internal table itab. TABLES t100.
DATA itab TYPE STANDARD TABLE OF t100.
t100-sprsl = 'E'.
t100-arbgb = 'BC'.
REFRESH itab FROM TABLE t100.

The Open SQL syntax to be used instead reads:
NEXT EXAMPLE DATA itab TYPE STANDARD TABLE OF t100.
SELECT *
FROM t100
INTO TABLE itab
WHERE sprsl = 'E' AND
arbgb LIKE 'BC%'.



Runtime Exceptions
Non-catchable Exceptions
Reason for error:
No memory available to execute the statement.
Runtime error:
REFRESH_NO_SHORT_MEMORY

Return to menu