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

Problem with Select MAX( field ) in OO

Former Member
0 Likes
630

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

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
Read only

Former Member
0 Likes
545

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

Read only

0 Likes
545

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