We have added search box. Key in SAP issue keyword to search
TopBottom

Announcement: wanna exchange links? contact me at sapchatroom@gmail.com.

Re: [sap-abap] Report this Error: If the new Open SQL Syntax is used, it Must be used Throughout

Posted by Admin at
Share this post:
Ma.gnolia DiggIt! Del.icio.us Yahoo Furl Technorati Reddit

Reply from Alonso_mx on Nov 15 at 10:53 AM
I?m not sure if its possible to do many operations like you wish, but firts
at all in the query you have to remove the commas for the fields that you
want to select.
2th maybe you can try to change the field in COUNT, if you field CONNID is
unique then try count this field, 3th the "( CONNID )"must be separated
with a blank space of the words
and 4th you have to decide if its a SELECT SINGLE or a normal SELECT
because if you use SELECT then is mandatory that you use INTO TABLE, else
you can use INTO ( Var1, Var2, Var2)

i suggest that make the normal query and before make the calculations. for
example:

SELECT CONNID LUGGWEIGHT
INTO TABLE IT_SBOOK
FROM SBOOK
WHERE CARRID = 'LH' AND FLDATE = '19590228'
GROUP BY CONNID.


DESCRIBE IT_SBOOK INTO VL_COUNT. "For count all records

if you want the unique CONNID is necesary that you use an auxiliar table:
IT_SBOOK_AUX = IT_SBOOK.

DELETE ADJACENT DUPLICATES IT_SBOOK_AUX COMPARING CONNID.

DESCRIBE IT_SBOOK_AUX INTO VL_COUNT. "For count all records


And then you can make the de another two operations with a loop.

i hope it is useful.

Regards



2017-11-15 6:17 GMT-06:00 handsome1234 email@removed:

> Question from handsome1234 on Nov 15 at 7:21 AM
> Simple code get error :report this error:
> If the new Open SQL syntax is used, it must be used throughout. This
> includes using @ to escape host variables.
> code:
> TABLES SBOOK.
> DATA: AACOUNT TYPE I,AASUM TYPE P DECIMALS 2,AAAVG TYPE F.
> DATA: CONNID LIKE SBOOK-CONNID.
> SELECT CONNID, COUNT(*), SUM(LUGGWEIGHT), AVG(LUGGWEIGHT) INTO
> (CONNID,AACOUNT,AASUM,AAAVG)
> FROM SBOOK
> WHERE
> CARRID = 'LH' AND FLDATE = '19590228'
> GROUP BY CONNID.
> WRITE: / CONNID,AACOUNT,AASUM,AAAVG.
> CHECK AASUM > 10.
> WRITE: / ' THE SUM WEITHT>10'.
> ENDSELECT .
>
> *Reply to this email* to post your response.

---------------Original Message---------------
From: handsome1234
Sent: Wednesday, November 15, 2017 7:21 AM
Subject: Report this Error: If the new Open SQL Syntax is used, it Must be used Throughout

Simple code get error :report this error:
If the new Open SQL syntax is used, it must be used throughout. This includes using @ to escape host variables.
code:
TABLES SBOOK.
DATA: AACOUNT TYPE I,AASUM TYPE P DECIMALS 2,AAAVG TYPE F.
DATA: CONNID LIKE SBOOK-CONNID.
SELECT CONNID, COUNT(*), SUM(LUGGWEIGHT), AVG(LUGGWEIGHT) INTO (CONNID,AACOUNT,AASUM,AAAVG)
FROM SBOOK
WHERE
CARRID = 'LH' AND FLDATE = '19590228'
GROUP BY CONNID.
WRITE: / CONNID,AACOUNT,AASUM,AAAVG.
CHECK AASUM > 10.
WRITE: / ' THE SUM WEITHT>10'.
ENDSELECT .

 
Reply to this email to post your response.
 
__.____._
Manage Settings | Unsubscribe | Create FAQ | Send Feedback
  
© 2017 Ziff Davis, LLC. and message author.
Ziff Davis, LLC. 28 E 28th Street New York, NY 10016
Alonso_mx  

Programmer/Developer - Software
 
Mark as helpful
View this online
Ask a new question
 
In the Spotlight
Become a blogger at Toolbox.com and share your expertise with the community. Start today.

_.____.__

0 comments:

Post a Comment

T r a n s l a t e to your language