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: 

summing the value of few fields

Former Member
0 Kudos

Hi,

I have a table whose declaration is like this:

TYPES : BEGIN OF ty_employeedata,

basic_salary TYPE ztable-basic_salary,

da TYPE ztable-da,

hra TYPE ztable-hra,

medical TYPE ztable-medical,

bonus TYPE ztable-bonus,

pf TYPE ztable-pf,

tax TYPE ztable-tax,

total TYPE ztable-tax,

END OF ty_employeedata.

DATA : it_employeedata TYPE TABLE OF ty_employeedata WITH HEADER LINE.

Now I am addidng the salary fields to get the salary:

it_employeedata-total = it_employeedata-basic_salary + it_employeedata-da +

it_employeedata-hra + it_employeedata-medical +

it_employeedata-bonus - it_employeedata-pf - it_employeedata-tax.

On debugging it is showing me the total but on screen it is not showing the value.Please suggest the solution.

3 REPLIES 3

Former Member
0 Kudos

Hi Sunil,

If its showing you the value in the debugging the logic is right.Just make a check that you have given all the right field names etc and in the approriate place.

Much Regards,

Amuktha.

Former Member
0 Kudos

Hi,

If you calculating the total after populating the internal table then you need to modify the internal with Total value.

MODIFY ITAB TRANSPORTINg TOTAL INDEX <value>.

Former Member
0 Kudos

hi

i dont fully understand your problem

but after addition you have to append this value to your itab

use modify statement to do this.