02-02-2010 4:15 PM
Hi Experts,
I have four amount fields like following:
Amt1
Amt2
Amt3
Amt4
Now I have show the output with lower value among the aboe four.
i.e. Mininmum of Amt1 Amt2 Amt3 Amt4.
Ex: If,
Amt1 = 22.00
Amt2 = 451.00
Amt3 = 11.00
Amt4 = 126.00
The output should be Amt3 i.e 11.00.
I don't want to use LE, LT..kind of operaters.
Please let me know if there is any keyt word or short method for this.
Thanks
Naveen Inuganti
02-02-2010 4:25 PM
>
> I don't want to use LE, LT..kind of operaters.
Could you explain why? This is what LT is there for.
Rob
02-02-2010 4:37 PM
Hi Rob,
Just to avoid the answers with that solution.
Yes we can use it. It could be something like following.
If Amt1 lt Amt2.
If Amt1 lt Amt3.
If Amt1 lt Amt4.
Result = Amt1.
else.
Result = Amt4.
endif.
else.
If Amt3 lt Amt4.
Result = Amt3.
else.
Result = Amt4.
endif.
endif.
else.
If Amt2 lt Amt3.
If Amt2 lt Amt4.
Result = Amt2.
else.
Result = Amt4.
endif.
else.
If Amt3 lt Amt4.
Result = Amt3.
else.
Result = Amt4.
endif.
endif.
endif.
Its good if there is some thing like.. Lower of ( Amt1, Amt2, Amt3, Amt4 ) and I heared that this can be possible in other languages.
But not sure about this keyword in ABAP.
Thanks,
Naveen Inuganti
02-02-2010 4:47 PM
I suppose you can use something like fm ISP_MINIMUM_CALC but that just hides what is going on.
Alternatively, there is an obsolete keyword MINIMUM that you can check using F1.
Or put all the values into an internal table, sort them and then take the first value.
Rob
Edited by: Rob Burbank on Feb 2, 2010 11:52 AM