ā2016 Feb 12 1:25 PM
Hello All.
We have requirements to get max value.
EG.:
| Days | ABC1 | ABC2 | ABC3 | ABC4 | ABC5 | ABC6 | Winner1 | Winner2 | Winner3 |
|---|---|---|---|---|---|---|---|---|---|
| Black | 12 | 52 | 5 | 45 | 30 | 27 | |||
| Blue | |||||||||
| Mismatch | |||||||||
Here,I give some output.
I am Using Module-Pool-Table Wizard..
I fill data manually in abc1, abc2, abc3, abc4, abc5 and abc6. when i enter at abc6 value then automatically insert maximum 3 value in winner1, winner2, winner3 fields of current raw.
Please Advise and Needful.
Thanx in Advance.
ā2016 Feb 12 1:43 PM
There's a built-in function nmax. But since you need three values, put them into an array (internal table), sort it descending and get the first three elements.
Horst
ā2016 Feb 14 10:07 AM
Hi,
Sorting an internal table for a simple max query sound like an overkill to me.
ā2016 Feb 15 6:32 AM
How would you do it?
Chintan needs the first three max values.
And itabs are fast and simple. I use them for such tasks very often.
ā2016 Feb 15 11:51 AM
My fault
I missed the three max values thing.
Using itab would be a good option then.
ā2016 Feb 17 12:23 PM
Yes. You are right Mr. Horst. max value is imp to tk it.
Got max 3 value with sorting.
thanx for d suggestions. its very halpful for me.
thank you so much.
ā2016 Feb 12 2:24 PM
Hi Chintan,
You should take a look at DEMO_DYNPRO_TABLE_CONTROL_1.
That demo program will show you how to read a input line and then just write a loop that compares the itab structure to find the max value for each line that was changed and set the winner field to what ever value you want.
Hope this helps,
Geoffery
ā2016 Feb 12 3:13 PM
ā2016 Feb 14 10:19 AM
Hi Horst,
how it is you program and it is created by SAP?
it was created in 1998.
Tahnk you
Regards
Ebrahim
ā2016 Feb 14 10:49 AM
Hi,
It seems that SAP programs are actually created by real people, like Horst.
He is a famous SAP employee
cheers
Paul
ā2016 Feb 14 10:56 AM
Hi Paul,
thank you for this Info.
I did not know that, it is really interesting
Respect Dr Horst
Regards
Ebrahim
ā2016 Feb 14 1:53 PM
Its part of my package SABAPDEMOS that contains the executable examples of the ABAP documentation's example library.
ā2016 Feb 15 4:48 PM
ā2016 Feb 17 8:21 AM
Hi Horst.,
I have just read about it, The examples in SABAPDEMOS are very useful and interesting.
Thank you.
Regards
Ebrahim
ā2016 Feb 17 8:25 AM
Hi Richard,
when I was started to learn ABAP, I have started with BC400, BC401 ( ABAP Object) BC430 etc.
I have done this to get the certificate.
ā2016 Feb 17 8:52 AM
Hi Ebrahim,
I was not doubting your education, I was (in an English way) pointing out Horst Keller's background.
I think we can put this one down to 'Lost In Translation'....
Rich
ā2016 Feb 17 9:48 AM
ā2016 Feb 13 10:54 AM
Problem Resolved.
Its really helpful for me.
Thank you so much.