How to get decimal and integer part from a decimal number in ABAP SAP?

decimal part, integer part, decimal number, ABAP, SAP
Today, we will learn how to get decimal and integer part from a decimal number in ABAP SAP.

you can use standard macros to find the integer part and decimal part from a decimal number.
1. To get interger part use TRUNC( "decimal number" )
2. To get decimal (fractional) part use FRAC( "decimal number" )

Example:


Data: deci_number type P decimal 3.
Data: int_part type i.
Data: deci_part type p decimal 3.

int_part = TRUNC( deci_number ).
deci_part = FRAC( deci_number ).
Share on Google Plus

About JK STACK

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment