05-11-2006 1:43 PM
Hi all,
I have 2 values,
a = 2300.
b = 2700.
I want to find the minimum value of this 2 by using "Min" function can you tell me the syntex.
05-11-2006 1:45 PM
hii
use less than
if (a < b)
write:/ a ,is minimum .
else.
write:/ b ,is minimum .
hope this helps
Thanks& Regards
Naresh
05-11-2006 1:48 PM
Hi u dont have seperately 'MIN' function.
But u can have aggregate function to be used in the select statement.
If u want which is smaller.
U can use.
If a>b.
Write: b 'is minimum'.
endif.
cheers
simha.
05-11-2006 1:48 PM
hi
if u want the syntax is
MIN( [DISTINCT] fdescriptor )
check this code
DATA: name TYPE scustom-name,
postcode TYPE scustom-postcode,
city TYPE scustom-city,
min TYPE sbook-loccuram.
SELECT scustom~name scustom~postcode scustom~city
MIN( sbook~loccuram )
INTO (name, postcode, city, min)
FROM scustom INNER JOIN sbook
ON scustom~id = sbook~customid
WHERE sbook~fldate BETWEEN '20010101' AND '20011231' AND
sbook~carrid = 'LH ' AND
sbook~connid = '0400'
GROUP BY scustom~name scustom~postcode scustom~city
ORDER BY scustom~name.
WRITE: / name, postcode, city, min.
ENDSELECT.
05-11-2006 1:49 PM
Use the following logical operators to compare two data objects with different data types:
<operator>
Meaning
EQ
equal to
=
equal to
NE
not equal to
<>
not equal to
><
not equal to
LT
less than
<
less than
LE
less than or equal to
<=
less than or equal to
GT
greater than
>
greater than
GE
greater than or equal to
>=
greater than or equal to
regards
vinod
05-11-2006 1:49 PM
Hi Manankumar,
Create your own Z function module.To the Function module give two values as Import parameters and Get the minimum value as Export Parameter.
The code for Function module as follows.
FUNCTION ZMINMUM.
*"----
""Local Interface:
*" IMPORTING
*" REFERENCE(I_VALUE1) TYPE I
*" REFERENCE(I_VALUE2) TYPE I
*" EXPORTING
*" REFERENCE(E_MIN) TYPE I
*"----
if i_value1 < i_value2.
e_min = i_value1.
else.
e_min = i_value2.
endif.
ENDFUNCTION.
Assign function module to a Function group.
Thanks,
Vinay
05-11-2006 1:58 PM
HI
GOOD
THE SYNTAX IS
MIN( [DISTINCT] col)
IT RETURNS THE MINIMUM VALUE IN THE COLUMN COL.
THANKS
MRUTYUN
05-11-2006 2:04 PM
hi
u have create your z fun.
pass 2 values to it.
return minimun value from it.
u can calculate min value using,
if a < b.
min = a.
else.
min = b.
endif.