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: 

Use Aggregate Functions in a View

Former Member
0 Kudos

Is it possible to create a view in SE11 using an aggregate SQL function?

I.e., I want the generated SQL to look like:


CREATE VIEW z_tbl
(
A,
SUM_AMT
)
AS SELECT
A,
SUM(AMT)
FROM TBL
GROUP BY A

Thanks for any help.

2 REPLIES 2

LucianoBentiveg
Active Contributor
0 Kudos

Executes the Native SQLstatements enclosed between EXEC SQL and ENDEXEC statements. Unlike Open SQLNative SQL statements can address tables that are not declared in theABAP Dictionary.

Example

Creating the Table AVERI_CLNT:

EXEC SQL.

CREATE TABLE AVERI_CLNT (

CLIENT CHAR(3) NOT NULL,

ARG1 CHAR(3) NOT NULL,

ARG2 CHAR(3) NOT NULL,

FUNCTION CHAR(10) NOT NULL,

PRIMARY KEY (CLIENT, ARG1, ARG2)

)

ENDEXEC.

0 Kudos

Thanks, Peluka.

But if I create a view using Native SQL, I believe that the view won't exist in the ABAP dictionary. Will that mean that I can only access the view using NATIVE SQL, rather an OPENSQL?

I think our Basis guy might frown upon it, too.