Quantcast
Channel: SCN : Blog List - ABAP Development
Viewing all articles
Browse latest Browse all 943

Playing with WRITE: statement

$
0
0

This Program will write in almost all possible ways:

 

 

*&---------------------------------------------------------------------*

*& Report  ZGB_PRINTERS *

*&                                                                     *

*&---------------------------------------------------------------------*

*& *

*& *

*&---------------------------------------------------------------------*

 

REPORT ZGB_PRINTERS .

 

data: begin of t_itab occurs 0,

padest type tsp03-padest,

end of t_itab.

 

DATA: WORD(16) VALUE '0123456789ABCDEF',

COL TYPE I,

LEN TYPE I,

VAR TYPE C.

 

DATA: X TYPE P DECIMALS 3 VALUE '1.267',

Y TYPE F            VALUE '125.456E2'.

 

FORMAT INTENSIFIED INPUT.

write 10 var.

FORMAT INPUT OFF.

COL = 5.

LEN = 20.

 

*...+....10...+....20...+....30...+....40...+

 

  1. skip.

write:/ 'WRITE IN ROWS AND COLUMNS'.

 

WRITE AT 5 WORD.          "column 5

WRITE AT /COL(LEN) WORD.  "new line, column = contents of COL

COL = 40.

WRITE AT COL(LEN) WORD.  "new line, column = contents of COL

 

  1. skip.

write:/ 'WRITE CHECKBOXES'.

 

WRITE var AS CHECKBOX.

WRITE var AS CHECKBOX INPUT OFF.

 

  1. skip.

write:/ 'WRITE DECIMALS'.

 

WRITE: / X DECIMALS 0,  "output: 1

/ X DECIMALS 2,  "output: 1.27

/ X DECIMALS 5,  "output: 1.26700

/ Y DECIMALS 1,  "output: 1.3E+04

/ Y DECIMALS 5,  "output: 1.25456E+04

/ Y DECIMALS 20. "output: 1.25456000000000E+04

 

  1. skip.

write:/ 'WRITE SYMBOLS'.

 

INCLUDE <SYMBOL>.

WRITE: / SYM_RIGHT_HAND AS SYMBOL,    " output as symbol

'Tip, Note',

SYM_LEFT_HAND  AS SYMBOL.    " output as symbol

 

  1. skip.

write:/ 'WRITE ICONS'.

 

INCLUDE <ICON>.

WRITE: / ICON_OKAY AS ICON,         "output as icon

'Text line'.

 

  1. skip.

write:/ 'WRITE LINES AN SKIP 3 LINES'.

 

INCLUDE <LINE>.

ULINE /1(50).

WRITE: / SY-VLINE NO-GAP, LINE_TOP_LEFT_CORNER AS LINE.

ULINE 3(48).

WRITE: / SY-VLINE NO-GAP, SY-VLINE NO-GAP.

 

ULINE AT 10(10).

 

SKIP 3.

write: 'Skipped 3 lines.'.

SKIP TO LINE 22.

write: 'Skipped to Line 22.'.

SKIP to line 31.

write: 'Skipped to Line 31.'.

 

write:/ 'NEW PAGE AND NEW LINE NO SCROLLING'.

 

NEW-PAGE LINE-SIZE 255.

WRITE: / 'This line will be moved'.

NEW-LINE NO-SCROLLING.

WRITE: / 'This line will  n o t be moved'.

WRITE: / 'This line will be moved'.

 

FORMAT INTENSIFIED ON.

 

WRITE:/ 'This is a COL_BACKGROUND Color' COLOR COL_BACKGROUND.

FORMAT INVERSE ON. " Colors the text instead of the background

WRITE:/ 'This is a COL_HEADING Color' COLOR COL_HEADING.

FORMAT INVERSE OFF.

WRITE:/ 'This is a COL_NORMAL Color' COLOR COL_NORMAL HOTSPOT.

FORMAT HOTSPOT ON.

WRITE:/ 'This is a COL_TOTAL Color' COLOR COL_TOTAL.

FORMAT HOTSPOT OFF.

FORMAT INTENSIFIED OFF.

WRITE:/ 'This is a COL_KEY Color' COLOR COL_KEY.

 

 

The following output will be observed:

 

image001.png

 

image003.png


Viewing all articles
Browse latest Browse all 943

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>