‎2008 Apr 03 1:49 PM
Hi Experts,
i have Internal table(itab) while debuging i am getting fellowing type of records.
KSCHL KBETR WAERS
ZZ10 | 200.00 |EUR
ZPNL | 117.00 |EUR
ZPRA | 115.00 |EUR
ZZ10 | 300.00 |EUR
ZZ10 | 200.00 |EUR
ZZ10 | 350.00 |EUR.
i want to compare the ZZ10 values, I need the lowest value, how to compare?
in the above i need zz10 with the value of 200 only.
How to compare, and how to select the lowest value only.
Any one help this,
Point will be sure.
Mohana
‎2008 Apr 03 1:54 PM
Help require in Internal table condition
Posted: Apr 3, 2008 8:49 AM E-mail this message Reply
Hi Experts,
i have Internal table(itab) while debuging i am getting fellowing type of records.
KSCHL KBETR WAERS
ZZ10 | 200.00 |EUR
ZPNL | 117.00 |EUR
ZPRA | 115.00 |EUR
ZZ10 | 300.00 |EUR
ZZ10 | 200.00 |EUR
ZZ10 | 350.00 |EUR.
i want to compare the ZZ10 values, I need the lowest value, how to compare?
in the above i need zz10 with the value of 200 only.
How to compare, and how to select the lowest value only.
Any one help this,
Point will be sure.
Mohana
sort table by kscl kbetr.
loop at itab where kschl = 'ZZ10'.
AT FIRST.
" you have your lowest value
ENDAT.
endloop.
‎2008 Apr 03 1:51 PM
sort the table KSCHL KBETR and take for every new KSCHL take the first entry using
for example ON CHANGE OF, or AT NEW.
‎2008 Apr 03 1:54 PM
Help require in Internal table condition
Posted: Apr 3, 2008 8:49 AM E-mail this message Reply
Hi Experts,
i have Internal table(itab) while debuging i am getting fellowing type of records.
KSCHL KBETR WAERS
ZZ10 | 200.00 |EUR
ZPNL | 117.00 |EUR
ZPRA | 115.00 |EUR
ZZ10 | 300.00 |EUR
ZZ10 | 200.00 |EUR
ZZ10 | 350.00 |EUR.
i want to compare the ZZ10 values, I need the lowest value, how to compare?
in the above i need zz10 with the value of 200 only.
How to compare, and how to select the lowest value only.
Any one help this,
Point will be sure.
Mohana
sort table by kscl kbetr.
loop at itab where kschl = 'ZZ10'.
AT FIRST.
" you have your lowest value
ENDAT.
endloop.
‎2008 Apr 03 1:56 PM
sort ur itab and use select single * from itab where kschl = 'zz10'
U never close ur thread ?
‎2008 Apr 03 2:00 PM
Better SORT internal T with kschl,kbetr..
else
use some Aritmetic fun:-MIN
‎2008 Apr 03 2:02 PM
sort i_tab by kschl kbetr.
select single * from i_tab where kschl = 'ZZ10'.
reward if useful.
‎2008 Apr 03 2:11 PM
declare another internal table jtab of same structre as itab.
for all KSCHL with same name as ZZ10. append the row with least value to jtab.
SORT itab BY KSCHL KBETR WAERS.
LOOP AT itab.
ON CHANGE OF KSCHL.
APPEND itab TO jtab.
CLEAR itab.
ENDON.
ENDLOOP.
All the other records that have KSCHL in common are sorted and the lowest value record is appended to the jtab int tab.
READ TABLE jtab with key KSCHL = 'ZZ10'.
if sy-subrc = 0.
(DO WHAT EVER U WANT WITH THE RECORD & VALUE YOU WANT)
endif.
Regards,
Srinivas