2023 Nov 17 4:12 AM
Dear Experts,
I am developing a SAP ALV report and I have to get two fields sub total based on the customer code. After that I have to divide two columns and paste the result in another column. I have no idea to how to divide two columns and paste the result in another column. Please help me sort out that matter.
Thanks for any solution to that matter.
2023 Nov 17 6:57 AM
I have to get two fields sub total based on the customer code
-> well either you use the alv subtotal feature or you remove the duplicate row of customer code and sum each customer code before calling the ALV
After that I have to divide two columns and paste the result in another column.
-> divide columns? I also have no idea what you are trying to achieve, dividing two column into four? Also, what is this 'result', subtotal of two number columns?
Perhaps showing the example of your current and expected result might help people get a clearer picture of your requirement.
2023 Nov 17 8:23 AM
Dear Siswanto Tan,
I got amount and debtor days subtotal sort by customer code. Therefore, multiple subtotals will show. I want to divide amount column subtotal by debtor days column subtotal and paste the result in another column.
2023 Nov 17 8:55 AM
I don't see the column "debtor days" in your ALV.
Please show your actual ALV and your expected ALV (including all columns).
Simple Excel example is sufficient, just paste the screenshot.
2023 Nov 17 10:07 AM
Basically you need to handle some 'at display' class event such as AFTER_REFRESH that allows to use methods such as CL_GUI_ALV_GRID-GET_SUBTOTALS to read standard calculated subtotals, recalculate and update 'specific' subtotal fields such as percentage or non standard average and then display those with a call REFRESH_TABLE_DISPLAY (Set an attribute to prevent infinite loop)
There should be some solution for CL_SALV_TABLE (but I didn't do it, nobody...)
2023 Nov 17 10:21 AM
2023 Nov 17 1:02 PM
I thought it would clarify my understanding that the result column is a division of AMOUNT by DEBTOR DAYS, but it did not.
Sorry to ask more questions: