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: 

Total and SubTotal using CL_SALV

Former Member
0 Kudos

Hello,

Using below thread I am able to get total and subtotal at the ALV output.

But my requirement is to display subtotal at the end of the output. Due to above code I am not getting subtotal at the end.

Below is the scenario :

First 4 lines are ALV output :

Expected output :

AmountCurrency
150USD
200EUR
100EUR
250USD
Subtotal : 300EUR
Subtotal : 400USD

Current Output :

Header 1Header 2
150USD
250USD
Subtotal : 400USD
100EUR
200EUR
Subtotal : 300EUR

Please help in this regard.

Thanks in advance.

1 ACCEPTED SOLUTION

rosenberg_eitan
Active Contributor
0 Kudos

Hi,

Use cl_salv_column_table set_currency_column .

See program SALV_TEST_TABLE_STRUCTURE .

Regards

4 REPLIES 4

raymond_giuseppi
Active Contributor
0 Kudos

If you defined correctlty the amount field, i.e. you linked the field to the currency field in the field catalog. Then you are no longer required to define a sort/sub total on field currency, but the grand total will consist of one line per currency code.

Regards,

Raymond

0 Kudos

Thanks for your reply.

your comment is valid if i am using REUSE_ALV but in my case I am using CL_SALV so I am not using field catalog.


If we can link that in CL_SALV also without creating field catalog then please let me know.


Please let me know in case of concerns.

Regards,

Onkar

rosenberg_eitan
Active Contributor
0 Kudos

Hi,

Use cl_salv_column_table set_currency_column .

See program SALV_TEST_TABLE_STRUCTURE .

Regards

0 Kudos

Thanks a lot, it worked