02-03-2010 3:16 AM
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.
02-04-2010 1:24 AM
Is there any way I can convert the data type when moving the data into my internal table?
02-03-2010 5:21 AM
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
02-03-2010 5:55 AM
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.
02-03-2010 5:25 AM
02-04-2010 1:24 AM
Is there any way I can convert the data type when moving the data into my internal table?
02-04-2010 3:42 AM
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
02-04-2010 3:44 AM