SAP DELETE DBTAB - Obsolete ABAP Statements

Get Example source ABAP code based on a different SAP table
  


Standard SAP Help for DELETE_DBTAB

DELETE dbtab - VERSION
• DELETE dbtab ABAP Statement
• VERSION DELETE dbtab (obsolete)

ABAP Syntax(Obsolete)DELETE { dbtab | *dbtab } VERSION vers.

What does it do? This variant of the statement DELETE works essentially like the short form of the Open SQL Statement, but belongs, along with the VERSION addition, to the number of obsolete access statements, for which for dbtab, the name of a database table must be specified, beginning with 'T' and comprising no more than five characters.

The addition VERSION has the effect that it is not the dbtab database table, but instead the table whose name is made up of 'T' and the content of vers that is processed. vers expects a data object with a maximum of four characters, of type c . The contents of the key fields will continue to be obtained from the table work area dbtab or dbtab*. The statement is not executed if the database table does not exist or if it does not meet the name conventions given above.
INTHINT sy-subrc is set to 16, if access to the database specified
INTHINT by VERSION is not allowed by the dynamic package check.

Latest notes:The VERSION addition is not allowed in classes. Instead, specify the database table dynamically in its operand position in Open SQL. None of the additions possible in Open SQL must be specified together with VERSION.
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
TABLES t100.
DATA vers TYPE c LENGTH 4.
...
vers = '100'.
...
t100-sprsl = 'E'.
t100-arbgb = 'BC'.
t100-msgnr = '100'.
DELETE t100 VERSION vers.

The Open SQL syntax to be used instead reads:
NEXT EXAMPLE DATA: wa TYPE t100,
dbtab TYPE c LENGTH 5.
...
dbtab = 'T100'.
...
wa-sprsl = 'E'.
wa-arbgb = 'BC'.
wa-msgnr = '100'.
DELETE (dbtab) FROM wa.

Return to menu