on 09-21-2008 8:34 AM
Hi experts,
I have requirement for ALV grid report.
That report is already displaying some fields from an internal table(itab) with one of the field as PERNR .
Now i have three more fileds BETRG(HR:Payroll Amount), ANGHL(HR:Payroll Number) and LGART(Wage type).
And the requirement is to
For every PERNR, add all of their BETRG and add all of thier ANGHL where LGART = '1206' OR '9513'.
Then for every PERNR divide their total of BETRG by total of ANGHL (BETRG/ANGHL).
Now multiply (BETRG/ANGHL) by HOURS which is available in above internal table itab.
Suppose (BETRG/ANGHL) * HOURS = c
Then display c in the report(Current report which has above internal table itab.), for every PERNR.
Can anyone give me direction to start coding for this. Please help.
If i have made this explanation very complex, then please let me know.
Thanks in Advance.
..anusha
Edited by: anusha singh on Sep 21, 2008 9:34 AM
Edited by: anusha singh on Sep 21, 2008 9:54 PM
Hi Anusha,
You have one internal table itab which now has got all the required data that you need to print in the ALV.
Now create a internal table which only display only those fields you'd be displaying in the ALV. Lets say it i_final.
Now you can write a code something like this.
data: l_v_total type i.
sort itab by pernr.
loop at itab into wa_itab
where lgart eq '1206' or
lgart eq '9513'.
at end of pernr.
sum.
l_v_total = wa_itab-betrg / wa_itab-anghl.
l_v_total = l_v_total * wa_itab-hours.
wa_final-pernr = wa_itab-pernr.
wa_final-hours = l_v_total.
append wa_final to i_final.
endat.
endloop.
Mainak Aich
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.