12-11-2015 9:44 AM
Hello Experts,
i have created a query using logical database IOC.
I need to use the sum total of a column in another field.
Can we achieve this using local field in sq01 but am not getting the formula for summing the total of a column.
I tried adding a additional field in sq02 and tried some codes reference from other SCN blogs but still did not work
I wanted to use the total of a column in another field .
Thanks,
Vivek
12-11-2015 10:01 AM
According to me such are the requirements need to involve the internal tables of Query, which is not easy. So for such requirements ABAP report programs would be better.
12-11-2015 10:03 AM
Additional field in InfoSet(SQ02) is the right direction. Maybe you can share more details about your requirement.
12-11-2015 10:13 AM
requirement is i want to use the sum total of IOOPCOMP-ENWRT in another field.
I created a additional field TOTVAL in sq02 and included below code
select sum (ENWRT ) FROM IOOPCOMP
WHERE IOOPCOMP-WERKS = '9100'.
got the below error.
"IOOPCOMP" is not defined in the ABAP Dictionary as a table, projection.
code was just take from other post. Please help me in getting the code working.or alternate solutions to fulfill my requirement.
Thanks,
Vivek
12-11-2015 10:22 AM
As I mentioned the Total value at run-time can be derived only by accessing the internal tables of the program.
12-11-2015 10:38 AM
yes i understand. So this means to say that i will have to go with ABAP report program right.No other Alternatives
12-11-2015 10:39 AM
12-11-2015 11:24 AM
Try with
SELECT SUM( enwrt ) INTO totval FROM resb
WHERE werks EQ '9100'.
12-11-2015 12:36 PM
12-11-2015 12:50 PM
Check field totval defined for node IOOPCOMP with LIKE-Reference IOOPCOMP-ENWRT and coding is assigned to Field totval.