‎2007 Jan 08 1:59 AM
Hi,
I need to sum up the action message of MRP List, but in MDKP the action message is char type, Once i use select sum( AUSZ1, AUSZ2, AUSZ3... ), the complier not allow me to do that. Can I sum up in open sql? because i need to use internal table to export to ALV Format, if i cannot sum up at open sql, i need to loop the internal table and update it. The performance seems not good. Thanks.
‎2007 Jan 08 3:31 AM
sorry i cant get your actual requirement. But one thing you can not sum for character field in open sql . and it seems to me you want to COUNT the occurances. If it is so then use count fn instead of sum. Pls rectify me if i am wrong.
regards
shiba dutta
‎2007 Jan 08 6:42 AM
Thanks for your help first.
Actually, I would like to get the total number of action message in MRP List by each material, Using MD06, we can see that which separate 1-8 group for each action message,
for example, there have 2 action message under group 1 and 3 action message under group 6. In data dictionary, the type is char, i want to get the result is 5 (2+3). So, can i using open sql to retrieve the result. Thanks
‎2007 Jan 08 6:54 AM
Use Count Function and group by Message type.
for example -
Output the number of passengers, the total weight and the average weight of luggage for all Lufthansa flights on 28.02.2001:
DATA: count TYPE I, sum TYPE P DECIMALS 2, avg TYPE F.
DATA: connid TYPE sbook-connid.
SELECT connid COUNT( * ) SUM( luggweight ) AVG( luggweight )
INTO (connid, count, sum, avg)
FROM sbook
WHERE
carrid = 'LH' AND
fldate = '20010228'
GROUP BY connid.
WRITE: / connid, count, sum, avg.
ENDSELECT.
Message was edited by:
Amit Tyagi
‎2007 Jan 08 6:52 AM
what can i understand ferom your qery that you want the total no of rows for diferent message type.
if it is so
use count fn instead and give group by message type .
regards
shiba dutta