Get Example source ABAP code based on a different SAP table
ARTICLE
Syntax Revisions for Lists ABAP Code Snippet ARTICLE
Incorrect Dynamic Position Definition Dynamic position definitions are only allowed for WRITE or ULINE following the AT addition.
In ABAP Objects, and as of release 7.0 also outside of classes, the following statements cause an error message:
DATA: off TYPE i, len TYPE i. WRITE /off(len) f.
Correct syntax:
DATA: off TYPE i, len TYPE i. WRITE AT /off(len) f.
Reason:
Simplification of the syntax for offset/length specifications in output statements. Since the dynamic offset/length specification is only possible without the character for a new line (/) following AT , AT must always be used. ABAP Code Snippet ABAP Code Snippet ARTICLE
Cannot Use Obsolete Formatting Statements In ABAP Objects, you are allowed to use format entries that can also be expressed using a FORMAT statement.
In ABAP Objects, the following statements cause an error message:
DETAIL.
SUMMARY.
INPUT.
Correct syntax:
FORMAT INTENSIFIED OFF.
FORMAT INTENSIFIED ON.
FORMAT INPUT ON.
Cause:
These statements are now superfluous because they have been replaced by additions to the FORMAT and WRITE statements. ABAP Code Snippet ABAP Code Snippet ARTICLE
Cannot Perform Automatic Calculations While Using the WRITE Statement In ABAP Objects, you cannot use MAXIMUM, MINIMUM, or SUMMING to calculate values automatically when creating basic lists using the WRITE statement. .
In ABAP Objects, the following statements cause an error message:
MAXIMUM f. MINIMUM f. SUMMING f.
... WRITE f. ...
WRITE: / max_f, min_f, sum_f.
Correct syntax:
DATA: max_f like f, min_f like f, sum_f like f.
... WRITE f. IF max_f < f. max_f = f. ENDIF. IF min_f > f. min_f = f. ENDIF. sum_f = sum_f + f. ...
WRITE: / max_f, min_f, sum_f.
Cause:
These statements create the internal global variables max_f, min_f and sum_f. To make programs more readable, you should stopy using these statements and write explicit code instead. ABAP Code Snippet ABAP Code Snippet ARTICLE
Cannot Use MARK You cannot use the MARK statement in ABAP Objects.
In ABAP objects the following statement causes an error message:
MARK.
Reason:
The MARK statement is an R/2 system statement and is undocumented. You should use the documented statements for interactive list processing instead. ABAP Code Snippet ABAP Code Snippet ARTICLE
Missing Print Parameters in NEW-PAGE You can only use the NEW-PAGE PRINT ON statement to declare print parameters in ABAP Objects , provided there is no user dialog needed.
In ABAP Objects, the following statement causes an error message:
NEW-PAGE PRINT ON NO DIALOG.
Correct syntax:
DATA pripar TYPE pri_params, arcpar TYPE arc_params.
NEW-PAGE PRINT ON NO DIALOG PARAMETERS pripar ARCHIVE PARAMETERS arcpar.
Cause:
Printing without a user dialog and without consistent print parameters leads to errors in the printout. ABAP Code Snippet ABAP Code Snippet ARTICLE
Missing Print Parameters in SUBMIT The SUBMIT ... TO SAP-SPOOL statement may only be executed in ABAP objects if the print parameters are defined, unless there is a user dialog.
Error message in ABAP objects for:
SUBMIT report TO SAP-SPOOL WITHOUT SPOOL DYNPRO.
Correct syntax:
DATA pripar TYPE pri_params, arcpar TYPE arc_params.
SUBMIT report TO SAP-SPOOL WITHOUT SPOOL DYNPRO SPOOL PARAMETERS pripar ARCHIVE PARAMETERS arcpar.
Reason:
Printing without dialog and without consistent parameters results in an incorrect output. ABAP Code Snippet ABAP Code Snippet ARTICLE
NEW-SECTION not Allowed You cannot use the NEW-SECTION statement in ABAP Objects.
In ABAP Objects, the following statement causes an error message:
NEW-SECTION.
Correct syntax:
NEW-PAGE PRINT ON NEW-SECTION.
Cause:
You can reset the page counter using the NEW-PAGE PRINT ON statement. The NEW-SECTION statement is superfluous. ABAP Code Snippet ABAP Code Snippet ARTICLE
Cannot Use Constants in the HIDE Area In ABAP Objects and, as of release 7.0, ouside of classes, you can only write variables to the HIDEarea.
In ABAP Objects, the following statements acause an error message:
CONSTANTS f.
HIDE: '...', f.
Correct syntax:
DATA: f1, f2.
HIDE: f1, f2.
Cause:
Interactive list events cause the fields hidden by the HIDE command to be overwritten with values in the HIDE area, which means that they must be changeable.n. ABAP Code Snippet