cancel
Showing results for 
Search instead for 
Did you mean: 

ALV Total

former_member205842
Participant
0 Kudos

Hi Experts,

                   Hi i have a table with 8 columns, in that i have to multiply 3rd n 6th column and that value(multiplied value) i want to display in last column after that i have to show sum of last column at the end of last column please help to solve this. And let me know how to display only 6 six rows in alv output as i am getting more than 6 rows.

I am not getting in which method i have to write code for multiplying 2 columns immediately when after user entered values in those columns and display it in last column.

Reagrds

Syed

Accepted Solutions (1)

Accepted Solutions (1)

ramakrishnappa
Active Contributor
0 Kudos

Answers (2)

Answers (2)

former_member184578
Active Contributor
0 Kudos

Hi,

You can use ON DATA CHECK event of ALV, create an Event handler method for ON_DATA_CHECK method and get the modified records by using r_param->t_modified_cells. Then Loop the internal table and calculate the multiply of 3rd col and 6th col and set it to last col. Then finally do the sum of last column.

hope this helps,

Regards,

Kiran

TudorRiscutia
Active Participant
0 Kudos

Hello Syed,

     Creating two extra columns and a total line in the ALV table are not that difficult. I'm pretty sure you can find an abundance of tutorials on the internet. However, in order to react to user input immediately you would require access to the WDDOMODIFYVIEW method, which in the case of ALV is impossible. There are certain alternatives:

     1. Create a standard table and write all the coding yourself.

     2. If you also use FPM, there might be a possibility to do this in PROCESS_BEFORE_OUTPUT, yet you won't be able to determine which exact lines were actually modified. But if you only have a small amount of entries, this won't be a problem.

     As for displaying only 6 rows in the ALV, after you get the instance of the CL_SALV_WD_CONFIG_TABLE, you will have a method in IF_SALV_WD_TABLE_SETTINGS~SET_VISIBILE_ROW_COUNT.

     Hope it helps you!


Tudor