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: 

Sum Eror Example Select SUM( A * B ) From A into ls_data-sum.

4 REPLIES 4

Sandra_Rossi
Active Contributor
485

Please post the code as text instead of image, so that one can easily answer by copying your code in order to complete it. Then, select your code and press the button [CODE], which makes the code appear colored/indented, it will be easier for people to look at it. Thank you!

0 Kudos
485
select sum( mssl~sllab * eine~netpr )
from mssl
inner join eina on mssl~matnr = eina~matnr and mssl~lifnr = eina~lifnr
inner join eine on eine~infnr = eina~infnr
into ls_data-netpr_service
where mssl~sllab GT 0
and eina~loekz EQ ''
and eina~lifnr EQ ls_lfa1-lifnr

0 Kudos
485

can you help me please?
or can not support for this code in sap?

Sandra_Rossi
Active Contributor
0 Kudos
485

If I write this code:

DATA netpr_service TYPE i.
SELECT SUM( mssl~sllab * eine~netpr )
 FROM mssl
 INNER JOIN eina ON mssl~matnr = eina~matnr AND mssl~lifnr = eina~lifnr
 INNER JOIN eine ON eine~infnr = eina~infnr
 INTO netpr_service
 WHERE mssl~sllab GT 0
 AND eina~loekz EQ ''
 AND eina~lifnr EQ ''.

I have this error message (ABAP 7.52):

If the new Open SQL syntax is used, it must be used throughout.
This includes using @ to escape host variables.

So, replacing this line, the program activates:

into @netpr_service