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: 

Adding up entries of 2 different columns of a table in a single view column

Former Member
0 Kudos

Hi All,

I have a requirement wherein I have to add up the entries of 2 different columns of 2 different database tables and show it in one column of a View.

Eg. Table A has column A and Table B has column B. I create a view C with column C.

Now Col C = Col A + Col B

Can anyone please let me know how this view can be created?

Thanks,

Momdipa

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Momdipa,

ABAP Table View does not support dynamic arithmetic operations. So, you can't achieve this business logic in the view. There are no operators in the view which can help you to do this.

If you need this functionality, you need to create a ABAP Report to calculate the sum on the execution of the Report. And then you can update the View based on your own business logic.

Hope this helps.

Thanks,

Samantak.

4 REPLIES 4

Former Member
0 Kudos

Hi Momdipa,

ABAP Table View does not support dynamic arithmetic operations. So, you can't achieve this business logic in the view. There are no operators in the view which can help you to do this.

If you need this functionality, you need to create a ABAP Report to calculate the sum on the execution of the Report. And then you can update the View based on your own business logic.

Hope this helps.

Thanks,

Samantak.

0 Kudos

Hi Samantak,

Thanks for your answer. So, you mean from the report we update the view with this final list. I agree with it.

But actually, I was looking for an option from the view if at all it existed.

0 Kudos

Hi,

Using a view you will not be able to achieve this requirement. So, I guess you have to figure a work around for it. Like you can use a Table Maintainence Generator to create the Maintainence View and a module pool logic to display the summation of column A and Column B in Column C. But the user has to execute the View and have to Save it explicitly to get he updated values.

Hope this helps.

Thanks,

Samantak.

0 Kudos

Thanks Samantak.