cancel
Showing results for 
Search instead for 
Did you mean: 

Calculation View Using SQL

former_member213277
Active Participant
0 Kudos

Hello Experts,

I need to create a Calculation View using SQL (Using both plain SQL and using CE functions)  for the below requirement.

I am having a table: T_MKPF from which i will be fetching MBLNR, BUDAT with user input on BUDAT, then I will get the list of values for MBLNR and load into table T_MSEG (which has fields MBLNR, BLART, SALK3) to fetch field SALK3. Then I want to display SALK3 values aggregated by MBLNR, BLART by restricting BLART with value 'WA'.

Thanks in advance.

Regards,

Nag

Accepted Solutions (0)

Answers (1)

Answers (1)

lbreddemann
Active Contributor
0 Kudos

Hi Nag,

so what's your question now precisely?

From what you describe one might think that a attribute view and an analytic view would do the trick.

As all you ask for is joining tables, filtering based on user input and aggregating data, there is no need for a calc. view.

Anyhow, as long as you don't tell us what your problem is, we cannot do much about it.

- Lars

former_member213277
Active Participant
0 Kudos

Hi Lars,

Thanks for your reply.

Both T_MKPF and T_MSEG are tables, and as you mentioned it can be achieved by joining tables and filtering.... But just for practice purpose I wanted to implement it as SQL based( using both CE and Plain SQL) calculation view.

Could you please help me how to implement it

Regards,

Nag

former_member213277
Active Participant
0 Kudos

Hi Lars,

Thanks for your reply.

Both T_MKPF and T_MSEG are tables, and as you mentioned it can be achieved by joining tables and filtering.... But just for practice purpose I wanted to implement it as SQL based( using both CE and Plain SQL) calculation view.

Could you please help me how to implement it

Regards,

Nag

lbreddemann
Active Contributor
0 Kudos

Hmm.... I get your point, but then again: you want to try out the programming to gain experience.

So, there's little in it if I just create a calc view for you know.

You've got to do it yourself.

In the developer guides (available http://help.sap.com/hana_appliance) there are plenty of little examples, that demonstrate the different commands.

All you got to do now is to suit these to your requirements.

Just start step by step and extend the SQLScript as you go - just the same stuff you'd do with any other programming language...

- Lars