SAP NetWeaver AS ABAP Release 740, ©Copyright 2014 SAP AG. All rights reserved.
Syntax revisions in Data clusters
You Must Declare Identification
In ABAP Objects, the following statements cause an error message:
EXPORT f TO MEMORY.
IMPORT f FROM MEMORY.
FREE MEMORY.
Correct syntax:
EXPORT f TO MEMORY ID key.
IMPORT f FROM MEMORY ID key.
FREE MEMORY ID key.
Cause:
Without identification, all programs in a
call chain run in the same memory area. This leads to unpredictable results, particularly when complex
transactions are being performed.
Cannot Use Generic Identification
In ABAP Objects, the following statements cause an error message:
IMPORT ... FROM DATABASE dbtab(ar) ... MAJOR-ID maid
[MINOR-ID miid].
Correct syntax:
IMPORT ... FROM DATABASE dbtab(ar) ID id.
Cause:
The identification in the statement must be unique. If necessary, you must program the logic of the MAJOR-ID and MINOR-ID additions yourself.
Cannot Use Implicit Names in Clusters
In ABAP Objects, the following statements cause an error message:
EXPORT f1 ... fn TO ...
IMPORT f1 ... fn FROM ...
Correct syntax:
EXPORT name1 = f1 ... namen = fn TO ...
IMPORT name1 = f1 ... namen = fn FROM ...
or
EXPORT name1 FROM f1 ... namen FROM fn TO ...
IMPORT name1 TO f1 ... namen TO fn FROM ...
Cause:
Using implicit names is a source of error. The names declared are to be understood as
identification for the fields in the cluster. When the implicit method of exporting is used, the system
uses exactly the names declared, that is including any offset/length declarations or selector prefixes.
When the cluster is imported in another context, these names must be known and identically declared.
Using the equals sign (=) emphasizes the fact that formal parameters are to the left of the symbol and
actual parameters to the right - similar to how it is used in method and function module calls. The FROM and TO expressions are needed to declare the data repository.
No Use of Table Work Areas
The following cannot be used in ABAP Objects:
dbtab-... = ...
EXPORT ... TO DATABASE dbtab(ar) ID id.
EXPORT ... TO SHARED BUFFER dbtab(ar) ID id.
IMPORT ... FROM DATABASE dbtab(ar) ID id.
IMPORT ... FROM SHARED BUFFER dbtab(ar) ID id.
... = dbtab-
Correct syntax:
DATA wa TYPE dbtab.
wa-... = ...
EXPORT ... TO DATABASE dbtab(ar) ID id FROM wa.
EXPORT ... TO SHARED BUFFER dbtab(ar) ID id FROM wa.
IMPORT ... FROM DATABASE dbtab(ar) ID id TO wa.
IMPORT ... FROM SHARED BUFFER dbtab(ar) ID id TO wa.
... = wa-...
Reason:
If the addition FROM|TO wa is not specified, the system
tries to transport the user data fields of the table work area declared by TABLES. If the table work area is not found, the user data fields are not transported. A table work area can be declared in the
main program of local classes; however, it should not be used. In global classes the table work area cannot be used at all.
No Clusters in Files
Error message in ABAP Objects if the following syntax is used:
EXPORT ... TO DATASET ...
IMPORT ... FROM DATASET ...
Reason:
These statements are no longer supported.