Suppressing Blanks in SAP ABAP
In SAP ABAP, you can control the display of extra spaces and blank lines to make the output appearance more predictable and neat. This is often referred to as “suppressing blanks.” Here’s how you can suppress blanks in ABAP:
- Leading Blanks: To remove leading spaces at the beginning of a line when using the
WRITE
statement, you can use theNO-GAP
addition:
WRITE: NO-GAP 'This will not have leading spaces.'.
- Trailing Blanks: To remove trailing spaces at the end of a line when using the
WRITE
statement, you can use theNO-GAP
addition as well:
WRITE: 'This will not have trailing spaces.' NO-GAP.
- Suppressing Blank Lines: If you want to prevent blank lines from being inserted in the output, you can use the
NO-TITLE
addition with theWRITE
statement:
WRITE: / 'Line 1', NO-TITLE, 'Line 2'.
This will ensure that there is no blank line inserted between “Line 1” and “Line 2.”
SAP ABAP | Basic Syntax & Statements
The German software company SAP created the high-level programming language, ABAP (Advanced Business Application Programming) primarily, this language serves as a tool for developing applications within the SAP R/3 system. Designed with simplicity and ease of learning in mind, ABAP syntax allows efficient processing of large volumes of data. Similar to COBOL, it offers a concise set of statements; these aid in the efficient management of large datasets. Typically, one writes ABAP code in the ABAP Editor, a component of SAP GUI (Graphical User Interface).
Table of Content
- SAP ABAP Satatements:
- How to format SAP ABAP Statements:
- Creating Your First SAP ABAP Program:
- Adding Comments in SAP ABAP:
- Suppressing Blanks in SAP ABAP
- Blank Lines in SAP ABAP:
- INSERT Lines in SAP ABAP:
- Handling Messages in SAP ABAP Code:
Basic Syntax of SAP ABAP:
REPORT [ Program_Name ].
[Statements.....]
Example:
REPORT Z_HELLO_WORLD.
WRITE 'Hello World'.
This simple example presents a SAP ABAP program. its function is to print ‘Hello World‘ on the screen. The first line in this example serves as a REPORT statement, precisely specifying the program’s name; meanwhile, the second ABAP statement, which writes ‘Hello World’ on-screen forms its subsequent line.