Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Max value for a varaible

Former Member
0 Kudos

Hi ,

I have a program with a variable used to store percentage , so let us assume ithas length 6 with 2 decimal places .

What i would like to know is there some command or a FM which can give me the max value that can be stored in this varaible . I do not want to write to much code or hardcode the value in the program .

Regards

Arun

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Arun,

Yo can use the FM 'MAXIMAL_VALUE_GET' for this.

Eg: Here I wanto calculate the max value for variable 'max'

DATA: max(5) TYPE p DECIMALS 3.

CALL FUNCTION 'MAXIMAL_VALUE_GET'
     IMPORTING
          e_value = max. 


WRITE: / max.

o/p: 999999,999

Hope this helps you.

Regards,

Manoj Kumar P

Edited by: Manoj Kumar on Jan 15, 2009 1:11 PM

4 REPLIES 4

Former Member
0 Kudos

it will take all values 999999.99 LE any value

Former Member
0 Kudos

999999.99 LE It will take all the values

Former Member
0 Kudos

Hi Arun,

Yo can use the FM 'MAXIMAL_VALUE_GET' for this.

Eg: Here I wanto calculate the max value for variable 'max'

DATA: max(5) TYPE p DECIMALS 3.

CALL FUNCTION 'MAXIMAL_VALUE_GET'
     IMPORTING
          e_value = max. 


WRITE: / max.

o/p: 999999,999

Hope this helps you.

Regards,

Manoj Kumar P

Edited by: Manoj Kumar on Jan 15, 2009 1:11 PM

Former Member
0 Kudos

Sorry,

Duplicate post.

Edited by: Manoj Kumar on Jan 15, 2009 1:10 PM