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

Select statment Query

Former Member
0 Likes
694

Hi,

I am devloping Query with the table DBERCHZ1

it having two fields

V_ ABRMENGE value 456

N_ ABRMENGE value 0.67899

Here i want to print as 456.67899 with one select statment.

is any way to sum in select statment.

Thanks

5 REPLIES 5
Read only

Former Member
0 Likes
636

My select statment as

select ebelnr, htariftyp, csparte, cvertrag, cvkont, mbelzart, cbegabrpe, cendabrpe, sum (mv_abrmenge, mn_abrmenge), e~budat

from erchc as e

join dberchz1 as m

on ebelnr = mbelnr

join erch as c

on mbelnr = cbelnr

join ever as r

on cvertrag = rvertrag

join eanlh as h

on hanlage = ranlage

where h~tariftyp in @p1@

and c~erchc_v = 'X'

and c~simulation = space

and c~tobreleasd = space

and e~budat in @p2@

and e~simulated = space

and e~tobreleasd = space

and m~belzart in @p3@

and m~belnr in @p4@

Read only

0 Likes
636

its getting syntax error

Read only

0 Likes
636

Hi,

I have just given a code snippet similar to your requirement.

DATA: average TYPE p DECIMALS 2,

sum TYPE p DECIMALS 2.

SELECT AVG( luggweight ) SUM( luggweight )

INTO (average, sum)

FROM sbook.

WRITE: / 'Average:', average,

/ 'Sum :', sum.

.

Just replace with your variables and let me know if it works.

Thanks,

Harini

Read only

0 Likes
636

in select statment sum two fields and show as one field

select x y x from table

here i want to sum y z

Thanks

Read only

Former Member
0 Likes
636

You may be able to do this with native SQL, but I don't see how it can be done in open SQL.

Rob