Application Development and Automation 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: 
Read only

Help needed for calculation in report

Former Member
0 Likes
705

Hello all, I am facing problem with this requirement.

I have some fields (EMPNUM, BASIC, HRA, INST, TOTALSAL)in my internal table I_EMPTAB from EMPTAB.

Now i want to dispaly the data of all my fields, and total salary of each field in a last column as TOTALSAL.

Please suggest me how to go about this issue.

thnx in advance.

sreenivas.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
675
select empnum basic HRA INST
       into table i_emptab 
       from emptab
       where(Put your condition here).  


loop at i_emptab into wa_emptab.

wa_emptab-totalsal = wa_emptab-empnum + wa_emptab-basic + wa_emptab-HRA + wa_emptab-inst.

modify i_emptab from wa_emptab.
endloop.

Message was edited by: mukesh kumar

Hello all, I am facing problem with this requirement.

I have some fields (EMPNUM, BASIC, HRA, INST, TOTALSAL)in my internal table I_EMPTAB from EMPTAB.

Now i want to dispaly the data of all my fields, and total salary of each field in a last column as TOTALSAL.

Please suggest me how to go about this issue.

thnx in advance.

sreenivas.

4 REPLIES 4
Read only

Former Member
0 Likes
675

loop at itab.

itab-total = itab-hra + itab-bsic + itab-int.

modify itab.

clear itab.

endloop.

now ur all field all in itab.

use alv or simple report to display it.

Read only

Former Member
0 Likes
675

You will have calculate the total salary manually.

Loop at the table and calculate the total.

LOOP AT ITAB.

ITAB-TOTAL_SAL = ITAB-BASIC + ...

MODIFY ITAB.

ENDLOOP.

Now you write the output using the internal table, you will see the total salry.

Regards,

Ravi

Note : Please mark all the helpful answers

Read only

0 Likes
675

Thanks all.

Read only

Former Member
0 Likes
676
select empnum basic HRA INST
       into table i_emptab 
       from emptab
       where(Put your condition here).  


loop at i_emptab into wa_emptab.

wa_emptab-totalsal = wa_emptab-empnum + wa_emptab-basic + wa_emptab-HRA + wa_emptab-inst.

modify i_emptab from wa_emptab.
endloop.

Message was edited by: mukesh kumar