ALV Summations and Calculation for different columns

By Thangaraj Paulraj, HLL Life care Ltd

Introduction

This document explains how to get the calculated values at the end of particular column based on summation values of other columns in a simple ALV report output

Below example we have three columns A, B &C

 A and B has the sum Value and C has been calculated based on the sum value of column A and Column B

Column A  -> Sum -> 1+2->3

Column B  -> Sum -> 3+4->7

Column C  -> (Sum of column A / Sum of Column B) * 100 -> (3/7)*100 -> 42.85

Steps to be followed

Develop a normal ALV report with all the relevant inputs

1.     Final Internal table should have the field rowcolor to differentiate the last row color

2.     Define ALV Layout

3.     Build logic for the requirement

4.     Fill the field cat, layout and Call the ALV Grid function module

5.     Output

STEP1 -> Final Internal table should have the field rowcolor to differentiate the last row color

STEP2-> Define ALV Layout

STEP3-> Build logic for the requirement

Use control break statement at last to get the summation.

To differentiate the last row for colouring, fill the field ‘rowcolor’ with proper value

STEP4-> Fill the field cat and Layout and Call the ALV Grid function module

Since already we have calculated the sum, just pass the parameter no_sum = ‘X’ for all the fields

Fill the layout and call the function module

STEP5-> Output

SAP Virtual/Onsite Trainings

Document Categories:

What's New?

Contribute?

Sample Specs

What's Hot?

Web Dynpro for ABAP Tutorials 


Join the Mailing List
Enter name and email address below:
Name:
Email:
Subscribe  Unsubscribe 

Please send us your feedback/suggestions at webmaster@SAPTechnical.COM 

HomeContribute About Us Privacy Terms Of Use • Disclaimer • SafeCompanies: Advertise on SAPTechnical.COM | Post JobContact Us  

Graphic Design by Round the Bend Wizards

footer image footer image