Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

logic needed for a requirement

Former Member
0 Likes
480

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

1 REPLY 1
Read only

Former Member
0 Likes
436

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