Application Development 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: 

Problem with Select MAX( field ) in OO

Former Member
0 Kudos

Hi all,

I have this statement:

SELECT SINGLE RUECK MAX( RMZHL ) BUDAT STZHL

INTO K_CONFIRM

FROM AFRU

WHERE AUFNR EQ P_ORDER

AND VORNR EQ P_OPER

GROUP BY RUECK RMZHL BUDAT STZHL.

My requirement is I need to use a work area (not an internal table) and ENDSELECT is not allowed. The result is not selecting the Maximum RMZHL, it will always return the first record.

How can I correctly do this in OO? Thanks in advanc.e

2 REPLIES 2

Former Member
0 Kudos

If you use GROUP BY in your query then the set functions (MAX,SUM, Count) not possible...

refer:

http://help.sap.com/saphelp_nw70/helpdata/en/be/c7fe3f70cac342e10000000a1550b0/frameset.htm

0 Kudos

Not working, It prompt error of missing GROUP BY in OO.