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: 

problem in alv grid

Former Member
0 Kudos

hello,

i have an alv grid that displays timesheet of employee. it displays the no of hours the employee

has worked on his project on each day of the month.

the table looks like this,

emp_name proj_id 1 2 3 4 5 ... 30 total

abc 010 1 2:30 3 1:20 2:30 ... sum

i want to calculate the addition of the time the employee is worked in the whole month and display

the result in the last column of the grid(total)...

hope i have asked my question clearly..

plz help me out,

thank you...

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hi

LOOp at itab(grid).

temp = temp + itab1-1day + itab1-2day+....itab1-30day .

AT new emp .

itab1-lastcolumn = temp.

clear temp .

endloop.

temp contains the total hrs and is passed to last column.

3 REPLIES 3

Former Member
0 Kudos

Hi,

Have you tried the function sum of alv.

Thanks

Former Member
0 Kudos

hi

LOOp at itab(grid).

temp = temp + itab1-1day + itab1-2day+....itab1-30day .

AT new emp .

itab1-lastcolumn = temp.

clear temp .

endloop.

temp contains the total hrs and is passed to last column.

Former Member
0 Kudos

Hi,

You have to caluculate in this way like.

suppose daily 8 hrs is fixed hours

tot_hr is hours that user worked.

now suppose anu user work 9 hrs,then

add_hr = tot_hr - fix_hr

1 = 9 - 8

if add_hr GT 0.

u have t store taht in another vaiable.

in thsi same way u have to cal culate for exh day.

like

w_add_ tot = w_add_tot + add_hr.

so show this total in your last column.

Thanks & Regards,

Anagha Deshmukh