2008 Dec 03 9:48 AM
Hi experts.
In the table EKEH I need the max value of ABRUF by passing the ebeln and ebelp.
the ebeln and ebelp is in one internal table. my problem is when i using the select query with all entries the aggrigate function like MAX(ABRUF) cannot be used and i need to avoid the select statement inside the loop.
So is there any other way to get the max value of ABRUF by passing the ebeln and ebelp from an internal table
Thanks in advance
sai
Hi experts.
In the table EKEH I need the max value of ABRUF by passing the ebeln and ebelp.
the ebeln and ebelp is in one internal table. my problem is when i using the select query with all entries the aggrigate function like MAX(ABRUF) cannot be used and i need to avoid the select statement inside the loop.
So is there any other way to get the max value of ABRUF by passing the ebeln and ebelp from an internal table
Thanks in advance
sai
2008 Dec 03 10:01 AM
Hi Sai,
The alternative for all the records with a single select will be
-
select all records----
select * from EKEH into table int_XXX for ebeln and ebelp for all entries.....
-
based on location in code where max value needs to be read----
take a single ebeln & ebelp
refresh int_ABRUF .
-
Read max value----
loop at int_XXX where ebeln & ebelp = required ebeln & ebelp.
append int_XXX to int_ABRUF.
endloop.
sort int_ABRUF by ABRUF descending.
read table int_ABRUF index 1.
but again select max() can be used if there are less ebeln+ebelp combinations and number of select calls in the logic comparitively less..otherwise try the above suggestion
Hope it helps
Regards
Byju