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: 

Can't total numc in ALV tree

Former Member
0 Kudos

Hi

I am having trouble calculating a column in my ALV tree.

I have a z table that I am getting my data from. The table has a column of type numc. I put the data into an internal table with a few calculations done to it. I use the internal table for my ALV tree. The problem is that i can not calculate totals for this column. I have another column that is type DEC but it calculates ok.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Is there any way I can convert the data type when moving the data into my internal table?

6 REPLIES 6

former_member254311
Active Participant
0 Kudos

Hi

The problem is simple , Since NUMC is character data type no sum can be performed in ALV so kindly change the data type of your internal table field that is integer type I

Try this and revert it

with regards

Anand Kumar

0 Kudos

Anad Kumar

When I change my internal table to have an integer i get the following errors when the sql query runs

Runtime Errors : DBIF_RSQL_INVALID_RS

Exception : CX_SY_OPEN_SQL_DB

Error in the module RSQL accessing the database interface

Ritesh Jha

Through my research I have seen suggestions to include that flag (NUMC_SUM) in the fieldcatalog however I do not see it as part of the lvc_s_fcat structure which I use to build the field catalog. I can see NO_SUM and DO_SUM but i do not see NUMC_SUM.

Former Member
0 Kudos

This message was moderated.

Former Member
0 Kudos

Is there any way I can convert the data type when moving the data into my internal table?

0 Kudos

Hello,

Create another internal table with all same fields as the one you already have with same name. Just change the data type of the field with numc on which you want to perform calculation to type I (integer). Now loop across you table and append all the records into the new internal table and then use that in your ALV tree.

You will have to assign individual fields in the loop, as you can not use itab = itab1.

Hope this helps

Regards,

Sachin

0 Kudos

Yes that is what I have done and it works perfectly. Thankyou