Software Development Exam  >  Software Development Notes  >  Learn and Master SAP ABAP  >  SAP ABAP - Formatting Data

SAP ABAP - Formatting Data | Learn and Master SAP ABAP - Software Development PDF Download

ABAP offers various types of formatting options to format the output of programs. For example, you can create a list that includes various items in different colors or formatting styles.

The WRITE statement is a formatting statement used to display data on a screen. There are different formatting options for the WRITE statement. The syntax of the WRITE statement is −

WRITE <format> <f> <options>.

In this syntax, <format> represents the output format specification, which can be a forward slash (/) that indicates the display of the output starting from a new line. In addition to the forward slash, the format specification includes a column number and column length. For example, the WRITE/04 (6) statement shows that a new line begins with column 4 and the column length is 6, whereas the WRITE 20 statement shows the current line with column 20. The parameter <f> represents a data variable or numbered text.

The following table describes various clauses used for formatting −
SAP ABAP - Formatting Data | Learn and Master SAP ABAP - Software Development

Following are the formatting options for Numeric Type fields −

SAP ABAP - Formatting Data | Learn and Master SAP ABAP - Software Development

For instance, the following table shows different formatting options for the date fields −

SAP ABAP - Formatting Data | Learn and Master SAP ABAP - Software Development

Here, DD stands for the date in two figures, MM stands for the month in two figures, YY stands for the year in two figures, and YYYY stands for the year in four figures.
Let’s take a look at an example of ABAP code that implements some of the above formatting options −

REPORT ZTest123_01.

 

DATA: n(9) TYPE C VALUE 'Tutorials', 

m(5) TYPE C VALUE 'Point'. 

WRITE: n, m. 

WRITE: / n, 

/ m UNDER n. 

WRITE: / n NO-GAP, m. 

DATA time TYPE T VALUE '112538'. 

WRITE: / time, 

/(8) time Using EDIT MASK '__:__:__'.

The above code produces the following output −

Tutorials Point 

Tutorials  

Point 

TutorialsPoint 

112538 

11:25:38

The document SAP ABAP - Formatting Data | Learn and Master SAP ABAP - Software Development is a part of the Software Development Course Learn and Master SAP ABAP.
All you need of Software Development at this link: Software Development
73 videos|68 docs

Top Courses for Software Development

73 videos|68 docs
Download as PDF
Explore Courses for Software Development exam

Top Courses for Software Development

Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev
Related Searches

Viva Questions

,

Previous Year Questions with Solutions

,

practice quizzes

,

Summary

,

Objective type Questions

,

study material

,

pdf

,

Extra Questions

,

Free

,

Sample Paper

,

MCQs

,

ppt

,

SAP ABAP - Formatting Data | Learn and Master SAP ABAP - Software Development

,

video lectures

,

past year papers

,

SAP ABAP - Formatting Data | Learn and Master SAP ABAP - Software Development

,

shortcuts and tricks

,

SAP ABAP - Formatting Data | Learn and Master SAP ABAP - Software Development

,

Semester Notes

,

mock tests for examination

,

Exam

,

Important questions

;