0% found this document useful (0 votes)
296 views

Zb14 Math Function

This document defines variables and constants to perform mathematical functions in ABAP. It declares data types for variables to store the results of sign, absolute value, ceiling, floor, truncation, fraction, and square root functions. It defines a selection screen parameter for a numeric input and clears the variables. The mathematical functions are then applied to the input and the results are written out along with descriptive text.

Uploaded by

Kishore Reddy
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
296 views

Zb14 Math Function

This document defines variables and constants to perform mathematical functions in ABAP. It declares data types for variables to store the results of sign, absolute value, ceiling, floor, truncation, fraction, and square root functions. It defines a selection screen parameter for a numeric input and clears the variables. The mathematical functions are then applied to the input and the results are written out along with descriptive text.

Uploaded by

Kishore Reddy
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

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

*& Report ZB14_MATH_FUNC


*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT

zb14_math_func.

* Data Declarations
DATA:gv_sign TYPE i,

gv_abs TYPE i,
gv_ceil TYPE p DECIMALS
gv_floor TYPE i,
gv_trunc TYPE i,
gv_frac TYPE p DECIMALS
gv_sqrt TYPE p DECIMALS

3,

3,
3.

* Define constants
CONSTANTS:gc_title TYPE

string

VALUE 'Mathematical Functions'.

* define the selection screen with single input fields


PARAMETERS:p_num TYPE

DECIMALS 3

DEFAULT '5789.896'.

* Clear the data


CLEAR:gv_sign,

gv_abs,
gv_ceil,
gv_floor,
gv_trunc,
gv_frac.

OBLIGATORY

* Mathematical Functions

gv_sign = SIGN( p_num ).


gv_abs = ABS( p_num ).
MOVE ceil( p_num ) TO gv_ceil.
gv_floor = FLOOR( p_num ).
gv_trunc = TRUNC( p_num ).
gv_frac = FRAC( p_num ).
gv_sqrt = SQRT( gv_trunc ).

ULINE.
WRITE:/

gc_title COLOR 6.
WRITE:/ text-002,gv_sign,/ text-003, gv_abs,
/ text-004, gv_ceil,/ text-005, gv_floor,
/ text-006, gv_trunc,/ text-007, gv_frac,
/ text-008, gv_sqrt.
ULINE.
TEXT SYMBOLS:
002 SIGN:
003 ABS:
004 CEIL:
005 FLOOR:
006 TRUNC:
007 FRAC:
008 SQRT:

You might also like