Intro to ABAP Chapter 03

background image

BC170_2.03.1

Simple Output Statements

background image

BC170_2.03.2

Objectives

• The participants will be able to:

– Create basic output lists using the WRITE

statement

– Add formatting to an ABAP report

– Use the NEW-PAGE command
– Add Icons to an ABAP report
– Maintain Page Headers

– Use Text Symbols in ABAP Code

background image

BC170_2.03.3

The ABAP WRITE Statement

WRITE

‘********************’.

SKIP 2

.

WRITE

:

‘The date today is:’, SY-

DATUM,

‘The current time is:’, SY-

UZEIT.

SKIP

.

WRITE

‘********************’.

<program title>
1
--------------------------------------------------------------------
------------
********************

The date today is: 12/30/1996 The current time
is: 12:32:06

********************

Notice that there is an

automatic space

between the fields

written to the list.

background image

BC170_2.03.4

ABAP Format Specifications

WRITE 10 ‘***** City of Philadelphia *****’.
SKIP 2.
WRITE:

10

‘Ticket Date’, SY-DATUM.

WRITE:

/10

‘Ticket Time’, SY-UZEIT.

ULINE /10(60)

.

SKIP 2.
WRITE 10 ‘***** Department of Public Safety

*****’.

***** City of Philadelphia *****

Ticket Date 01/01/1997
Ticket Time 18:01:00
---------------------------------------------------
--

***** Department of Public Safety
*****

background image

BC170_2.03.5

ABAP Format Options

WRITE 10 ‘***** City of Philadelphia *****’.
SKIP 2.
WRITE: 10 ‘Ticket Date’, 25 SY-DATUM,

/10 ‘Ticket Time’, SY-UZEIT

UNDER

SY-

DATUM.

ULINE /10(60).
SKIP 2.
WRITE 10 ‘***** Department of Public Safety

*****’.

***** City of Philadelphia *****

Ticket Date 01/01/1997
Ticket Time 18:01:00
-------------------------------------------------------
-----

***** Department of Public Safety *****

background image

BC170_2.03.6

WRITE Statement Extended

Syntax

WRITE

<format>

<value>

<options>

.

/p(I)
/ = Line Feed
p = Column Position
I = Output Length

<format>

Program Field or
Text Literal

<value>

Format Options

<options>

background image

BC170_2.03.7

WRITE ‘***** City of Philadelphia *****’.
SKIP.
WRITE: / ‘Ticket Date’, 15 SY-DATUM.
WRITE: / ‘Ticket Time’, 15 SY-UZEIT.
SKIP.
WRITE ‘***** Department of Public Safety

*****’.

NEW-PAGE.

WRITE: ‘Comments:’.

<program title> 1

--------------------------------------------------------------------------------------

***** City of Philadelphia *****

Ticket Date 01/01/1997

Ticket Time 18:01:00

***** Department of Public Safety *****
<program title> 2

---------------------------------------------------------------------------------------

Comments:

NEW-PAGE Statement

background image

BC170_2.03.8

Writing Icons and Symbols

INCLUDE <ICON>.
INCLUDE <SYMBOL>.

WRITE: /10 ICON_DATE

AS ICON

, SY-DATUM,

SYM_LEFT_HAND

AS SYMBOL

.

background image

BC170_2.03.9

Maintaining Page Headers

The title comes

from the

program’s

attributes.

List header will

replace title on first

line of standard

header.

Up to four lines of

column headings can

be maintained for the

list.

background image

BC170_2.03.10

Numbered Texts (Text Symbols)

Text symbols are

referenced by a unique

three-character code.

WRITE: /

TEXT-001

, BIRTHDAY,

/

TEXT-002

, SY-DATUM.

background image

BC170_2.03.11

Text Element Output

TEXT-
001

TEXT-
002

WRITE: /

TEXT-001

, BIRTHDAY,

/

TEXT-002

, SY-DATUM.

background image

BC170_2.03.12

Summary

• The participants should be able to:

– Create basic output lists using the WRITE

statement

– Add formatting to an ABAP report

– Use the NEW-PAGE command
– Add Icons to an ABAP report
– Maintain Page Headers

– Use Text Symbols in ABAP Code


Document Outline


Wyszukiwarka

Podobne podstrony:
Intro to ABAP Chapter 13
Intro to ABAP Chapter 07
Intro to ABAP Chapter 12
Intro to ABAP Chapter 15
Intro to ABAP Chapter 08
Intro to ABAP Chapter 11
Intro to ABAP Chapter 01

więcej podobnych podstron