Skip to Content
0

SAP Query - SQ02 custom fields - error with group by statement

Nov 25, 2017 at 07:18 PM

141

avatar image
Former Member

Hello,

I have problem during checking below code. Error msg like on below screen. I have checked 'fixed point arithmetic' checkbox so I don't have any idea how to solve this issue. Thank you in advance for help.

capture.jpg (66.0 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

4 Answers

Best Answer
Sandra Rossi Nov 25, 2017 at 09:19 PM
0

Make sure that the variable SCANNED is of type I (integer). I guess that this message occurs when you use a variable of type P with number of decimals greater than zero (syntax error message "This Open SQL statement uses additions that can only be used when the fixed point arithmetic flag is activated (such as CASE expressions or host variables in ...")

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Nov 26, 2017 at 09:47 AM
-1

unfortunately I have changed on Integer and it still doesn't work.

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Then maybe the form is only valid for the strict SQL syntax, so you should the @ in front of variables ("host variables") i.e. use INTO @ SCANNED . Or do SELECT COUNT(*) INTO scanned FROM ... to use the non-strict syntax.

1
avatar image
Former Member Nov 26, 2017 at 03:19 PM
-1

Thanks a lot. It works in this way:

So the solution is to change data type for Integer(I) and write code as follow.


capture.jpg (63.4 kB)
Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Nov 26, 2017 at 03:51 PM
-1

Aff, I have antoher problem during group by... I was trying in many ways, with INTO @variable, @var... and with INTO at the end of select statement but it doesn't work. I would be appreciate if you have some tips. Thank you in advance.


capture.jpg (70.1 kB)
Show 1 Share
10 |10000 characters needed characters left characters exceeded

I understand that the syntax is complex, and you should definitely read the ABAP documentation: SELECT. Look at the many examples, that will help you understand how "Open SQL" (the SQL in ABAP) works.

Using a comma for separating fields is allowed only in "strict syntax". The strict syntax means that the variables must be written as host variables (with leading @ ).

If the SELECT returns several lines then you must store the result into an internal table (INTO TABLE).

1