SAP READ TABLE DBTAB ABAP Statements



Get Example source ABAP code based on a different SAP table
  


• READ TABLE dbtab ABAP Statement

READ TABLE dbtab
Short Reference

ABAP_SYNTAX_OBS
READ TABLE ${ dbtab $| *dbtab $}
$[WITH KEY key$]
$[SEARCH ${FKEQ$|FKGE$|GKEQ$|GKGE$}$]
$[VERSION vers$].

ABAP Addition
1 ... WITH KEY key
2 ... SEARCH ${FKEQ$|FKGE$|GKEQ$|GKGE$}
3 ... VERSION vers

What does it do?
This variant of the statement READ, which is forbidden in classes, reads a row from the database table dbtab or from a DDIC table view and assigns the content to a work area.
A table work area dbtab or *dbtab is used implicitly as the work area. This table work area must be declared using the statement TABLES. If the name *dbtab is used instead of the name of the database table or view dbtab, dbtab is accessed, but the additional table work area is used. All components of the table work area that match the primary key fields of the database table or view dbtab must be character-like.
dbtab expects a database table or DDIC table view that starts with T and has a maximum length of five characters. If a database table or view is specified that does not begin with T, the first letter is implicitly replaced by T.
Without the addition WITH KEY, the row to be read is determined by the content of the components of the table work area that match the primary key fields of database table or view dbtab.
System Fields sy-subrcMeaning 0A table entry was read. 4No table entry was found for the specified search key. 8The table work area is too short. 12The database table or view was not found.



Latest notes:

This form of READ statement is not allowed in classes. It must be replaced by the SELECT statement.