‎2006 Dec 07 7:34 PM
Hi experts my problem is
II have a database table and i need read this data base table in to an internal .Here for same time period(one week time period ) and same personnal number there may exists two different reccords i.e with type of time entry :
a)over time or
b)paid time offs
After this i need compare records in this internal table in such way that
Records having Same personnal number ,same time period but with different time entry procedure
i.e Over time and paid time off in my case (Diffrentiation done with this type of time entry)
should be diplayed in one row with two columns for Overtime and paid time off
thanks
‎2006 Dec 07 8:15 PM
Hi Prashant,
Use the followign logic.
Loop at Itab1.
Initialise the sum.
sum = sum + Time
on change of Personal No.
update ITAB2 with new record and put in teh new time there.
endon.
End loop.
This will work.
Regards,
Guru
‎2006 Dec 07 8:17 PM
Here are the steps:
DATA: BEGIN OF WA,
OVER_TIME type yourtype
PAID_TIME type yourtype,
END OF WA.
DATA: I_FINAL TABLE OF WA.
1. Select both the records over time and paid time offs from Database table into Itab.
2. READ table itab for over time.
if sy-subrc EQ 0.
Assign the value to wa-OVER_TIME.
endif.
3. READ table itab for paind time
if sy-subrc EQ 0.
Assign the value to wa-PAID_TIME.
endif.
append wa to I_FINAL.Here I_FINAL will have the both over & Paid time in the same column.
Raja T
‎2006 Dec 07 8:31 PM
Try something like:
REPORT ztest MESSAGE-ID 00.
DATA: BEGIN OF raw_itab OCCURS 0,
pno type ...,
proc type ...,
amt type ...,
end of raw_itabr.
DATA: BEGIN OF sum_itab OCCURS 0.
pno type ...,
ot type ...,
pto type ...,
DATA: END OF sum_itab.
SELECT pno proc amt
INTO TABLE raw_itab
WHERE...
loop at raw_itab.
sum_itab-pno = raw_itab-pno.
if raw_itab-proc = 'OT'.
sum_itab-ot = raw_itab-amt.
elseif raw_itab-proc = 'PTO'.
sum_itab-pto = raw_itab-amt.
endif.
collect sum_itab.
endloop.
Rob